feat: enforce the deferred loading constraint

Đang mở
#26 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
dart, flutter
Lĩnh vực
tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Dart
Star
7
Fork
2
Merge trung bình
2 ngày 8 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của VeryGoodOpenSource/vgv-ffca-plugin

Tất cả issue của VeryGoodOpenSource/vgv-ffca-plugin

Issue tương tự

Thêm issue về Dart

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.