-
-
Notifications
You must be signed in to change notification settings - Fork 798
fix(esm_library): extract TLA shared modules to break circular dependency #13606
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
13 commits
Select commit
Hold shift + click to select a range
dfb81e3
fix(esm_library): extract TLA shared modules to break circular depend…
JSerFeng b4ce241
fix: address review feedback for TLA shared module extraction
JSerFeng 2a96284
fix: only emit TLA warning when circular dep is actually detected
JSerFeng f59c4a1
fix: remove redundant has_tla check and use is_only_initial
JSerFeng 000f631
perf: single-pass BFS with shared visited set for TLA extraction
JSerFeng f254a1e
test: enable TLA split-sync-modules tests that were previously skipped
JSerFeng 0a873c9
fix: fix clippy collapsible_if and restore skipped TLA tests
JSerFeng e8bc23d
test: enable TLA split-sync-modules tests
JSerFeng 847610c
fix: detect async chunks by TLA-sourced dynamic imports
JSerFeng fc075b5
fix: correctly handle entry modules in TLA chunk extraction
JSerFeng 1af5bfb
test: add snapshot files for TLA split-sync-modules tests
JSerFeng a4bf205
fix: per-async-chunk BFS to correctly handle multi-origin shared modules
JSerFeng 67ca083
fix: continue BFS into ancestor modules for transitive extraction
JSerFeng 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
Some comments aren't visible on the classic Files Changed page.
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
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
32 changes: 32 additions & 0 deletions
32
...spack-test/esmOutputCases/top-level-await/split-sync-modules-1/__snapshots__/esm.snap.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,32 @@ | ||
| ```mjs title=async.mjs | ||
|
|
||
| // ./async.js | ||
|
|
||
|
|
||
|
|
||
| export { value } from "./lib_js.mjs"; | ||
|
|
||
| ``` | ||
|
|
||
| ```mjs title=lib_js.mjs | ||
| // ./lib.js | ||
| const value = () => 42 | ||
| export { value }; | ||
|
|
||
| ``` | ||
|
|
||
| ```mjs title=main.mjs | ||
| import { value } from "./lib_js.mjs"; | ||
|
|
||
| // ./index.js | ||
|
|
||
|
|
||
| const {value: valueAsync} = await import("./async.mjs"); | ||
|
|
||
| it('should have correct value', () => { | ||
| expect(value).toBe(valueAsync); | ||
| expect(value()).toBe(42); | ||
| }) | ||
| export {}; | ||
|
|
||
| ``` |
1 change: 0 additions & 1 deletion
1
tests/rspack-test/esmOutputCases/top-level-await/split-sync-modules-1/test.filter.js
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
tests/rspack-test/esmOutputCases/top-level-await/split-sync-modules-1/warnings.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 @@ | ||
| module.exports = [/Top-level await with shared modules caused a circular dependency/]; |
34 changes: 34 additions & 0 deletions
34
...spack-test/esmOutputCases/top-level-await/split-sync-modules-2/__snapshots__/esm.snap.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,34 @@ | ||
| ```mjs title=async.mjs | ||
|
|
||
| // ./async.js | ||
|
|
||
|
|
||
|
|
||
| export { value } from "./lib_js.mjs"; | ||
|
|
||
| ``` | ||
|
|
||
| ```mjs title=lib_js.mjs | ||
| // ./lib.js | ||
| const value = () => 42 | ||
| export { value }; | ||
|
|
||
| ``` | ||
|
|
||
| ```mjs title=main.mjs | ||
| import { value } from "./lib_js.mjs"; | ||
|
|
||
| // ./index2.js | ||
|
|
||
|
|
||
| const {value: valueAsync} = await import("./async.mjs"); | ||
|
|
||
| it('should have correct value', () => { | ||
| expect(value).toBe(valueAsync); | ||
| expect(value()).toBe(42); | ||
| }) | ||
| // ./index.js | ||
|
|
||
| export {}; | ||
|
|
||
| ``` |
1 change: 0 additions & 1 deletion
1
tests/rspack-test/esmOutputCases/top-level-await/split-sync-modules-2/test.filter.js
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
tests/rspack-test/esmOutputCases/top-level-await/split-sync-modules-2/warnings.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 @@ | ||
| module.exports = [/Top-level await with shared modules caused a circular dependency/]; |
Oops, something went wrong.
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.