-
Notifications
You must be signed in to change notification settings - Fork 209
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
Compile with dart2js and dart2wasm #3737
Conversation
Any chance that this work would/could allow for custom entrypoints / preambles, e.g. for node js runtimes? See: #3652 |
I agree that we should support custom entrypoints, I'm not sure about the best way to allow that though. I've added a simple template as a builder option in aac8b6a, not sure if that's the best approach though. |
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. Package publish validation ✔️
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
aac8b6a
to
b88e2e8
Compare
build_web_compilers/README.md
Outdated
```sh | ||
webdev serve -- '--define=build_web_compilers:ddc=environment={"SOME_VAR":"changed"}' | ||
``` | ||
Note that the `compiler` option takes precedence over the new `compilers` and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably make this an error during option parsing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The readme is outdated now, I've changed it so that compilers
takes precedence.
This is a bit unfortunate, but we can't make this an error because the keys from the user's build.yaml
are merged with the defaults in build_web_compilers
- so we can't assume that something's off just because both are set.
The current approach is to use the existing compiler
option in the defaults (so that compilers
never appears in the map unless explicitly enabled) and then have compilers
take precedence.
I wonder if we should unify these into a single option, where compiler
is either a string (old) or a map (new)? That makes it harder to be in an ambiguous state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think how you have it is fine. The plural reads nicer now that multiple can be configured, and it is a cleaner break.
@simolus3 let me know when this is ready to merge from your perspective and I will push the button! |
This is ready from my side 👍 |
I couldn't wait! |
Gah! I shouldn't have merged before trying it
|
We're close!!! |
This adds support for compiling with multiple compilers, typically with dart2js and dart2wasm. The updated readme explains how this works, but this essentially boils down to:
This doesn't change the defaults yet, we continue to use ddc for dev builds and dart2js for release builds.
Closes #3730.