Skip to content

Commit fbeb5b9

Browse files
refactor(core): use webview's URI schemes for IPC (#7170)
Co-authored-by: chip <chip@chip.sh>
1 parent 85efd0a commit fbeb5b9

File tree

80 files changed

+2066
-1146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2066
-1146
lines changed

.changes/channel-rust.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch:enhance
3+
---
4+
5+
Added `Channel::new` allowing communication from a mobile plugin with Rust.

.changes/ipc-custom-protocol.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri": patch:enhance
3+
"tauri-utils": patch:enhance
4+
---
5+
6+
Use custom protocols on the IPC implementation to enhance performance.

.changes/ipc-refactor.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri": patch:breaking
3+
"tauri-macros": patch:breaking
4+
---
5+
6+
Moved `tauri::api::ipc` to `tauri::ipc` and refactored all types.

.changes/linux-ipc-body-feature.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch:breaking
3+
---
4+
5+
Removed the `linux-protocol-headers` feature (now always enabled) and added `linux-ipc-protocol`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-runtime-wry": patch:breaking
3+
---
4+
5+
Removed the `linux-headers` feature (now always enabled) and added `linux-protocol-body`.

.changes/migrate-csp.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": patch:enhance
3+
"@tauri-apps/cli": patch:enhance
4+
---
5+
6+
Update migrate command to update the configuration CSP to include `ipc:` on the `connect-src` directive, needed by the new IPC using custom protocols.

.github/workflows/lint-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
clippy:
5151
- { args: '', key: 'empty' }
5252
- {
53-
args: '--features compression,wry,linux-protocol-headers,isolation,custom-protocol,system-tray,test',
53+
args: '--features compression,wry,isolation,custom-protocol,system-tray,test',
5454
key: 'all'
5555
}
5656
- { args: '--features custom-protocol', key: 'custom-protocol' }

.github/workflows/test-core.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
key: no-default
7373
}
7474
- {
75-
args: --features compression,wry,linux-protocol-headers,isolation,custom-protocol,system-tray,test,
75+
args: --features compression,wry,isolation,custom-protocol,system-tray,test,
7676
key: all
7777
}
7878

@@ -98,6 +98,11 @@ jobs:
9898
workspaces: core -> ../target
9999
save-if: ${{ matrix.features.key == 'all' }}
100100

101+
- name: Downgrade crates with MSRV conflict
102+
# The --precise flag can only be used once per invocation.
103+
run: |
104+
cargo update -p time --precise 0.3.23
105+
101106
- name: test
102107
uses: actions-rs/cargo@v1
103108
with:

core/tauri-macros/src/command/wrapper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
211211
use #root::command::private::*;
212212
// prevent warnings when the body is a `compile_error!` or if the command has no arguments
213213
#[allow(unused_variables)]
214-
let #root::Invoke { message: #message, resolver: #resolver } = $invoke;
214+
let #root::ipc::Invoke { message: #message, resolver: #resolver } = $invoke;
215215

216216
#body
217217
}};

core/tauri-runtime-wry/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ macos-private-api = [
4848
"tauri-runtime/macos-private-api"
4949
]
5050
objc-exception = [ "wry/objc-exception" ]
51-
linux-headers = [ ]
51+
linux-protocol-body = [ "wry/linux-body", "webkit2gtk/v2_40" ]

0 commit comments

Comments
 (0)