Skip to content

fix(android): Speed up async dev assets loading#1715

Open
DeTeam wants to merge 2 commits into
tauri-apps:devfrom
DeTeam:android-unlock-assets
Open

fix(android): Speed up async dev assets loading#1715
DeTeam wants to merge 2 commits into
tauri-apps:devfrom
DeTeam:android-unlock-assets

Conversation

@DeTeam
Copy link
Copy Markdown

@DeTeam DeTeam commented Apr 13, 2026

Looks like on Android besides loading assets sync in the tauri land we also have a single mutex lock point when accessing custom protocol handler. This PR allows releasing the lock sooner by cloning the underlying handler.

DeTeam added 2 commits April 13, 2026 14:52
Attempting to speed up assets loading on Android with this
@DeTeam DeTeam requested a review from a team as a code owner April 13, 2026 13:11
@DeTeam DeTeam changed the title fix: Speed up Android dev assets loading fix: Speed up Android async dev assets loading Apr 13, 2026
@DeTeam DeTeam changed the title fix: Speed up Android async dev assets loading fix(android): Speed up async dev assets loading Apr 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Package Changes Through 22fa8fb

There are 1 changes which include wry with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
wry 0.55.0 0.56.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Comment thread src/android/binding.rs
Copy link
Copy Markdown
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from my part, still want some opinions from other members though

Comment thread src/lib.rs
@@ -644,7 +644,7 @@ struct WebViewAttributes<'a> {
/// locate your files in those directories. For more information, see [Loading in-app content](https://developer.android.com/guide/webapps/load-local-content) page.
/// - iOS: To get the path of your assets, you can call [`CFBundle::resources_path`](https://docs.rs/core-foundation/latest/core_foundation/bundle/struct.CFBundle.html#method.resources_path). So url like `wry://assets/index.html` could get the html file in assets directory.
pub custom_protocols:
Copy link
Copy Markdown
Contributor

@Legend-Master Legend-Master May 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucasfernog We do require Send + Sync in tauri, and this change does reflect what we're actually doing, any thoughts?

https://docs.rs/tauri/latest/tauri/struct.Builder.html#method.register_uri_scheme_protocol

Alternatively, we could send the request to main thread and handle things there

@Legend-Master Legend-Master requested a review from lucasfernog May 4, 2026 08:00
@DeTeam
Copy link
Copy Markdown
Author

DeTeam commented May 10, 2026

This change together with tauri-apps/tauri#15220 can nicely speed things up both modern platforms 😊 just a little nudge/reminder so this PR doesn't get lost, if that's ok @lucasfernog, whenever you have time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] vite file loading on android very slow

2 participants