Repository navigation
Revert: [tool] Add support for --[no-]deprecated-js-interop to the flutter tool - #193873
Conversation
…utter tool (flutter#193712)" This reverts commit 6ed8855.
There was a problem hiding this comment.
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.
|
Detected the If you add the The "Merge" button is also unlocked. To bypass presubmits as well as the tree status, press the GitHub "Add to Merge Queue". |
…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.
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-interopflag for web compilationAdds a
--[no-]deprecated-js-interopflag toflutter build web,flutter run,flutter driveandflutter 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, andpackage:jsthrough its re-export ofdart:js_util). dart2js also prints the import chain that brings each library in.Changes
Passing the flag through
flutter run -d chromeandflutter test --platform chrome.JsCompilerConfigbuild 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
ProcessException. Its diagnostics were buried in a singleTarget dart2js failed: ProcessException: ...message.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
--no-deprecated-js-interop, the default wasm dry run offlutter build webno 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).