Skip to content

Revert: [tool] Add support for --[no-]deprecated-js-interop to the flutter tool - #193873

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
flutteractionsbot:revert-193712-1791240606
Oct 6, 2026
Merged

auto-submit[bot] merged 1 commit into
flutter:masterfrom
flutteractionsbot:revert-193712-1791240606

Conversation

@flutteractionsbot

Copy link
Copy Markdown
Contributor

Reverts: [tool] Add support for --[no-]deprecated-js-interop to the flutter tool

Initiated by: @andywolff

Reason for reverting: broke the tree

Original PR Author: @biggs0125

Reviewed By: @kevmoo

The original PR description is provided below:

Add --[no-]deprecated-js-interop flag for web compilation

Adds a --[no-]deprecated-js-interop flag to flutter build web, flutter run, flutter drive and flutter test. The tool passes it to the Dart web compilers, which recently gained this option:

With --no-deprecated-js-interop, the compilers reject imports of the deprecated JS interop libraries (dart:html, dart:js, dart:js_util, dart:svg, dart:indexed_db, dart:web_audio, dart:web_gl, and package:js through its re-export of dart:js_util). dart2js also prints the import chain that brings each library in.

Changes

Passing the flag through

  • The flag has three states. When it isn't set, nothing is passed and the SDK default applies.
  • It is passed to:
    • dart2js, in both the CFE (kernel) phase and the JS compile phase, since dart2js checks again when loading the dill;
    • DDC, through the frontend server, for flutter run -d chrome and flutter test --platform chrome.
  • It is not passed to dart2wasm.
  • The flag value is part of the JsCompilerConfig build key and of the cached kernel (--initialize-from-dill) path for DDC and web tests. Changing the flag invalidates old builds,
    and the incremental compiler never starts from a kernel file built with a different value.

dart2js error output

  • Before, a failing dart2js run threw a ProcessException. Its diagnostics were buried in a single Target dart2js failed: ProcessException: ... message.
  • Now the tool prints dart2js's stdout (where its diagnostics go) and its stderr to the tool's stderr, then exits with Failed to compile application for the Web. This applies to all dart2js failures and matches how DDC compile errors already appear.

Wasm dry run de-duplication

  • With --no-deprecated-js-interop, the default wasm dry run of flutter build web no longer prints findings for deprecated JS interop imports, because dart2js already reports them as errors. These are dry-run codes 0 (noDartHtml), 1 (noDartJs), 14 (noPackageJs) and 15 (noDartJsUtil).
  • Other findings, such as interop checks and lint violations, are still shown.
  • If no findings remain, the dry run prints nothing.
  • All findings, including the hidden ones, are still sent to analytics.

@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 removes the deprecated JS interop options and flags (--[no-]deprecated-js-interop) from the Flutter tools, including BuildInfo, BuildWebCommand, JsCompilerConfig, WasmCompilerConfig, and related compilation targets, commands, and runners. It also removes the unused encoding parameter from ProcessUtils.run and cleans up associated helper methods, configurations, and tests. I have no feedback to provide as there are no review comments.

@andywolff andywolff added autosubmit Merge PR when tree becomes green via auto submit App emergency Jump the queue; land PR in front of all others; only use for emergencies labels Oct 5, 2026
@flutter-dashboard

Copy link
Copy Markdown

Detected the emergency label.

If you add the autosubmit label, the bot will wait until all presubmits pass but ignore the tree status, allowing fixes for tree breakages while still validating that they don't break any existing presubmits.

The "Merge" button is also unlocked. To bypass presubmits as well as the tree status, press the GitHub "Add to Merge Queue".

@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Oct 5, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 5, 2026
Merged via the queue into flutter:master with commit 3611dd5 Oct 6, 2026
32 of 33 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 6, 2026
@flutteractionsbot
flutteractionsbot deleted the revert-193712-1791240606 branch October 6, 2026 00:25
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…utter tool (flutter#193873)

Reverts: [[tool] Add support for --[no-]deprecated-js-interop to the
flutter tool](flutter#193712)

Initiated by: @andywolff

Reason for reverting: broke the tree

Original PR Author: @biggs0125

Reviewed By: @kevmoo

The original PR description is provided below:

Add `--[no-]deprecated-js-interop` flag for web compilation
Adds a `--[no-]deprecated-js-interop` flag to `flutter build web`,
`flutter run`, `flutter drive` and `flutter test`. The tool passes it to
the Dart web compilers, which recently gained this option:
- 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 the
deprecated JS interop libraries (`dart:html`, `dart:js`, `dart:js_util`,
`dart:svg`, `dart:indexed_db`, `dart:web_audio`, `dart:web_gl`, and
`package:js` through its re-export of `dart:js_util`). dart2js also
prints the import chain that brings each library in.
### Changes
**Passing the flag through**
- The flag has three states. When it isn't set, nothing is passed and
the SDK default applies.
- It is passed to:
- dart2js, in both the CFE (kernel) phase and the JS compile phase,
since dart2js checks again when loading the dill;
- DDC, through the frontend server, for `flutter run -d chrome` and
`flutter test --platform chrome`.
- It is not passed to dart2wasm.
- The flag value is part of the `JsCompilerConfig` build key and of the
cached kernel (`--initialize-from-dill`) path for DDC and web tests.
Changing the flag invalidates old builds,
and the incremental compiler never starts from a kernel file built with
a different value.
**dart2js error output**
- Before, a failing dart2js run threw a `ProcessException`. Its
diagnostics were buried in a single `Target dart2js failed:
ProcessException: ...` message.
- Now the tool prints dart2js's stdout (where its diagnostics go) and
its stderr to the tool's stderr, then exits with `Failed to compile
application for the Web.` This applies to all dart2js failures and
matches how DDC compile errors already appear.
**Wasm dry run de-duplication**
- With `--no-deprecated-js-interop`, the default wasm dry run of
`flutter build web` no longer prints findings for deprecated JS interop
imports, because dart2js already reports them as errors. These are
dry-run codes 0 (`noDartHtml`), 1 (`noDartJs`), 14 (`noPackageJs`) and
15 (`noDartJsUtil`).
- Other findings, such as interop checks and lint violations, are still
shown.
- If no findings remain, the dry run prints nothing.
- All findings, including the hidden ones, are still sent to analytics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD emergency Jump the queue; land PR in front of all others; only use for emergencies tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants