Use dart2wasm app.support.js expression with js-string builtin requirement#183835
Use dart2wasm app.support.js expression with js-string builtin requirement#183835mkustermann wants to merge 2 commits into
js-string builtin requirement#183835Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
There was a problem hiding this comment.
Code Review
This pull request updates the WebAssembly compatibility check by replacing the supportsWasmGC function with a more comprehensive supportsDart2Wasm function. This new function checks for both WasmGC and js-string builtin support, which is a requirement for modern dart2wasm output. The changes are consistently applied across the JavaScript logic, its corresponding TypeScript definitions, and the loader.
mdebbar
left a comment
There was a problem hiding this comment.
LGTM with some questions and suggestions for leaving breadcrumbs.
I'll defer to @eyebrowsoffire to give the final approval here.
|
I believe the |
2ecab18 to
ff74902
Compare
👍 Done |
|
@eyebrowsoffire Could you have a look if you have some time? |
ff74902 to
bbfba85
Compare
This changes flutter web's detection of wasm compatibility to be the expression emitted by dart2wasm. The expression was generated by passing `--require-js-string-builtin` to the dart2wasm compiler. Newer versions of browsers all support the `js-string` builtins nowadays. Apps running on browsers without `js-string` builtin support will not run in a performant way, so we'd not want to run the wasm version on them anyway. This is a preparation for dart2wasm to require the `js-string` builtin by default (i.e. we'll remove the `--require-js-string-builtin` flag and also remove the polyfill for `js-string` builtins).
bbfba85 to
849adea
Compare
mdebbar
left a comment
There was a problem hiding this comment.
@mkustermann is this still something we want to land?
Absolutely. Though there's some failures from flutter CI bots I'd need to dig into (in case someone from flutter knows already what's wrong, please let me know!). Before doing so, I decided to first add proper Safari tests on Dart CI first (which is still in-progress, as things always turn out to be more complicated then they should be). So far we have been only testing on the JS commandline version of Safari and only the newest version of it (i.e. bleeding edge JavaScriptCore JS shell). |
|
Would you add a link to the top (original) PR comment linking to the pending Dart CL? Just so we keep our relationships straight. 🙏 |
Done |
|
I believe this is blocked by https://github.com/flutter/flutter/pull/182861 – we need latest Chrome in our framework tests! |
|
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
This changes flutter web's detection of wasm compatibility to be the expression emitted by dart2wasm.
The expression was generated by passing
--require-js-string-builtinto the dart2wasm compiler. Newer versions of browsers all support thejs-stringbuiltins nowadays. Apps running on browsers withoutjs-stringbuiltin support will not run in a performant way, so we'd not want to run the wasm version on them anyway.This is a preparation for dart2wasm to require the
js-stringbuiltin by default (i.e. we'll remove the--require-js-string-builtinflag and also remove the polyfill forjs-stringbuiltins). See [0][0] https://dart-review.googlesource.com/c/sdk/+/488840
For reference of Safari testing on Dart: