feat: enforce the deferred loading constraint
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start with the Deferred loading and Enforcing it sections of project_structure.md, then look at how the plugin already reads each app's lib/ imports and pubspec dependencies. The work is two checks: a package-level reachability check over the pubspec graph, and a library-level check over the barrel import graph, both excluding deferred edges. Done means fixtures for one correctly deferred feature and one eagerly imported feature, tests that pass for the first and fail with the eager path named in the error for the second.
Written by the indexing model from the issue text.
Description
Description
A package an app loads deferred must not also be reachable from the app through a non-deferred import path. If it is, deferring it achieves nothing, and the reference points out that this failure is silent: nothing breaks and no analyzer warning fires (Deferred loading in project_structure.md).
The reference already describes how to enforce it, under Enforcing it: mark the deferred edges in the app's import graph, compute the set of packages reachable without crossing one, and check that no deferred target is in that set.
Requirements
- Find
import ... deferred as ...directives in each app'slib/. - Package-level check: no deferred target is reachable from the app through the pubspec graph without crossing a deferred edge.
- Library-level check at subfeature-barrel granularity, using the library import graph. The reference notes the package-level check only catches the coarse case.
- Error output names the eager path that makes the deferred package reachable.
- Fixtures and tests cover a correctly deferred feature and one pulled in eagerly by another feature.
- All CI/CD checks are passing.
- There is no drop in the test coverage percentage.
Additional Context
Only relevant for web builds and Android deferred components. On an iOS/Android-only app the check has no effect but does no harm.
- Dominant language
- Dart
- Stars
- 7
- Forks
- 2
- Avg merge
- 9h 59m
- Merged PRs (30d)
- 7
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from VeryGoodOpenSource/vgv-ffca-plugin
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
chore
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 76/100
All issues in VeryGoodOpenSource/vgv-ffca-plugin
Similar issues
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
StabilityNexus/Zplit#77 · 1 comment ·
-
🚀 [firebase_core] Bump Firebase C++ SDK (14.1.0 → 14.2.0)Possibly taken @SelaseKay claimed this today. OpenNeeds Attention type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
firebase/flutterfire#18977 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
agent: is checked on a wrapper holding several checkables answers from the first one in tree orderOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AlphaWaveSystems/flutter-probe#865 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ubuntu/app-center#2306 ·
Maintainers usually reply within 1 day