-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(turbopack): Consider cycles while spliting modules (#4595)
### Description This is optimization for modules with cyclic dependencies between AST nodes. - Fixes WEB-706. ### Testing Instructions Look at `output.mdx` using GitHub diff view, and you can see it rendered by selecting `Open file` from the context menu. --------- Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
- Loading branch information
Showing
5 changed files
with
792 additions
and
87 deletions.
There are no files selected for viewing
This file contains 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
6 changes: 6 additions & 0 deletions
6
crates/turbopack-ecmascript/tests/tree-shaker/analyzer/3/config.json
This file contains 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,6 @@ | ||
{ | ||
"exports":[ | ||
["c1_3"], | ||
["c1_3", "c2_2"] | ||
] | ||
} |
38 changes: 38 additions & 0 deletions
38
crates/turbopack-ecmascript/tests/tree-shaker/analyzer/3/input.js
This file contains 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,38 @@ | ||
|
||
|
||
function d1() { } | ||
|
||
|
||
function d2() { } | ||
|
||
function d3() { } | ||
|
||
|
||
|
||
|
||
export function c1_1() { | ||
return c1_2() | ||
} | ||
|
||
function c1_2() { | ||
return c1_3(d1) | ||
} | ||
export function c1_3() { | ||
return c1_1(d2) | ||
} | ||
|
||
|
||
function c2_1() { | ||
return c2_2(d3) | ||
} | ||
|
||
export function c2_2() { | ||
return c2_3() | ||
} | ||
function c2_3() { | ||
return c2_1() | ||
} | ||
|
||
|
||
c1_3() | ||
c2_2() |
Oops, something went wrong.