Repository navigation
Use dart2wasm app.support.js expression with js-string builtin requirement - #183835
Conversation
|
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
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. |
|
hey @mkustermann are you still interested in this PR? Just a heads up that it failed on CI, it sounds like you guys were waiting for some sort of chrome update that maybe is available now. |
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).
849adea to
512fa04
Compare
Thanks for the ping, @gaaclarke ! Yes, I'd like the PR to land, 🤞 that the Chrome update will make CI pass now Rebased now. |
|
@eyebrowsoffire It seems it needs another LGTM |
|
@mdebbar Could you give another lgtm? |
For Dart String operations to be performant we require `js-string` builtins - the polyfill is not going to be ver fast. The newest versions of all major browsers support this now. This removes the polyfill for `js-string` builtins and makes the `<app>.support.js` code test for presence of `js-string` builtins. The PR in [0] changes flutter engine wasm support detection code to check for `js-string` builtins. [0] flutter/flutter#183835 Change-Id: Id20996674e2f6ce421f679747f7c2694260aedbe Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488840 Reviewed-by: Srujan Gaddam <srujzs@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
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: