Allow index.preloadInitial to preload the full static closure of the initial bundle (number or "all")
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 58/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- angular, typescript
- Bereich
- build-system, performance
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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).
- Vorherrschende Sprache
- TypeScript
- Sterne
- 27k
- Forks
- 11.8k
- Ø Merge
- 1 T. 52 Min.
- Gemergte PRs (30 T.)
- 268
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus angular/angular-cli
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-serverEvtl. vergeben @alan-agius4 hat das vor 3 Tagen übernommen. Offenarea: @angular/build gemini-triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
angular/angular-cli#33955 ·
Maintainer antworten meist innerhalb von 1 Tag
-
pnpm add and pnpm install fail after ng new on pnpm 11+ (ERR_PNPM_IGNORED_BUILDS)Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenarea: @angular/cli
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
angular/angular-cli#34622 ·
Maintainer antworten meist innerhalb von 1 Tag
-
@angular/build: source-map comment scanner corrupts valid JS containing a regex literalEvtl. vergeben @alan-agius4 hat das vor 4 Tagen übernommen. Offenarea: @angular/build
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 76/100
angular/angular-cli#34590 ·
Maintainer antworten meist innerhalb von 1 Tag
-
build: ERR_REQUIRE_CYCLE_MODULE when loading oxc-parser in StackBlitz / WebContainerEvtl. vergeben @JeanMeche hat das heute übernommen. Offenarea: @angular/build
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
angular/angular-cli#34524 · 5 Kommentare · 2 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
Tailwind CSS v4 classes in new or moved files are not picked up by ng serve until another rebuildEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offenarea: @angular/build
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
angular/angular-cli#34446 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in angular/angular-cli
Ähnliche Issues
-
Remove unused dependenciesEvtl. vergeben @alastair-smith hat das heute übernommen. Offenchore other
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
alastair-smith/card-games#384 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
code-yeongyu/senpi#5571 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
nexu-io/open-design#9262 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
friction
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
kentcdodds/kody#4753 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 62/100
lingdojo/kana-dojo#33508 · 1 Kommentar · 5 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag