-
Notifications
You must be signed in to change notification settings - Fork 81
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
[webdev] Generate auto-switching combined build for dart2js and dart2wasm output #2296
Comments
This probably has to be a part of the |
Functionally I think we'd want something like this:
wdyt @jakemac53 @kevmoo ? |
That seems pretty reasonable, and I was looking into doing this before, but I need good direction from the dart2js/wasm teams on how to implement the JS/Wasm switching. |
@jakemac53 – @eyebrowsoffire has figured this out for Flutter. We should look to share logic as much as possible! |
@bkonyi – I'd LOVE to have this. And we have the first step here: dart-lang/build#3727 CC @jakemac53 who has been helping on the review side |
Yeah, +1, this would be great to enable the ecosystem |
I have also opened dart-lang/build#3737 as a follow-up for |
We can likely close this? build_web_compilers does support it now (in the recent beta versions). |
@jakemac53 are you 100% sure this is supported? If not, how would we go about confirming it is? |
You will need to update to the latest build_web_compilers (one of the 4.1.0-beta versions) and add this to your targets:
$default:
builders:
build_web_compilers:entrypoint:
release_options:
compilers:
dart2js:
dart2wasm: Or at least, I think that is all you need :). Might be worth adding an integration test to webdev? This only changes the release mode config (which I think for You could alter the dev mode as well by using |
Sounds good! @jyameo, can you take a look at this when you have a chance? |
Fwiw there is also a way on the command line to set this configuration. So, webdev could in theory have a command line argument which it converts into the more complicated builder option command line argument which it passes to the build daemon. If you want to go that route feel free to reach out. |
I'm not exactly sure at what layer this should be in, but
webdev
seems like an most appropriate place. Happy to hear what other's think! Perhaps it does make sense directly as adart
subcommand, not sure.Building on dart-lang/sdk@0df58fc and eventually dart-lang/build#3621:
I think
webdev
should have a release mode that generates output with bothdart2js
(dart compile js
) anddart2wasm
(dart compile wasm
). Then it should generate a JS script which chooses between them based on browser capabilities.Developers can technically do this themselves, but I imagine it will be common enough that it's worth having some built-in functionality to do so.
Perhaps for a while, this can be a separate mode from the existing
--release
, but eventually I'd expect this to be the default.\cc @kevmoo @jakemac53 For general thoughts, including about where this functionality could live.
The text was updated successfully, but these errors were encountered: