Skip to content

🔥 Removes last traces of legacy dart:html library in dio packages - #2609

Open
mkustermann wants to merge 1 commit into
cfug:mainfrom
mkustermann:remove-last-traces-of-dart-html
Open

mkustermann wants to merge 1 commit into
cfug:mainfrom
mkustermann:remove-last-traces-of-dart-html

Conversation

@mkustermann

Copy link
Copy Markdown

This removes last traces of the legacy dart:html library in the code. Especially
conditional imports using if (dart.library.html).

This raises the SDK to 3.3.0 where dart:js_interop was introduced (i.e. min SDK is from Feb 2024).
Raising the min SDK also leads to a number of other cleanups in the code base.

This also aligns the version with what's written already in the support matrix
in plugins/web_adapter/README.md (namely Dart 3.3.0 and Flutter 3.19.0)

(The dart:js_interop library was deprecated long ago and originally announced
to be deleted end of 2025, but that was postponed. We're coming closer to removing
it and would like all stable dart packages on pub.dev to be free of legacy web
library uses.)

This removes any traces of the legacy `dart:html` library, including
conditional import conditions using `if (dart.library.html)`.

This raises the SDK to 3.3.0 where `dart:js_interop` was introduced
(i.e. min SDK is from Feb 2024).

Raising the min SDK also leads to a number of other cleanups in the code
base:

* removing unnecessary breaks in switch statements
* simplifying `kIsWeb` conditions
@mkustermann
mkustermann requested a review from a team as a code owner September 9, 2026 13:36

@CaiJingLong CaiJingLong 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.

Reviewed the SDK-floor change and removal of the legacy web-selection paths. I found no blocking defect in the code reviewed; the new Dart 3.3 lower bound supports the constructs used here, and the minimum-SDK CI configuration moves to Flutter 3.19 accordingly.

Local verification at 4f8f930, with separate pinned worktrees for the current and minimum SDKs:

  • Dart 3.13.5 and Dart 3.3.0: the same 46 core VM tests pass on each, covering DioMixin, compute, options, and transformers. Core-library analysis is clean on both SDKs.
  • Dart 3.13.5: library analysis is clean for dio, dio_test, web_adapter, cookie_manager, compatibility_layer, and http2_adapter; all 12 changed Dart files pass the format check.
  • Platform-selection smoke tests compile and run under Node for JavaScript on both SDKs and Wasm on 3.13.5, confirming kIsWeb=true, BrowserHttpClientAdapter selection, and compute returning the expected result. These are not browser HTTP integration tests.
  • Four compatibility-layer tests pass. The attempted cookie suite had one timeout in the existing Empty cookies can be parsed test against www.gstatic.com; with that single external-network case excluded, the other 19 tests pass. I have not established that timeout as a regression from this change.

Remaining verification: Chromium cannot start in this container because its Unix socket creation is denied, so actual Chrome JS/Wasm tests and the Flutter matrix were not completed locally. The hosted verification, CodeQL, and security-analysis runs remain action_required; please complete the minimum/current SDK and browser matrix before merging.

Review performed with OpenAI Codex assistance.

@AlexV525

AlexV525 commented Oct 1, 2026

Copy link
Copy Markdown
Member

We'd like to move with Dart 3.0 first, as the library stands a very important position in the ecosystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants