Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Allow index.preloadInitial to preload the full static closure of the initial bundle (number or "all")

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
angular, typescript

調査の方向性

Start by reading the implementation and tests for the existing index.preloadInitial boolean option, along with the CLI configuration schema and generated index.html behavior. Trace how the current shallow limit of 10 is applied, then check the option's documentation and tests. Done means numeric values and "all" are accepted, while true keeps its current behavior and generated preload hints match the requested static closure.

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

説明

area: @angular/build
Command

build

Description

#27581 limited modulepreload hints to a shallow set of 10 initial chunks, as a safe default for all applications (#27490). For an application with a deep initial import graph that default costs one network round trip per depth level: the browser only discovers the chunks at depth N after the chunks at depth N-1 have arrived and been parsed.

Our main has a static closure of 45 chunks across six depth levels. We post-process index.html after ng build to preload all of them. Measured in production RUM over three weeks (roughly a million initial loads per week), weekdays before versus after:

Segment LCP p75 before LCP p75 after
all initial loads 2.00 s 1.84 s
effective connection type 4g, desktop 2.07 s 1.91 s
effective connection type 3g, desktop 7.0 s 5.3 s
effective connection type 2g, desktop 22.8 s 14.7 s

The slowest connections gained the most, which is the opposite of what the HTTP Archive correlation cited in #27490 would predict. That correlation covers preloads of any resource. Chunks in the entry point's static closure are all required before the application can execute at all, so preloading them does not compete with anything more critical than the stylesheet.

Describe the solution you'd like

Let index.preloadInitial accept a number or "all" in addition to the current boolean, keeping true as today's shallow-10 behaviour. That would let us delete a post-build script that has to track the CLI's index.html output, and which broke on the integrity attributes added in 22.x.

Describe alternatives you've considered

Post-processing index.html (what we do now); setting preloadInitial: false and writing every hint ourselves (same fragility); eager-loading the landing route into the main bundle (adds 330 KB gzipped to every first load for the 70% of visits that land elsewhere).

主要言語
TypeScript
スター
27k
フォーク
11.8k
平均マージ
1日 2時間
マージ済み PR(30日)
292

環境構築

はじめの一歩

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

angular/angular-cli のほかの issue

angular/angular-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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