-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Tree Shaking shared state and side effects #8370
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Ignored Deployments
|
## Item 2: Stmt 1, `VarDeclarator(0)` | ||
|
||
```js | ||
const value = externalFunction(); | ||
|
||
``` | ||
|
||
- Declares: `value` | ||
- Reads: `externalFunction` | ||
- Write: `value` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be flagged as side effect as it calls an external function.
## Item 3: Stmt 2, `VarDeclarator(0)` | ||
|
||
```js | ||
const value2 = externalObject.propertyWithGetter; | ||
|
||
``` | ||
|
||
- Declares: `value2` | ||
- Reads: `externalObject` | ||
- Write: `value2` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be flagged as side effect as it accesses a property on an object which might have an getter.
|
||
``` | ||
|
||
- Side effects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct
🟢 Turbopack Benchmark CI successful 🟢Thanks |
## Item 5: Stmt 4, `VarDeclarator(0)` | ||
|
||
```js | ||
const value3 = externalFunction(); | ||
|
||
``` | ||
|
||
- Declares: `value3` | ||
- Reads: `externalFunction` | ||
- Write: `value3` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be flagged as side effect as the function call was annotated with PURE.
...bopack-tests/tests/execution/turbopack/tree-shaking/split-chunks-shared-state/input/index.js
Show resolved
Hide resolved
✅ This change can build |
|
crates/turbopack-ecmascript/tests/tree-shaker/analyzer/write-order/output.md
Show resolved
Hide resolved
crates/turbopack-ecmascript/tests/tree-shaker/analyzer/write-order/output.md
Show resolved
Hide resolved
crates/turbopack-ecmascript/tests/tree-shaker/analyzer/write-order/output.md
Outdated
Show resolved
Hide resolved
crates/turbopack-ecmascript/tests/tree-shaker/analyzer/write-order/output.md
Outdated
Show resolved
Hide resolved
crates/turbopack-ecmascript/tests/tree-shaker/analyzer/write-order/output.md
Show resolved
Hide resolved
crates/turbopack-ecmascript/tests/tree-shaker/analyzer/complex/output.md
Outdated
Show resolved
Hide resolved
crates/turbopack-ecmascript/tests/tree-shaker/analyzer/node-globals/output.md
Show resolved
Hide resolved
@@ -217,14 +217,17 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$crates$2f$turbopack$2d$tests | |||
"[project]/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/index.js [test] (ecmascript) <module evaluation>": (({ r: __turbopack_require__, f: __turbopack_module_context__, i: __turbopack_import__, s: __turbopack_esm__, v: __turbopack_export_value__, n: __turbopack_export_namespace__, c: __turbopack_cache__, M: __turbopack_modules__, l: __turbopack_load__, j: __turbopack_dynamic__, P: __turbopack_resolve_absolute_path__, U: __turbopack_relative_url__, R: __turbopack_resolve_module_id_path__, g: global, __dirname }) => (() => { | |||
"use strict"; | |||
|
|||
__turbopack_esm__({}); | |||
__turbopack_esm__({ | |||
"lib": ()=>__TURBOPACK__imported__module__$5b$project$5d2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$namespace$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$facade$3e$__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does seem unneeded, but can be follow up fix
Approved |
### What? This is a fix for a bundle potentially referring to two different external modules (e.g. `react` because it gets invalided from the require cache) See vercel/turborepo#7988 ### Turbopack Updates * vercel/turborepo#8376 <!-- Tim Neutkens - Rename ChunkLoading::None to ChunkLoading::Edge --> * vercel/turborepo#8371 <!-- Donny/강동윤 - test: Add an execution test for `paren_remover` --> * vercel/turborepo#8370 <!-- Tobias Koppers - Tree Shaking shared state and side effects --> * vercel/turborepo#7988 <!-- hrmny - feat(turbopack-ecmascript): cache external modules with wrapper --> Closes PACK-2622
### Description adds more test cases ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> --------- Co-authored-by: 강동윤 (Donny) <kdy1997.dev@gmail.com>
### Description adds more test cases ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> --------- Co-authored-by: 강동윤 (Donny) <kdy1997.dev@gmail.com>
### Description adds more test cases ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> --------- Co-authored-by: 강동윤 (Donny) <kdy1997.dev@gmail.com>
### Description adds more test cases ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> --------- Co-authored-by: 강동윤 (Donny) <kdy1997.dev@gmail.com>
This is a fix for a bundle potentially referring to two different external modules (e.g. `react` because it gets invalided from the require cache) See vercel/turborepo#7988 * vercel/turborepo#8376 <!-- Tim Neutkens - Rename ChunkLoading::None to ChunkLoading::Edge --> * vercel/turborepo#8371 <!-- Donny/강동윤 - test: Add an execution test for `paren_remover` --> * vercel/turborepo#8370 <!-- Tobias Koppers - Tree Shaking shared state and side effects --> * vercel/turborepo#7988 <!-- hrmny - feat(turbopack-ecmascript): cache external modules with wrapper --> Closes PACK-2622
Description
adds more test cases
Testing Instructions