* fix(utils): fix resources map becomes directory
closes#10187
Fixes the behavior of mapped resources generating extra directory, for example:
`"../resources/user.json": "resources/user.json"` generates this resource `resources/user.json/user.json`
where it should generate `resources/user.json`
This PR includes a refactor of the Iterator implementation which splits it into more scoped functions and relis on recursing instead of a loop which makes the code a lot more readable and easier to maintain.
* clippy
* cover more cases
* clippy
* fix glob into directory, not resolving target correctly
* return error when resource origin path doesn't exist
* fix resources example build
* Update .changes/resources-map-becoming-dirs.md
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* refactor(core): serialize response once closes#5641
This change impacts both the custom protocol and the postMessage based IPC implementations. Basically it changes the whole IPC mechanism to work on raw JSON strings so we do not need to serialize a serde_json::Value after serializing to it from a user-provided type.
i benchmarked this with a 150MB file response (returning Vec<u8> instead of tauri::ipc::Response since the latter does not serialize at all) and it went from 29s to 23s (custom protocol) and from 54s to 48s (post message) on macOS.
* fix mobile & lint
* clippy
* refactor(core): return 200 on any IPC call, closes#10286
By default the webview prints a `Failed to load resource: the server responded with a status of 400 (Bad Request) ipc://localhost` error message when a command returns an error, which is confusing to users.
This changes the IPC to return status 200 on any call, with a header to indicate whether the result was ok or not. This removes the console error, which would only log the actual error result if it isn't caught by the user.
* add change file
* apply code review changes
The IPC fallback system kicks in when the custom protocol implementation cannot be used (e.g. CORS issues).
The fallback uses the postMessage mechanism, which by default uses channels to send large responses. If the custom protocol implementation cannot be used, we should not use channels, but eval the response directly.
* chore: update brotli dependency to v6
brotli v6 plays nice with other versions of the same crate
* add change file
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* refactor: remove targetSdk as it is being removed in DSL 9.0
* note
* fix: typo
* update: changelog
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
---------
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
* feat: Add option to allow all commands by default
* option to use a list of permissions, move logic to tauri-build
* fix plugin
* add utils change file
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* hash codegen image cache output
* remove left over dbg! statement
* prevent info.plist from workspace rebuilds
* prevent schema generation from workspace rebuilds
* use new `Cached` struct in `CachedIcon`
* fmt
* use full import for cached plist
* use `to_vec()` for raw icons
* hide `Invoke` from documentation
* make `Asset` non-exhaustive
* make `InvokeRequest` non-exhaustive
* mark `tauri_utils::platform::Target` non-exhaustive
* mark the runtime crates as unstable API
* Revert "mark the runtime crates as unstable API" [skip ci]
This reverts commit b8377222e3.
* mark the runtime crates as unstable API
* Revert "mark the runtime crates as unstable API" [skip ci]
This reverts commit 9284897644.
* mark the runtime crates as unstable API
* mark tauri_utils::TitleBarStyle as `#[non_exhaustive]`
* mark `InvokeRequest` as non_exhaustive unless `unstable` feature
* mark config and acl items as unstable
* feat(core): fallback to file system for AssetResolver::get, closes#8411
Ports #10356 to v2
* fix test
---------
Co-authored-by: Chip Reed <chip@chip.sh>
* add failable try_build for plugin builder
* add changefile
* implement `Hash`, `PartialEq` for `BuilderError`
* mark config and acl items as unstable
give some doc tips if they need to be used from Rust
* Revert "mark config and acl items as unstable" [skip ci]
This reverts commit e23728edb6.
* Conf parsing error displays `tauri.conf.json` when using toml or json5
Conf parsing error always displays `tauri.conf.json` as path, even when using `Tauri.toml` or `tauri.conf.json5`
Example Error Message when using Tauri.toml:
Error unable to parse toml Tauri config file at
/Users/bla/repo/bla/bla/src-tauri/tauri.conf.json because
invalid TOML value, did you mean to use a quoted string? at line 41
column 7
* merge changefile pr into main pr
* Update and rename fix-conf-parsing-error-filepath to fix-conf-parsing-error-filepath.md
---------
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>