feat: enforce the deferred loading constraint

未关闭
#26 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
dart, flutter
领域
tooling

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

feature

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's lib/.
  • 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.

主要语言
Dart
星标
7
派生
2
平均合并
2 天 8 小时
30 天内合并 PR
9

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

VeryGoodOpenSource/vgv-ffca-plugin 的其他 Issue

查看 VeryGoodOpenSource/vgv-ffca-plugin 的全部 Issue

相似的 Issue

更多 Dart Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。