-
-
Notifications
You must be signed in to change notification settings - Fork 761
fix: infinite loop in is_available_chunk when chunk groups form a cycle
#13042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
tests/rspack-test/statsOutputCases/issue-12572/__snapshots__/stats.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| asset main.js xx KiB [emitted] (name: main) | ||
| chunk (runtime: main) main.js (main) xx bytes (javascript) xx KiB (runtime) <{889}> >{889}< [entry] [rendered] | ||
| ./a.js xx bytes [dependent] [built] [code generated] | ||
| ./b.js xx bytes [dependent] [built] [code generated] | ||
| ./index.js xx bytes [built] [code generated] | ||
| ./main.js xx bytes [dependent] [built] [code generated] | ||
| Rspack x.x.x compiled successfully in X s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export function a() { | ||
| import('./b').then(({ b }) => { | ||
| b(); | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export const b = () => { | ||
| import('./main'); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import('./main'); | ||
|
|
||
| import('./a').then(({ a }) => { | ||
| a(); | ||
| }); | ||
|
|
||
| import('./b').then(({ b }) => { | ||
| b(); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import('./a').then(({ a }) => { | ||
| a(); | ||
| }); | ||
|
|
||
| import('./b').then(({ b }) => { | ||
| b(); | ||
| }); |
19 changes: 19 additions & 0 deletions
19
tests/rspack-test/statsOutputCases/issue-12572/rspack.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| var webpack = require("@rspack/core"); | ||
| /** @type {import("@rspack/core").Configuration} */ | ||
| module.exports = { | ||
| mode: "production", | ||
| entry: "./index", | ||
| plugins: [ | ||
| new webpack.optimize.LimitChunkCountPlugin({ | ||
| maxChunks: 1 | ||
| }) | ||
| ], | ||
| stats: { | ||
| assets: true, | ||
| chunkModules: true, | ||
| dependentModules: true, | ||
| chunkRelations: true, | ||
| modules: false, | ||
| chunks: true | ||
| } | ||
| }; |
96 changes: 0 additions & 96 deletions
96
tests/rspack-test/statsOutputCases/limit-chunk-count-plugin copy/__snapshots__/stats.txt
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
tests/rspack-test/statsOutputCases/limit-chunk-count-plugin copy/a.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
tests/rspack-test/statsOutputCases/limit-chunk-count-plugin copy/b.js
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
tests/rspack-test/statsOutputCases/limit-chunk-count-plugin copy/c.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
tests/rspack-test/statsOutputCases/limit-chunk-count-plugin copy/d.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
tests/rspack-test/statsOutputCases/limit-chunk-count-plugin copy/e.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
tests/rspack-test/statsOutputCases/limit-chunk-count-plugin copy/index.js
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
tests/rspack-test/statsOutputCases/limit-chunk-count-plugin copy/rspack.config.js
This file was deleted.
Oops, something went wrong.
95 changes: 72 additions & 23 deletions
95
tests/rspack-test/statsOutputCases/limit-chunk-count-plugin/__snapshots__/stats.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,96 @@ | ||
| 1 chunks: | ||
| asset bundle1.js xx KiB [emitted] (name: main) | ||
| chunk (runtime: main) bundle1.js (main) xx bytes (javascript) xx KiB (runtime) <{889}> >{889}< [entry] [rendered] | ||
| dependent modules xx bytes [dependent] 4 modules | ||
| ./index.js xx bytes [built] [code generated] | ||
| 1 chunks (Rspack x.x.x) compiled successfully in X s | ||
| ./.|sync xx bytes [dependent] [built] [code generated] | ||
| ./a.js xx bytes [dependent] [built] [code generated] | ||
| ./c.js xx bytes [dependent] [built] [code generated] | ||
| ./d.js xx bytes [dependent] [built] [code generated] | ||
| ./e.js xx bytes [dependent] [built] [code generated] | ||
| ./index.js xx bytes [built] [code generated] [1 warning] | ||
|
|
||
| WARNING in ./index.js 2:1-17 | ||
| ⚠ Critical dependency: the request of a dependency is an expression | ||
| ╭─[2:8] | ||
| 1 │ require.ensure(["./a"], function() {}); | ||
| 2 │ require(["./b"]); | ||
| · ─────── | ||
| 3 │ import(/* webpackChunkName: "c" */ "./c"); | ||
| ╰──── | ||
|
|
||
| 1 chunks (Rspack x.x.x) compiled with 1 warning in X s | ||
|
|
||
| 2 chunks: | ||
| asset bundle2.js xx KiB [emitted] (name: main) | ||
| asset 907.bundle2.js xx bytes [emitted] (name: c) | ||
| chunk (runtime: main) bundle2.js (main) xx bytes (javascript) xx KiB (runtime) >{907}< [entry] [rendered] | ||
| dependent modules xx bytes [dependent] 1 module | ||
| ./index.js xx bytes [built] [code generated] | ||
| ./.|sync xx bytes [dependent] [built] [code generated] | ||
| ./index.js xx bytes [built] [code generated] [1 warning] | ||
| chunk (runtime: main) 907.bundle2.js (c) xx bytes <{889}> <{907}> >{907}< [rendered] | ||
| dependent modules xx bytes [dependent] 2 modules | ||
| dependent modules xx bytes [dependent] | ||
| ./d.js xx bytes [dependent] [built] [code generated] | ||
| ./e.js xx bytes [dependent] [built] [code generated] | ||
| ./a.js xx bytes [built] [code generated] | ||
| ./c.js xx bytes [built] [code generated] | ||
| 2 chunks (Rspack x.x.x) compiled successfully in X s | ||
|
|
||
| WARNING in ./index.js 2:1-17 | ||
| ⚠ Critical dependency: the request of a dependency is an expression | ||
| ╭─[2:8] | ||
| 1 │ require.ensure(["./a"], function() {}); | ||
| 2 │ require(["./b"]); | ||
| · ─────── | ||
| 3 │ import(/* webpackChunkName: "c" */ "./c"); | ||
| ╰──── | ||
|
|
||
| 2 chunks (Rspack x.x.x) compiled with 1 warning in X s | ||
|
|
||
| 3 chunks: | ||
| asset bundle3.js xx KiB [emitted] (name: main) | ||
| asset 907.bundle3.js xx bytes [emitted] (name: c) | ||
| asset 719.bundle3.js xx bytes [emitted] | ||
| chunk (runtime: main) 719.bundle3.js xx bytes <{907}> [rendered] | ||
| asset 874.bundle3.js xx bytes [emitted] | ||
| chunk (runtime: main) 874.bundle3.js xx bytes <{889}> <{907}> [rendered] | ||
| ./a.js xx bytes [built] [code generated] | ||
| ./d.js xx bytes [built] [code generated] | ||
| ./e.js xx bytes [built] [code generated] | ||
| chunk (runtime: main) bundle3.js (main) xx bytes (javascript) xx KiB (runtime) >{907}< [entry] [rendered] | ||
| dependent modules xx bytes [dependent] 1 module | ||
| ./index.js xx bytes [built] [code generated] | ||
| chunk (runtime: main) 907.bundle3.js (c) xx bytes <{889}> >{719}< [rendered] | ||
| chunk (runtime: main) bundle3.js (main) xx bytes (javascript) xx KiB (runtime) >{874}< >{907}< [entry] [rendered] | ||
| ./.|sync xx bytes [dependent] [built] [code generated] | ||
| ./index.js xx bytes [built] [code generated] [1 warning] | ||
| chunk (runtime: main) 907.bundle3.js (c) xx bytes <{889}> >{874}< [rendered] | ||
| ./c.js xx bytes [built] [code generated] | ||
| 3 chunks (Rspack x.x.x) compiled successfully in X s | ||
|
|
||
| WARNING in ./index.js 2:1-17 | ||
| ⚠ Critical dependency: the request of a dependency is an expression | ||
| ╭─[2:8] | ||
| 1 │ require.ensure(["./a"], function() {}); | ||
| 2 │ require(["./b"]); | ||
| · ─────── | ||
| 3 │ import(/* webpackChunkName: "c" */ "./c"); | ||
| ╰──── | ||
|
|
||
| 3 chunks (Rspack x.x.x) compiled with 1 warning in X s | ||
|
|
||
| 4 chunks: | ||
| asset bundle4.js xx KiB [emitted] (name: main) | ||
| asset 907.bundle4.js xx bytes [emitted] (name: c) | ||
| asset 266.bundle4.js xx bytes [emitted] | ||
| asset 327.bundle4.js xx bytes [emitted] | ||
| chunk (runtime: main) 266.bundle4.js xx bytes <{907}> [rendered] | ||
| asset 719.bundle4.js xx bytes [emitted] | ||
| asset 267.bundle4.js xx bytes [emitted] | ||
| chunk (runtime: main) 267.bundle4.js xx bytes <{889}> [rendered] | ||
| ./a.js xx bytes [built] [code generated] | ||
| chunk (runtime: main) 719.bundle4.js xx bytes <{907}> [rendered] | ||
| ./d.js xx bytes [built] [code generated] | ||
| chunk (runtime: main) 327.bundle4.js xx bytes <{907}> [rendered] | ||
| ./e.js xx bytes [built] [code generated] | ||
| chunk (runtime: main) bundle4.js (main) xx bytes (javascript) xx KiB (runtime) >{907}< [entry] [rendered] | ||
| dependent modules xx bytes [dependent] 1 module | ||
| ./index.js xx bytes [built] [code generated] | ||
| chunk (runtime: main) 907.bundle4.js (c) xx bytes <{889}> >{266}< >{327}< [rendered] | ||
| chunk (runtime: main) bundle4.js (main) xx bytes (javascript) xx KiB (runtime) >{267}< >{907}< [entry] [rendered] | ||
| ./.|sync xx bytes [dependent] [built] [code generated] | ||
| ./index.js xx bytes [built] [code generated] [1 warning] | ||
| chunk (runtime: main) 907.bundle4.js (c) xx bytes <{889}> >{719}< [rendered] | ||
| ./c.js xx bytes [built] [code generated] | ||
| 4 chunks (Rspack x.x.x) compiled successfully in X s | ||
|
|
||
| WARNING in ./index.js 2:1-17 | ||
| ⚠ Critical dependency: the request of a dependency is an expression | ||
| ╭─[2:8] | ||
| 1 │ require.ensure(["./a"], function() {}); | ||
| 2 │ require(["./b"]); | ||
| · ─────── | ||
| 3 │ import(/* webpackChunkName: "c" */ "./c"); | ||
| ╰──── | ||
|
|
||
| 4 chunks (Rspack x.x.x) compiled with 1 warning in X s |
5 changes: 2 additions & 3 deletions
5
tests/rspack-test/statsOutputCases/limit-chunk-count-plugin/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // require.ensure(["./a"], function() {}); | ||
| // require(["./b"]); | ||
| require("./b"); | ||
| require.ensure(["./a"], function() {}); | ||
| require(["./b"]); | ||
| import(/* webpackChunkName: "c" */ "./c"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.