Repository navigation
🔥 Removes last traces of legacy dart:html library in dio packages - #2609
mkustermann wants to merge 1 commit into
Conversation
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
CaiJingLong
left a comment
There was a problem hiding this comment.
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 parsedtest 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.
|
We'd like to move with Dart 3.0 first, as the library stands a very important position in the ecosystem. |
This removes last traces of the legacy
dart:htmllibrary in the code. Especiallyconditional imports using
if (dart.library.html).This raises the SDK to 3.3.0 where
dart:js_interopwas 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_interoplibrary was deprecated long ago and originally announcedto 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.)