lazy-loading-implementation: runs Change Detection Optimization's analyzers and repeats their findings

オープン
#562 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
50/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
angular, typescript

調査の方向性

Start in src/utils/angular/angular-bundle/angular-bundle-validation-patterns.ts, at validateSourceCodeOptimization (lines 189-215), which calls the three ChangeDetectionOptimizationLaw analyzers. The 'No Angular components found' message comes from src/checkers/performance-laws/change-detection-optimization.ts line 70. Done means a project with no component files shows that message once or not at all under Lazy Loading, and Lazy Loading no longer reports change-detection findings. Check the design choice in the issue's suggested direction with a maintainer before changing it.

索引モデルが issue の本文から書いたものです。

説明

bug

Version: 8.0.1 (tag v8.0.1)
Law: lazy-loading-implementation (Lazy Loading Implementation)

What happens

Lazy Loading's bundle step, AngularBundleValidationPatterns.validateSourceCodeOptimization (src/utils/angular/angular-bundle/angular-bundle-validation-patterns.ts:189-215), calls three analyzers of another law, ChangeDetectionOptimizationLaw (analyzeComponents, analyzeTrackByUsage, analyzeObservableUsage), and appends their violations to its own. When a project has no component files, more than one of them returns No Angular components found (src/checkers/performance-laws/change-detection-optimization.ts:70), so the line appears twice:

1. Lazy Loading Implementation [2 violations] (Score: 80/100)
   • No Angular components found
   • No Angular components found

Reproduction

An Angular project with angular.json and routes but no *.component.ts (for example components in files without the suffix, or a library-only workspace), with Lazy Loading Implementation enabled.

What I ruled out

The duplicate is not in the renderer: the law's result carries two identical violation strings.

Why it matters

  • The same sentence twice reads like two findings and costs 20 points.
  • A lazy-loading law reports change-detection findings (component analysis, trackBy, observable usage) that belong to Change Detection Optimization, which reports them itself. A project then sees the same finding under two laws, and fixing it moves two scores.

Suggested direction

  1. Lazy Loading judges lazy loading: routes with loadChildren / loadComponent, bundle budgets. Drop the call into Change Detection Optimization's analyzers.
  2. If something must be shared, share the reader, not another law's violation strings, and deduplicate.
  3. "No Angular components found" is a reason the law judged nothing (#427), not a violation: report it as not read / judged nothing.
主要言語
TypeScript
スター
0
フォーク
0
平均マージ
2時間 36分
マージ済み PR(30日)
168

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Rule-Of-Code/RoC のほかの issue

Rule-Of-Code/RoC の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。