Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize wasm bindgen asset with manganis #3531

Merged
merged 20 commits into from
Jan 21, 2025

Conversation

ealmloff
Copy link
Member

@ealmloff ealmloff commented Jan 9, 2025

This PR uses the manganis bundling system to hash and optimize the assets wasm bindgen generates. It also expands cli-opt to support bundling multiple js files together which is useful for the javascript files wasm bindgen outputs.

Requests for hello world app with old version of DX:
Screenshot 2025-01-09 at 1 13 12 PM

Requests for hello world app with new version of DX:
Screenshot 2025-01-09 at 1 13 29 PM

Closes #3350
Closes #3339
Closes #3277
Closes #2124

@ealmloff ealmloff marked this pull request as ready for review January 9, 2025 20:27
@ealmloff ealmloff added bug Something isn't working cli Related to the dioxus-cli program performance fullstack related to the fullstack crate labels Jan 9, 2025
@ealmloff ealmloff changed the title Optimize initial assets Optimize wasm bindgen asset with manganis Jan 9, 2025
@ealmloff
Copy link
Member Author

Marking this as a draft until we find the latest version of swc settings that are compatible with a broader set of javascript like #3539

@ealmloff ealmloff marked this pull request as draft January 13, 2025 18:53
@ealmloff ealmloff marked this pull request as ready for review January 14, 2025 16:10
@ealmloff
Copy link
Member Author

This PR also fixes a few caching issues with manganis/the CLI:

  • If you interrupt the CLI while it is optimizing a large folder and then restart it. The CLI would think the optimization was finished and use the partially finished folder
  • If you upgrade the CLI and run it on an old project, the assets would not be re-optimized. That means any new CLI releases that fix optimization issues would not be applied until the target directory is cleared

@ealmloff ealmloff requested a review from a team as a code owner January 17, 2025 14:14
@ealmloff
Copy link
Member Author

Caching the fullstack asset folder with a long reset is problematic for legacy assets which are placed in the folder without a hashed name. That change is pulled out of this PR in favor of a followup that somehow communicates which assets are cached and not

@jkelleyrtp jkelleyrtp merged commit 13dcd80 into DioxusLabs:main Jan 21, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Related to the dioxus-cli program fullstack related to the fullstack crate performance
Projects
None yet
2 participants