Conversation
The Dart SDK added a `--[no-]deprecated-js-interop` flag to its web compilers (https://dart-review.googlesource.com/c/sdk/+/555460, https://dart-review.googlesource.com/c/sdk/+/555500). With `--no-deprecated-js-interop`, the compilers reject imports of `dart:html`, `dart:js`, `dart:js_util`, `package:js` and the other deprecated JS interop libraries. This adds the flag to `webdev serve`, `webdev build` and `webdev daemon`. It matches the flag added to `flutter build web/run/drive/test`. - **New flag:** `--[no-]deprecated-js-interop`, with `--help` text. If it isn't passed, nothing is forwarded and the SDK default applies, so older SDKs keep working. - **Forwarded to build_runner** as `--define` for the four build_web_compilers builders that must agree on it: `ddc`, `ddc_modules`, `dart2js_modules` and `entrypoint`. This covers DDC, dart2js, the kernel worker and the Frontend Server (web hot reload). Changing the value invalidates cached outputs through build_runner's option digest. - **Forwarded to dwds** through `BuildSettings`, so expression evaluation uses the same setting. - **Version check.** If the flag is passed and the project's `build_web_compilers` is older than 4.9.0, webdev stops early with "could not run with --no-deprecated-js-interop for this project" instead of failing inside build_runner. - **Error output.** Compiler diagnostics, including dart2js's import tree, come from build_web_compilers and are printed as `[SEVERE]` build logs. No change to webdev's logging. - README help output is updated. Depends on DWDS PR: dart-lang#2875
biggs0125
force-pushed
the
deprecated-js-interop-flag
branch
from
October 3, 2026 03:33
f00b3fd to
9f32747
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Dart SDK added a
--[no-]deprecated-js-interopflag to its web compilers (https://dart-review.googlesource.com/c/sdk/+/555460, https://dart-review.googlesource.com/c/sdk/+/555500). With--no-deprecated-js-interop, the compilers reject imports ofdart:html,dart:js,dart:js_util,package:jsand the other deprecated JS interop libraries.This adds the flag to
webdev serve,webdev buildandwebdev daemon. It matches the flag added toflutter build web/run/drive/test.--[no-]deprecated-js-interop, with--helptext. If it isn't passed, nothing is forwarded and the SDK default applies, so older SDKs keep working.--definefor the four build_web_compilers builders that must agree on it:ddc,ddc_modules,dart2js_modulesandentrypoint. This covers DDC, dart2js, the kernel worker and the Frontend Server (web hot reload). Changing the value invalidates cached outputs through build_runner's option digest.BuildSettings, so expression evaluation uses the same setting.build_web_compilersis older than 4.9.0, webdev stops early with "could not run with --no-deprecated-js-interop for this project" instead of failing inside build_runner.[SEVERE]build logs. No change to webdev's logging.Depends on DWDS PR: #2875