4.8 KiB
- Feature Name: tauri_config_restructure
- Start Date: 2023-12-20
- RFC PR: tauri-apps/rfcs#13
- Tracking Issue:
Summary
Restructuring the tauri.conf.json for more simplicity, consistency and clarity.
Motivation
The current tauri.conf.json has a bunch of objects that don't necessarily follow a rule that could reason why they exist there and thus makes it awkward to figure out where to add new fields
for example tauri > bundle object is a configuration for the CLI, why does it exist inside tauri object, another example is the plugins object which is a tauri feature, why does it exist outside of tauri object?
These inconsistencies will make it harder to add new fields to the config.
Guide-level explanation
- Unpack
packagefields to the root object. - Rename
tauriobject toapp. - Move
tauri > bundle > identifierto the root object as it is used by other places in tauri other than bundling. - Remove
bundle > updateras the only useful key it has, ispubkeyfield and that should be moveed toplugin > updater > pubkey. This will require changes in the CLI to only sign the bundles whenTAURI_SIGNING_PRIVATE_KEYkey is set . This will also fix a huge DX when usingtauri-plugin-updaterand you endup having to configure updater-related configs once inbundle > updaterandplugin > updater. - Move
build > withGlobalTaurito the newapp > withGlobaltauriobject. - Move
tauri > patterntoapp > security > patternand make it accept a simple string forbrownfield. - Move
tauri > cliandtauri > updatefields toplugins > cliandplugins > updateas they are plugins now. - Rename
build > distDirtobuild > frontendDistto explicitly set the intent of the option. - Rename
build > devPathtobuild > devUrland only accept urls, if users don't have a devServer, they should remove this field and only setbuild > frontendDistwhich will make the CLI start its built-in devServer or fallback to embed the assets if--no-dev-serveris used. - Move
tauri > bundleto root object.
| Current Config | New Config |
|---|---|
|
|
Community Considerations
This will be a breaking change and so users will need to restructure the config themselves or rely on tauri migrate command.
Drawbacks
Almost all current Tauri users will need to migrate to the new breaking changes but it is better to do this now in a major release.