-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
221 additions
and
0 deletions.
There are no files selected for viewing
221 changes: 221 additions & 0 deletions
221
crates/turbopack-ecmascript/tests/tree-shaker/analyzer/tla-1/output.md
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,221 @@ | ||
# Items | ||
|
||
Count: 6 | ||
|
||
## Item 1: Stmt 0, `Normal` | ||
|
||
```js | ||
await Promise.resolve(); | ||
|
||
``` | ||
|
||
- Side effects | ||
- Reads: `Promise` | ||
|
||
## Item 2: Stmt 1, `VarDeclarator(0)` | ||
|
||
```js | ||
export const effects = []; | ||
|
||
``` | ||
|
||
- Declares: `effects` | ||
- Write: `effects` | ||
|
||
## Item 3: Stmt 2, `Normal` | ||
|
||
```js | ||
export function effect(name) { | ||
effects.push(name); | ||
} | ||
|
||
``` | ||
|
||
- Hoisted | ||
- Declares: `effect` | ||
- Reads (eventual): `effects` | ||
- Write: `effect` | ||
|
||
# Phase 1 | ||
```mermaid | ||
graph TD | ||
Item1; | ||
Item2; | ||
Item3; | ||
Item4; | ||
Item4["ModuleEvaluation"]; | ||
Item5; | ||
Item5["export effects"]; | ||
Item6; | ||
Item6["export effect"]; | ||
``` | ||
# Phase 2 | ||
```mermaid | ||
graph TD | ||
Item1; | ||
Item2; | ||
Item3; | ||
Item4; | ||
Item4["ModuleEvaluation"]; | ||
Item5; | ||
Item5["export effects"]; | ||
Item6; | ||
Item6["export effect"]; | ||
``` | ||
# Phase 3 | ||
```mermaid | ||
graph TD | ||
Item1; | ||
Item2; | ||
Item3; | ||
Item4; | ||
Item4["ModuleEvaluation"]; | ||
Item5; | ||
Item5["export effects"]; | ||
Item6; | ||
Item6["export effect"]; | ||
Item3 --> Item2; | ||
``` | ||
# Phase 4 | ||
```mermaid | ||
graph TD | ||
Item1; | ||
Item2; | ||
Item3; | ||
Item4; | ||
Item4["ModuleEvaluation"]; | ||
Item5; | ||
Item5["export effects"]; | ||
Item6; | ||
Item6["export effect"]; | ||
Item3 --> Item2; | ||
Item4 --> Item1; | ||
Item5 --> Item2; | ||
Item6 --> Item3; | ||
``` | ||
# Final | ||
```mermaid | ||
graph TD | ||
N0["Items: [ItemId(ModuleEvaluation), ItemId(0, Normal)]"]; | ||
N1["Items: [ItemId(Export(("effects", #2), "effects"))]"]; | ||
N2["Items: [ItemId(Export(("effect", #2), "effect")), ItemId(2, Normal)]"]; | ||
N3["Items: [ItemId(1, VarDeclarator(0))]"]; | ||
N1 --> N3; | ||
N2 --> N3; | ||
``` | ||
# Entrypoints | ||
|
||
``` | ||
{ | ||
ModuleEvaluation: 0, | ||
Export( | ||
"effects", | ||
): 1, | ||
Export( | ||
"effect", | ||
): 2, | ||
} | ||
``` | ||
|
||
|
||
# Modules (dev) | ||
## Part 0 | ||
```js | ||
"module evaluation"; | ||
await Promise.resolve(); | ||
|
||
``` | ||
## Part 1 | ||
```js | ||
import { effects } from "__TURBOPACK_PART__" assert { | ||
__turbopack_part__: 3 | ||
}; | ||
export { effects }; | ||
|
||
``` | ||
## Part 2 | ||
```js | ||
import { effects } from "__TURBOPACK_PART__" assert { | ||
__turbopack_part__: 3 | ||
}; | ||
export { effect }; | ||
function effect(name) { | ||
effects.push(name); | ||
} | ||
export { effect } from "__TURBOPACK_VAR__" assert { | ||
__turbopack_var__: true | ||
}; | ||
|
||
``` | ||
## Part 3 | ||
```js | ||
const effects = []; | ||
export { effects } from "__TURBOPACK_VAR__" assert { | ||
__turbopack_var__: true | ||
}; | ||
|
||
``` | ||
## Merged (module eval) | ||
```js | ||
"module evaluation"; | ||
await Promise.resolve(); | ||
|
||
``` | ||
# Entrypoints | ||
|
||
``` | ||
{ | ||
ModuleEvaluation: 0, | ||
Export( | ||
"effects", | ||
): 1, | ||
Export( | ||
"effect", | ||
): 2, | ||
} | ||
``` | ||
|
||
|
||
# Modules (prod) | ||
## Part 0 | ||
```js | ||
"module evaluation"; | ||
await Promise.resolve(); | ||
|
||
``` | ||
## Part 1 | ||
```js | ||
import { effects } from "__TURBOPACK_PART__" assert { | ||
__turbopack_part__: 3 | ||
}; | ||
export { effects }; | ||
|
||
``` | ||
## Part 2 | ||
```js | ||
import { effects } from "__TURBOPACK_PART__" assert { | ||
__turbopack_part__: 3 | ||
}; | ||
export { effect }; | ||
function effect(name) { | ||
effects.push(name); | ||
} | ||
export { effect } from "__TURBOPACK_VAR__" assert { | ||
__turbopack_var__: true | ||
}; | ||
|
||
``` | ||
## Part 3 | ||
```js | ||
const effects = []; | ||
export { effects } from "__TURBOPACK_VAR__" assert { | ||
__turbopack_var__: true | ||
}; | ||
|
||
``` | ||
## Merged (module eval) | ||
```js | ||
"module evaluation"; | ||
await Promise.resolve(); | ||
|
||
``` |