Skip to content

Import dart:_js_interop_wasm in addition to dart:_wasm to convert between JSAny and WasmExternRef?#186974

Merged
auto-submit[bot] merged 3 commits into
flutter:masterfrom
simolus3:use-js-interop-wasm
Jun 17, 2026
Merged

Import dart:_js_interop_wasm in addition to dart:_wasm to convert between JSAny and WasmExternRef?#186974
auto-submit[bot] merged 3 commits into
flutter:masterfrom
simolus3:use-js-interop-wasm

Conversation

@simolus3

Copy link
Copy Markdown
Contributor

Currently, dart:_wasm exports externRefForJSAny and WasmExternRefToJSAny.toJS functions and extension getters to convert between JSAny and WasmExternRef?. Flutter relies on these exports in its skwasm implementation.

We want to refactor dart:_wasm to not export these members from anymore (dart-lang/sdk#63166). The reason is that there'll be a standalone WebAssembly target for Dart, which supports dart:_wasm but not dart:js_interop. To be able to remove these methods, we've added a dart:_js_interop_wasm library defining these helpers (dart-lang/sdk@3196571). Because we're not allowed to break dart analyze in Flutter, we need to do this migration in stages. dart:_wasm currently re-exports dart:_js_interop_wasm, only for this reason.

To be able to remove that export, Flutter needs to import dart:_js_interop_wasm directly. Once this PR is merged, we can drop the export in the Dart SDk and then remove the unnecessary_import lint (import_internal_library is an oversight, the analyzer should special-case that library just like dart:_wasm itself).

Tests

This doesn't actually change anything, dart:_wasm and dart:_js_interop_wasm export the same members (everything else would be a compilation error). I've manually ran dart analyze with an SDK built from this change I want to land afterwards to ensure Flutter builds correctly once we really remove the export.

So I think I'll need a test-exempt status here.

Closes #186973.

Pre-launch Checklist

@flutter-dashboard

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. platform-web Web applications specifically labels May 22, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the dart:_js_interop_wasm import to raw_image.dart, raw_surface.dart, and surface.dart within the skwasm_impl directory. These additions include analyzer ignores and a TODO comment referencing a Dart issue. I have no feedback to provide.

@flutter-zl flutter-zl requested a review from harryterkelsen May 27, 2026 18:18

@harryterkelsen harryterkelsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harryterkelsen harryterkelsen added autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD labels May 27, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 27, 2026
@auto-submit

auto-submit Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/186974, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.

  • Merge guidelines: A PR needs at least one approved review if the author is already part of flutter-hackers or two member reviews if the author is not a member of flutter-hackers before re-applying the autosubmit label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@simolus3

simolus3 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Could I get a second reviewer for this please? 🙏

@kevmoo kevmoo added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 9, 2026
@auto-submit

auto-submit Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/186974, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR.

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 9, 2026
@github-actions github-actions Bot added team-web Owned by Web platform team CICD Run CI/CD and removed CICD Run CI/CD labels Jun 9, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 16, 2026
@harryterkelsen harryterkelsen added the CICD Run CI/CD label Jun 16, 2026
@simolus3

Copy link
Copy Markdown
Contributor Author

Thanks for updating this @harryterkelsen 🙏 I think this only needs an autosubmit label now?

@kevmoo kevmoo added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 17, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jun 17, 2026
Merged via the queue into flutter:master with commit 99819d5 Jun 17, 2026
204 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 17, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jun 17, 2026
flutter/flutter@3a0420c...b10d0f1

2026-06-17 mr-peipei@web.de Skip platform-specific plugin registration if no platforms enabled (flutter/flutter#186304)
2026-06-17 engine-flutter-autoroll@skia.org Roll Packages from 8286d39 to 6ce00a8 (1 revision) (flutter/flutter#188109)
2026-06-17 engine-flutter-autoroll@skia.org Roll Skia from 79f93fd5f36e to 5d19002eb73e (1 revision) (flutter/flutter#188108)
2026-06-17 simon@journeyapps.com Import `dart:_js_interop_wasm` in addition to `dart:_wasm` to convert between `JSAny` and `WasmExternRef?` (flutter/flutter#186974)
2026-06-17 engine-flutter-autoroll@skia.org Roll Dart SDK from f811ecae9ca0 to e39bde5b1bfc (2 revisions) (flutter/flutter#188107)
2026-06-17 engine-flutter-autoroll@skia.org Roll Skia from 026f6a6be2b9 to 79f93fd5f36e (1 revision) (flutter/flutter#188105)
2026-06-17 engine-flutter-autoroll@skia.org Roll Dart SDK from 462bf0a1d489 to f811ecae9ca0 (1 revision) (flutter/flutter#188099)
2026-06-17 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from VeLhhlDcod09NR4Hb... to or21OEdGtairm6nl9... (flutter/flutter#188098)
2026-06-17 engine-flutter-autoroll@skia.org Roll Skia from 2ffd155313f5 to 026f6a6be2b9 (10 revisions) (flutter/flutter#188097)
2026-06-17 engine-flutter-autoroll@skia.org Roll Dart SDK from 824b4b48b6d4 to 462bf0a1d489 (1 revision) (flutter/flutter#188093)
2026-06-17 jason-simmons@users.noreply.github.com Manual Dart roll from f6c31f4c3a63 to 824b4b48b6d4 (flutter/flutter#188023)
2026-06-17 awolff@google.com Add a platform view test to android_hardware_smoke_test (flutter/flutter#188069)
2026-06-17 44747303+theprantadutta@users.noreply.github.com [flutter_tools] Format empty app template with latest dart format (flutter/flutter#187443)
2026-06-16 49699333+dependabot[bot]@users.noreply.github.com Bump the all-github-actions group across 1 directory with 3 updates (flutter/flutter#188086)
2026-06-16 engine-flutter-autoroll@skia.org Roll Skia from d7196b0b4939 to 2ffd155313f5 (9 revisions) (flutter/flutter#188081)
2026-06-16 43089218+chika3742@users.noreply.github.com Prevent downgrading `project.pbxproj` when greater version number (flutter/flutter#186250)
2026-06-16 magder@google.com Only allow dependabot to autoupdate GitHub-owned actions (flutter/flutter#187936)
2026-06-16 matt.boetger@gmail.com Fall back to source AndroidManifest.xml if AAPT fails or returns garbage (flutter/flutter#187197)
2026-06-16 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#187769)
2026-06-16 jason-simmons@users.noreply.github.com [Impeller] Move queue submission into a callback that is invoked by FenceWaiterVK::AddFence only if it can accept the fence (flutter/flutter#187761)
2026-06-16 jhy03261997@gmail.com Reland [a11y] Map some framework semantics roles to android classes.  (flutter/flutter#188037)
2026-06-16 1961493+harryterkelsen@users.noreply.github.com refactor(web): Unify Image on Skwasm and CanvasKit (flutter/flutter#187873)
2026-06-16 30870216+gaaclarke@users.noreply.github.com Adds arm64 variant of impeller devicelab tests for windows. (flutter/flutter#188053)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@simolus3 simolus3 deleted the use-js-interop-wasm branch June 18, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid using WasmExternRefToJSAny and externRefForJSAny from dart:_wasm

3 participants