Allow index.preloadInitial to preload the full static closure of the initial bundle (number or "all")
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 58/100
- Tipo de issue
- Funcionalidade
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- angular, typescript
- Domínio
- build-system, performance
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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).
- Linguagem predominante
- TypeScript
- Estrelas
- 27k
- Forks
- 11.8k
- Merge médio
- 1d 2h
- PRs com merge (30d)
- 292
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de angular/angular-cli
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-serverTalvez já em andamento @alan-agius4 assumiu hoje. Abertaarea: @angular/build gemini-triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
angular/angular-cli#33955 ·
Mantenedores costumam responder em até 1 dia
-
@angular/build: source-map comment scanner corrupts valid JS containing a regex literalTalvez já em andamento @alan-agius4 assumiu há 1 dia. Abertaarea: @angular/build
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 76/100
angular/angular-cli#34590 ·
Mantenedores costumam responder em até 1 dia
-
build: ERR_REQUIRE_CYCLE_MODULE when loading oxc-parser in StackBlitz / WebContainerTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaarea: @angular/build
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
angular/angular-cli#34524 · 5 comentários · 2 reações ·
Mantenedores costumam responder em até 1 dia
-
Tailwind CSS v4 classes in new or moved files are not picked up by ng serve until another rebuildTalvez já em andamento @MeAkib assumiu há 10 dias. Abertaarea: @angular/build
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
angular/angular-cli#34446 ·
Mantenedores costumam responder em até 1 dia
-
Follow-up to issue: SSR: Add a way to configure externalDependencies for the server bundle onlyAbertaarea: @angular/build
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
angular/angular-cli#34262 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de angular/angular-cli
Issues semelhantes
-
area:cli bug P4
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
bug from-studio
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
esengine/DeepSeek-Reasonix#14868 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
loopbackio/loopback-next#11878 ·
Mantenedores costumam responder em até 2 dias
-
bug 🐛
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
comunica/comunica#1925 · 1 comentário ·
Mantenedores costumam responder em até 1 dia