-
Notifications
You must be signed in to change notification settings - Fork 43
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
nnbd support #92
Comments
Part of the work has been done in #90 |
What's the current status of this? Is there a way to use this with a dart 2.12 package? |
Unfortunately that does not seem to be the case, I manage to use with dart 2.12 only by forcing the usage of non-nnbd packages (for example dart2js_args:
# Temp nnbd
- --no-sound-null-safety which means using packages that are not maintained anymore. I still believe that this is a viable server side solution (and currently the only way to use dart in firebase functions and triggers). |
In the current state, I tried aligning it with the current stable Given how quickly The story is slightly more complicated for DDC because |
@lexaknyazev Thanks for the info, I was indeed able to compile nnbd packages using your trick. I personally don't really care about ddc as I enforce the usage of dart2js and just build for running (at the end it has to run in firebase functions so I'm not up to here yet). I'm not sure though whether that will remain a long term solution (the dart team does not seem to have the bandwith/willingness to support node). My targets:
$default:
sources:
- "$package$"
- "node/**"
- "lib/**"
builders:
build_web_compilers|entrypoint:
generate_for:
- node/**
options:
# enforce dart2js compiler
compiler: dart2js And I can build using the following command:
I also have a small script that insert node preamble min js in the generated js file after building. |
|
@alextekartik, if this solution is still working for you, is there any way you can include the script you created with details on how you run it? |
@SupposedlySam I have an helper package that does the build and provides some common method for building here (build + adding preamble): https://github.com/tekartik/build_node.dart/tree/main/packages/build_node and a raw node example that uses this builder here: https://github.com/tekartik/build_node.dart/tree/main/packages/example/simple_example |
Thank you @alextekartik! It looks like the |
After updating my
|
@SupposedlySam Are you using
should help you find what is wrong |
@SupposedlySam I updated this flag to be false and it seems to have worked (after a few more tweaks) https://github.com/dart-lang/build/blob/3620bd127b74c305a53989595175b6e6f83ea9e0/build_web_compilers/lib/src/dart2js_bootstrap.dart#L54 |
Is there a plan to have support for nnbd for both the compilers and packages? Thanks!
The text was updated successfully, but these errors were encountered: