Skip to content

Commit 2d5378b

Browse files
authored
refactor(core): move dialog API to its own plugin (#6717)
1 parent 3f17ee8 commit 2d5378b

File tree

28 files changed

+117
-1838
lines changed

28 files changed

+117
-1838
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-bundler": patch
3+
---
4+
5+
Removed the `UpdaterSettings::dialog` field.

.changes/move-dialog-plugin.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri": patch
3+
"api": patch
4+
---
5+
6+
Moved the dialog APIs to its own plugin in the plugins-workspace repository.

.changes/remove-updater-dialog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri": patch
3+
"tauri-utils": patch
4+
---
5+
6+
Remove the updater's dialog option.

core/config-schema/schema.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@
172172
},
173173
"updater": {
174174
"active": false,
175-
"dialog": true,
176175
"pubkey": "",
177176
"windows": {
178177
"installMode": "passive",
@@ -426,7 +425,6 @@
426425
"description": "The updater configuration.",
427426
"default": {
428427
"active": false,
429-
"dialog": true,
430428
"pubkey": "",
431429
"windows": {
432430
"installMode": "passive",
@@ -2476,11 +2474,6 @@
24762474
"default": false,
24772475
"type": "boolean"
24782476
},
2479-
"dialog": {
2480-
"description": "Display built-in dialog or use event system if disabled.",
2481-
"default": true,
2482-
"type": "boolean"
2483-
},
24842477
"endpoints": {
24852478
"description": "The updater endpoints. TLS is enforced on production.\n\nThe updater URL can contain the following variables: - {{current_version}}: The version of the app that is requesting the update - {{target}}: The operating system name (one of `linux`, `windows` or `darwin`). - {{arch}}: The architecture of the machine (one of `x86_64`, `i686`, `aarch64` or `armv7`).\n\n# Examples - \"https://my.cdn.com/latest.json\": a raw JSON endpoint that returns the latest version and download links for each platform. - \"https://updates.app.dev/{{target}}?version={{current_version}}&arch={{arch}}\": a dedicated API with positional and query string arguments.",
24862479
"type": [

core/tauri-utils/src/config.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,9 +2335,6 @@ pub struct UpdaterConfig {
23352335
/// Whether the updater is active or not.
23362336
#[serde(default)]
23372337
pub active: bool,
2338-
/// Display built-in dialog or use event system if disabled.
2339-
#[serde(default = "default_true")]
2340-
pub dialog: bool,
23412338
/// The updater endpoints. TLS is enforced on production.
23422339
///
23432340
/// The updater URL can contain the following variables:
@@ -2367,8 +2364,6 @@ impl<'de> Deserialize<'de> for UpdaterConfig {
23672364
struct InnerUpdaterConfig {
23682365
#[serde(default)]
23692366
active: bool,
2370-
#[serde(default = "default_true")]
2371-
dialog: bool,
23722367
endpoints: Option<Vec<UpdaterEndpoint>>,
23732368
pubkey: Option<String>,
23742369
#[serde(default)]
@@ -2385,7 +2380,6 @@ impl<'de> Deserialize<'de> for UpdaterConfig {
23852380

23862381
Ok(UpdaterConfig {
23872382
active: config.active,
2388-
dialog: config.dialog,
23892383
endpoints: config.endpoints,
23902384
pubkey: config.pubkey.unwrap_or_default(),
23912385
windows: config.windows,
@@ -2397,7 +2391,6 @@ impl Default for UpdaterConfig {
23972391
fn default() -> Self {
23982392
Self {
23992393
active: false,
2400-
dialog: default_true(),
24012394
endpoints: None,
24022395
pubkey: "".into(),
24032396
windows: Default::default(),
@@ -3246,7 +3239,6 @@ mod build {
32463239
impl ToTokens for UpdaterConfig {
32473240
fn to_tokens(&self, tokens: &mut TokenStream) {
32483241
let active = self.active;
3249-
let dialog = self.dialog;
32503242
let pubkey = str_lit(&self.pubkey);
32513243
let endpoints = opt_lit(
32523244
self
@@ -3262,15 +3254,7 @@ mod build {
32623254
);
32633255
let windows = &self.windows;
32643256

3265-
literal_struct!(
3266-
tokens,
3267-
UpdaterConfig,
3268-
active,
3269-
dialog,
3270-
pubkey,
3271-
endpoints,
3272-
windows
3273-
);
3257+
literal_struct!(tokens, UpdaterConfig, active, pubkey, endpoints, windows);
32743258
}
32753259
}
32763260

@@ -3596,7 +3580,6 @@ mod test {
35963580
},
35973581
updater: UpdaterConfig {
35983582
active: false,
3599-
dialog: true,
36003583
pubkey: "".into(),
36013584
endpoints: None,
36023585
windows: Default::default(),

core/tauri/Cargo.toml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ ico = { version = "0.2.0", optional = true }
8282
encoding_rs = "0.8.31"
8383

8484
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
85-
rfd = { version = "0.11", optional = true, features = [ "gtk3", "common-controls-v6" ] }
8685
notify-rust = { version = "4.5", optional = true }
8786

8887
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
@@ -157,7 +156,6 @@ native-tls = [ "reqwest/native-tls" ]
157156
native-tls-vendored = [ "reqwest/native-tls-vendored" ]
158157
rustls-tls = [ "reqwest/rustls-tls" ]
159158
process-command-api = [ "shared_child", "os_pipe" ]
160-
dialog = [ "rfd" ]
161159
notification = [ "notify-rust" ]
162160
system-tray = [ "tauri-runtime/system-tray", "tauri-runtime-wry/system-tray" ]
163161
devtools = [ "tauri-runtime/devtools", "tauri-runtime-wry/devtools" ]
@@ -187,11 +185,11 @@ clipboard-all = [ "clipboard-write-text", "clipboard-read-text" ]
187185
clipboard-read-text = [ ]
188186
clipboard-write-text = [ ]
189187
dialog-all = [ "dialog-open", "dialog-save", "dialog-message", "dialog-ask" ]
190-
dialog-ask = [ "dialog" ]
191-
dialog-confirm = [ "dialog" ]
192-
dialog-message = [ "dialog" ]
193-
dialog-open = [ "dialog" ]
194-
dialog-save = [ "dialog" ]
188+
dialog-ask = [ ]
189+
dialog-confirm = [ ]
190+
dialog-message = [ ]
191+
dialog-open = [ ]
192+
dialog-save = [ ]
195193
fs-all = [
196194
"fs-copy-file",
197195
"fs-create-dir",

core/tauri/scripts/bundle.global.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)