Skip to content

perf: load resources of tauri:// protocol asynchronously#15220

Merged
Legend-Master merged 6 commits into
tauri-apps:devfrom
DeTeam:async-assets-loading
Jun 1, 2026
Merged

perf: load resources of tauri:// protocol asynchronously#15220
Legend-Master merged 6 commits into
tauri-apps:devfrom
DeTeam:async-assets-loading

Conversation

@DeTeam
Copy link
Copy Markdown
Contributor

@DeTeam DeTeam commented Apr 10, 2026

Summary

Closes #15071

This PR addresses performance issues during development of mobile apps on Tauri. As our bundle grows it seems like the bottleneck often times is not Vite (our bundler/dev server) or the webview itself but rather the assets loader in the Tauri dev server.

After adding a few larger sub-dependencies to our project (e.g. three.js) and having multiple IPC plugin calls on startup from JS world, we ended up in various deadlocks where some assets never get loaded. This comes with a very funky race condition.

In this PR we're moving away from safe_block_on to an async tokio task that uses an existing responder to deliver results.

Testing

I check our app on iOS and with this change it's much much faster. I also checked our app on mac and have not noticed any issues or regressions there.

@DeTeam DeTeam requested a review from a team as a code owner April 10, 2026 14:15
@DeTeam
Copy link
Copy Markdown
Contributor Author

DeTeam commented Apr 10, 2026

Howdy @FabianLars, could you or someone from the team have a look when you have time?

I wanted to also add some notes to .changes dir, though not exactly sure what to put there 💡

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 10, 2026

Package Changes Through 9e2f2f1

There are 5 changes which include tauri-utils with patch, tauri with patch, tauri-bundler with patch, tauri-cli with patch, @tauri-apps/cli with patch

Planned Package Versions

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

package current next
tauri-utils 2.9.2 2.9.3
tauri-bundler 2.9.2 2.9.3
tauri-runtime 2.11.2 2.11.3
tauri-runtime-wry 2.11.2 2.11.3
tauri-codegen 2.6.2 2.6.3
tauri-macros 2.6.2 2.6.3
tauri-plugin 2.6.2 2.6.3
tauri-build 2.6.2 2.6.3
tauri 2.11.2 2.11.3
@tauri-apps/cli 2.11.2 2.11.3
tauri-cli 2.11.2 2.11.3

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


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

@DeTeam
Copy link
Copy Markdown
Contributor Author

DeTeam commented Apr 15, 2026

I need advice on how to proceed with this PR (+ tauri-apps/wry#1715): it improves improves dev experience on ios (with the Wry changes - also on android) and would be great to have some feedback + get it merged soon. @Legend-Master @lucasfernog @FabianLars could any of you lend me a pair of 👀 & help get these DX speeds ups through? 😊

@DeTeam
Copy link
Copy Markdown
Contributor Author

DeTeam commented Apr 20, 2026

What's the best way to get some feedback on these changes and have this PR move forward? We would definitely benefit from having these + wry changes merged and released 🙏 @Legend-Master @lucasfernog @FabianLars

@FabianLars
Copy link
Copy Markdown
Member

we're at reduced capacity at the moment. we'll get back to you at some point. we'll have to focus on getting the next release out soon for multiple reasons. afterwards we should have be able to get back to you in a timely manner.

apologies for the delay 🙏

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.

I wonder how does this help by itself, like isn't the call still waiting on wry's handler? (tauri-apps/wry#1715 should address that, I just wonder what does this do by itself)

And I can't seem to find it load faster with this change either Sorry never mind, this should work on iOS right? Looking at tauri-apps/wry#1715 's description

@DeTeam
Copy link
Copy Markdown
Contributor Author

DeTeam commented May 28, 2026

Right, this is iOS only. If I remember correctly other platforms were not affected cause they didn't really support proper custom protocols.

With this change we were utilizing our tokio async pool without blocking the pool webview/browser would have for custom protocols.

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.

Thanks!

@Legend-Master Legend-Master changed the title fix: Async loading of resources for tauri protocol perf: load resources of tauri:// protocol asynchronously Jun 1, 2026
@Legend-Master Legend-Master merged commit e6083a1 into tauri-apps:dev Jun 1, 2026
19 checks passed
@DeTeam DeTeam deleted the async-assets-loading branch June 1, 2026 07:27
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] Slow proxy dev server (mobile)

3 participants