Commit 99819d5
Import
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](https://dart-review.googlesource.com/c/sdk/+/505960) 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
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>
Co-authored-by: Harry Terkelsen <1961493+harryterkelsen@users.noreply.github.com>dart:_js_interop_wasm in addition to dart:_wasm to convert between JSAny and WasmExternRef? (#186974)1 parent 0af497b commit 99819d5
3 files changed
Lines changed: 9 additions & 0 deletions
File tree
- engine/src/flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl
- raw
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
0 commit comments