Skip to content

Commit

Permalink
Merge branch '1.x' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Dec 19, 2023
2 parents 6cd6d3f + 50a3d17 commit a9b87c0
Show file tree
Hide file tree
Showing 50 changed files with 725 additions and 331 deletions.
5 changes: 5 additions & 0 deletions .changes/api-module-resolution-node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tauri-apps/api": "patch:bug"
---

Fix a regression where typescript could not find types when using `"moduleResolution": "node"`
5 changes: 5 additions & 0 deletions .changes/arboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-runtime-wry": patch:bug
---

Use `arboard` instead of `tao` clipboard implementation to prevent a crash.
5 changes: 5 additions & 0 deletions .changes/config-f64-deserialize.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri-utils': 'patch:bug'
---

Fix compile error when parsing config that includes float values.
5 changes: 5 additions & 0 deletions .changes/dialog-window-forward-slash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri': 'patch:bug'
---

On Windows, fix `open` dialog `defaultPath`, when invoked from JS, not working if the path uses forward slash (`/`)
5 changes: 0 additions & 5 deletions .changes/nsis-german.md

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/test-cli-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ jobs:
with:
workspaces: tooling/cli

- name: build CLI
run: cargo build --manifest-path ./tooling/cli/Cargo.toml ${{ matrix.platform.args }}
- name: test CLI
run: cargo test --manifest-path ./tooling/cli/Cargo.toml ${{ matrix.platform.args }}
6 changes: 6 additions & 0 deletions core/tauri-macros/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@
- First mobile alpha release!
- [fa3a1098](https://www.github.com/tauri-apps/tauri/commit/fa3a10988a03aed1b66fb17d893b1a9adb90f7cd) feat(ci): prepare 2.0.0-alpha.0 ([#5786](https://www.github.com/tauri-apps/tauri/pull/5786)) on 2022-12-08

## \[1.4.2]

### Enhancements

- [`5e05236b`](https://www.github.com/tauri-apps/tauri/commit/5e05236b4987346697c7caae0567d3c50714c198)([#8289](https://www.github.com/tauri-apps/tauri/pull/8289)) Added tracing for window startup, plugins, `Window::eval`, events, IPC, updater and custom protocol request handlers behind the `tracing` feature flag.

## \[1.4.1]

### Dependencies
Expand Down
3 changes: 2 additions & 1 deletion core/tauri-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rust-version = { workspace = true }
proc-macro = true

[dependencies]
proc-macro2 = "1"
proc-macro2 = { version = "1", features = [ "span-locations" ] }
quote = "1"
syn = { version = "2", features = [ "full" ] }
heck = "0.4"
Expand All @@ -29,3 +29,4 @@ compression = [ "tauri-codegen/compression" ]
isolation = [ "tauri-codegen/isolation" ]
config-json5 = [ "tauri-codegen/config-json5", "tauri-utils/config-json5" ]
config-toml = [ "tauri-codegen/config-toml", "tauri-utils/config-toml" ]
tracing = [ ]
50 changes: 50 additions & 0 deletions core/tauri-macros/src/command/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,32 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {

let root = attrs.root;

let kind = match attrs.execution_context {
ExecutionContext::Async if function.sig.asyncness.is_none() => "sync_threadpool",
ExecutionContext::Async => "async",
ExecutionContext::Blocking => "sync",
};

let loc = function.span().start();
let line = loc.line;
let col = loc.column;

let maybe_span = if cfg!(feature = "tracing") {
quote!({
let _span = tracing::debug_span!(
"ipc::request::handler",
cmd = #message.command(),
kind = #kind,
loc.line = #line,
loc.col = #col,
is_internal = false,
)
.entered();
})
} else {
quote!()
};

// Rely on rust 2018 edition to allow importing a macro from a path.
quote!(
#async_command_check
Expand All @@ -231,6 +257,8 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
#[allow(unused_variables)]
let #root::ipc::Invoke { message: #message, resolver: #resolver } = $invoke;

#maybe_span

#body
}};
}
Expand All @@ -254,6 +282,21 @@ fn body_async(
) -> syn::Result<TokenStream2> {
let Invoke { message, resolver } = invoke;
parse_args(function, message, attributes).map(|args| {
#[cfg(feature = "tracing")]
quote! {
use tracing::Instrument;

let span = tracing::debug_span!("ipc::request::run");
#resolver.respond_async_serialized(async move {
let result = $path(#(#args?),*);
let kind = (&result).async_kind();
kind.future(result).await
}
.instrument(span));
return true;
}

#[cfg(not(feature = "tracing"))]
quote! {
#resolver.respond_async_serialized(async move {
let result = $path(#(#args?),*);
Expand Down Expand Up @@ -284,7 +327,14 @@ fn body_blocking(
Err(err) => { #resolver.invoke_error(err); return true },
});

let maybe_span = if cfg!(feature = "tracing") {
quote!(let _span = tracing::debug_span!("ipc::request::run").entered();)
} else {
quote!()
};

Ok(quote! {
#maybe_span
let result = $path(#(match #args #match_body),*);
let kind = (&result).blocking_kind();
kind.block(result, #resolver);
Expand Down
6 changes: 6 additions & 0 deletions core/tauri-runtime-wry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@
- Support `with_webview` for Android platform alowing execution of JNI code in context.
- [8ea87e9c](https://www.github.com/tauri-apps/tauri/commit/8ea87e9c9ca8ba4c7017c8281f78aacd08f45785) feat(android): with_webview access for jni execution ([#5148](https://www.github.com/tauri-apps/tauri/pull/5148)) on 2022-09-08

## \[0.14.2]

### Enhancements

- [`5e05236b`](https://www.github.com/tauri-apps/tauri/commit/5e05236b4987346697c7caae0567d3c50714c198)([#8289](https://www.github.com/tauri-apps/tauri/pull/8289)) Added tracing for window startup, plugins, `Window::eval`, events, IPC, updater and custom protocol request handlers behind the `tracing` feature flag.

## \[0.14.1]

### Enhancements
Expand Down
2 changes: 2 additions & 0 deletions core/tauri-runtime-wry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ tauri-runtime = { version = "1.0.0-alpha.7", path = "../tauri-runtime" }
tauri-utils = { version = "2.0.0-alpha.12", path = "../tauri-utils" }
raw-window-handle = "0.5"
http = "0.2"
tracing = { version = "0.1", optional = true }

[target."cfg(windows)".dependencies]
webview2-com = "0.28"
Expand Down Expand Up @@ -47,3 +48,4 @@ macos-private-api = [
]
objc-exception = [ "wry/objc-exception" ]
linux-protocol-body = [ "wry/linux-body", "webkit2gtk/v2_40" ]
tracing = [ "dep:tracing" ]
Loading

0 comments on commit a9b87c0

Please sign in to comment.