Skip to content

Conversation

@simolus3
Copy link
Contributor

This configures build_web_compilers to use ddc on dev builds (dash_site serve) while compiling with both dart2js and dart2wasm on release modes (dash_site build, or the added --release flag to serve to experiment with this more easily).

Using jaspr CLI options to switch to dart2wasm would only compile sources with dart2wasm, this uses both compilers and a feature detection snippet emitted by dart2wasm to determine which variant is used. That seems to be in spirit of #6854.

To stop jaspr from overriding options passed to build_web_compilers, one needs to use the --no-managed-build-options flag. A downside is that the PRODUCTION define set on release modes would not be forwarded to client code any longer. The constant is only used in the robots.txt generator so this should be fine, forwarding this to client code would require more changes to jaspr_cli.

Closes #6854.

@dart-github-bot
Copy link
Collaborator

dart-github-bot commented Oct 18, 2025

Visit the preview URL for this PR (updated for commit 2510791):

https://dart-dev--pr6953-dart2wasm-xbrsxs2m.web.app

@kevmoo
Copy link
Member

kevmoo commented Oct 22, 2025

Ooooo!!!

@simolus3 simolus3 force-pushed the dart2wasm branch 2 times, most recently from a08209a to 0d0eff3 Compare October 22, 2025 21:59
@parlough
Copy link
Member

/gcbrun

Copy link
Member

@parlough parlough left a comment

Choose a reason for hiding this comment

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

I love it @simolus3, thanks so much for working on this! I also appreciate the thorough explanation and comments.

Works well in my testing :D

@parlough parlough merged commit 37066f6 into dart-lang:main Oct 23, 2025
11 checks passed
@simolus3 simolus3 deleted the dart2wasm branch October 23, 2025 11:18
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.

Compile client-side Jaspr code to Wasm too

4 participants