Commit 12cb825
authored
docs(buildChunkGraph): explain why blocksWithNestedBlocks gates the skip (#21025)
* docs(buildChunkGraph): explain why blocksWithNestedBlocks gates the skip
The previous `// TODO is this needed?` left the rationale ambiguous.
Skipping a block disconnects it from its chunk group, which orphans any
nested block's chunk group from this block's chunk group parent, so the
check must stay.
* test(chunks): cover the blocksWithNestedBlocks skip guard
Pins down the case where buildChunkGraph's connectChunkGroups would
otherwise skip a block whose modules are already in the entry chunk.
Without the `!blocksWithNestedBlocks.has(block)` guard, the outer
require.ensure's chunk group is left without a parent and gets cleaned
up together with the nested chunk group, so the inner sync require
fails at runtime. With the guard the test passes; removing the guard
makes the test time out waiting for the inner callback.1 parent 75f60f6 commit 12cb825
4 files changed
Lines changed: 22 additions & 1 deletion
File tree
- lib
- test/cases/chunks/nested-blocks-with-available-parent-modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1290 | 1290 | | |
1291 | 1291 | | |
1292 | 1292 | | |
1293 | | - | |
| 1293 | + | |
| 1294 | + | |
1294 | 1295 | | |
1295 | 1296 | | |
1296 | 1297 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
0 commit comments