Repository navigation
Conversation
universal_io resolves to a file importing dart:io under the wasm runtime, so pub.dev marks stacked (and stacked_services through it) as not WASM compatible. It was only used for Platform.isIOS / isMacOS in buildAdaptivePageRoute, which defaultTargetPlatform covers. Refs #1105 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
LCOV of commit
|
| Metric | Coverage | Details |
|---|---|---|
| 📈 Lines | 🔴 7.6% | 279 / 3689 lines |
| 🔧 Functions | ⚪ N/A | no data found |
| 🌿 Branches | ⚪ N/A | no data found |
📁 Files Changed Coverage
| File | Lines | Functions | Branches |
|---|---|---|---|
lib/src/code_generation/router_annotation/extended_navigator.dart |
⚪ – (0) | ⚪ – (0) | ⚪ – (0) |
lib/src/code_generation/router_annotation/router_utils.dart |
⚪ – (0) | ⚪ – (0) | ⚪ – (0) |
🟢 ≥ 90% · 🟡 ≥ 70% · 🔴 below 70% · ⚪ no data
Full coverage report
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.
Summary
Makes
stackedWASM compatible on pub.dev. Refs #1105.Problem
pub.dev marks
stacked3.5.0 as not WASM compatible, andstacked_servicesinherits that because it importsstacked. The reason pub.dev gives:package:stacked/stacked.dart→router_utils.dart→package:universal_io/io.dart→ ... →internet_address.dart→dart:iouniversal_iowas only used for one check,Platform.isIOS || Platform.isMacOSinbuildAdaptivePageRoute, and that check already sits behind akIsWebguard. The latestuniversal_iois itself not WASM ready, so upgrading it does not help.Change
router_utils.dart: usedefaultTargetPlatformfromflutter/foundationinstead ofPlatform.pubspec.yaml: removeuniversal_io.Behaviour is the same on every platform. A side benefit is that the check now respects
debugDefaultTargetPlatformOverridein tests.Verification
pana(the analyser pub.dev uses) on this branch:is:wasm-ready, platform support 20/20. Onmasterit is not WASM ready.flutter build web --wasmagainst this branch and ran it in a browser. Confirmed it ran the.wasmmodule with no JS fallback,buildAdaptivePageRouteworked, and the console was clean.flutter test: 93 passed.dart analyze: no issues in the changed file.🤖 Generated with Claude Code