From 92a32c9ddad74736e22acd1073d02775d5cbe76c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Wed, 30 Aug 2023 17:11:40 +0900 Subject: [PATCH] Update `swc_core` to `v0.82.4` (vercel/turbo#5820) ### Description Update swc crates to https://github.com/swc-project/swc/commit/44de87f48168e0ffc6bcb2728acecbb40e2547f8 ### Testing Instructions Take a look at CI --- Closes WEB-1459 --- next.js counterpart: https://github.com/vercel/next.js/pull/54653 --- .../directives/server_to_client_proxy.rs | 2 +- crates/turbopack-ecmascript/src/parse.rs | 4 +- .../src/references/mod.rs | 2 +- .../src/tree_shake/graph.rs | 6 +- .../src/tree_shake/merge.rs | 2 +- .../tests/tree-shaker/analyzer/1/output.md | 72 ++++++------- .../tests/tree-shaker/analyzer/2/output.md | 72 ++++++------- .../tests/tree-shaker/analyzer/3/output.md | 38 +++---- .../tree-shaker/analyzer/complex/output.md | 100 +++++++++--------- .../tree-shaker/analyzer/simple/output.md | 8 +- .../analyzer/test-config-1/output.md | 72 ++++++------- 11 files changed, 189 insertions(+), 189 deletions(-) diff --git a/crates/turbopack-ecmascript-plugins/src/transform/directives/server_to_client_proxy.rs b/crates/turbopack-ecmascript-plugins/src/transform/directives/server_to_client_proxy.rs index b52c836e19b2a..fe6374cce5930 100644 --- a/crates/turbopack-ecmascript-plugins/src/transform/directives/server_to_client_proxy.rs +++ b/crates/turbopack-ecmascript-plugins/src/transform/directives/server_to_client_proxy.rs @@ -31,7 +31,7 @@ pub fn create_proxy_module(transition_name: &str, target_import: &str) -> Progra })], src: Box::new(target_import.into()), type_only: false, - asserts: Some(Box::new(ObjectLit { + with: Some(Box::new(ObjectLit { span: DUMMY_SP, props: vec![PropOrSpread::Prop(Box::new(Prop::KeyValue(KeyValueProp { key: PropName::Ident(Ident::new(TURBOPACK_HELPER.into(), DUMMY_SP)), diff --git a/crates/turbopack-ecmascript/src/parse.rs b/crates/turbopack-ecmascript/src/parse.rs index 3b3bacf0ab9ee..7219cc5d90e51 100644 --- a/crates/turbopack-ecmascript/src/parse.rs +++ b/crates/turbopack-ecmascript/src/parse.rs @@ -254,11 +254,11 @@ async fn parse_content( decorators: true, decorators_before_export: true, export_default_from: true, - import_assertions: true, + import_attributes: true, allow_super_outside_method: true, allow_return_outside_function: true, auto_accessors: true, - using_decl: true, + explicit_resource_management: true, }), EcmascriptModuleAssetType::Typescript | EcmascriptModuleAssetType::TypescriptWithTypes => { diff --git a/crates/turbopack-ecmascript/src/references/mod.rs b/crates/turbopack-ecmascript/src/references/mod.rs index f62e10d9ea1ce..6300e0a58bdda 100644 --- a/crates/turbopack-ecmascript/src/references/mod.rs +++ b/crates/turbopack-ecmascript/src/references/mod.rs @@ -2602,7 +2602,7 @@ pub struct AstPath(#[turbo_tasks(trace_ignore)] Vec); pub static TURBOPACK_HELPER: &str = "__turbopackHelper"; pub fn is_turbopack_helper_import(import: &ImportDecl) -> bool { - import.asserts.as_ref().map_or(false, |asserts| { + import.with.as_ref().map_or(false, |asserts| { asserts.props.iter().any(|assert| { assert .as_prop() diff --git a/crates/turbopack-ecmascript/src/tree_shake/graph.rs b/crates/turbopack-ecmascript/src/tree_shake/graph.rs index 1ae4439dd3d22..ce19749642840 100644 --- a/crates/turbopack-ecmascript/src/tree_shake/graph.rs +++ b/crates/turbopack-ecmascript/src/tree_shake/graph.rs @@ -299,7 +299,7 @@ impl DepGraph { specifiers, src: Box::new(uri_of_module.clone().into()), type_only: false, - asserts: Some(Box::new(create_turbopack_chunk_id_assert(dep))), + with: Some(Box::new(create_turbopack_chunk_id_assert(dep))), }))); } @@ -334,7 +334,7 @@ impl DepGraph { )], src: None, type_only: false, - asserts: Some(Box::new(ObjectLit { + with: Some(Box::new(ObjectLit { span: DUMMY_SP, props: vec![assertion_prop], })), @@ -787,7 +787,7 @@ impl DepGraph { })], src: None, type_only: false, - asserts: None, + with: None, })), export: Some(export.clone()), ..Default::default() diff --git a/crates/turbopack-ecmascript/src/tree_shake/merge.rs b/crates/turbopack-ecmascript/src/tree_shake/merge.rs index 4ec95d3e1038b..984dbf95f56b1 100644 --- a/crates/turbopack-ecmascript/src/tree_shake/merge.rs +++ b/crates/turbopack-ecmascript/src/tree_shake/merge.rs @@ -49,7 +49,7 @@ where // Try to prepend the content of module let part_id = import - .asserts + .with .as_deref() .and_then(find_turbopack_chunk_id_in_asserts); diff --git a/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/1/output.md b/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/1/output.md index c8ac079b1b880..e877e0722442c 100644 --- a/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/1/output.md +++ b/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/1/output.md @@ -370,22 +370,22 @@ graph TD # Modules (dev) ## Part 0 ```js -import { foobarCopy } from "entry.js" assert { +import { foobarCopy } from "entry.js" with { __turbopack_chunk__: 9 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 11 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; "module evaluation"; @@ -396,13 +396,13 @@ console.log(foobarCopy); ``` ## Part 1 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; export { foobar }; @@ -410,7 +410,7 @@ export { foobar }; ``` ## Part 2 ```js -import { foo } from "entry.js" assert { +import { foo } from "entry.js" with { __turbopack_chunk__: 6 }; export { foo }; @@ -418,16 +418,16 @@ export { foo }; ``` ## Part 3 ```js -import { internal } from "entry.js" assert { +import { internal } from "entry.js" with { __turbopack_chunk__: 11 }; -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; export { external1 }; @@ -438,10 +438,10 @@ function external1() { ``` ## Part 4 ```js -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 9 }; export { external2 }; @@ -458,7 +458,7 @@ export { foobar }; ``` ## Part 6 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; const foo = foobar; @@ -473,10 +473,10 @@ export { bar }; ``` ## Part 8 ```js -import { bar } from "entry.js" assert { +import { bar } from "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; foobar += bar; @@ -485,10 +485,10 @@ export { foobar }; ``` ## Part 9 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; let foobarCopy = foobar; @@ -497,10 +497,10 @@ export { foobarCopy }; ``` ## Part 10 ```js -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 9 }; foobar += "foo"; @@ -509,13 +509,13 @@ export { foobar }; ``` ## Part 11 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; import { upper } from "module"; @@ -551,10 +551,10 @@ console.log(foobarCopy); # Modules (prod) ## Part 0 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; "module evaluation"; @@ -566,13 +566,13 @@ export { foobarCopy }; ``` ## Part 1 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; export { foobar }; @@ -580,7 +580,7 @@ export { foobar }; ``` ## Part 2 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; export { foo }; @@ -590,13 +590,13 @@ export { foo }; ``` ## Part 3 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; export { external1 }; @@ -631,7 +631,7 @@ export { bar }; ``` ## Part 7 ```js -import { bar } from "entry.js" assert { +import { bar } from "entry.js" with { __turbopack_chunk__: 6 }; foobar += bar; diff --git a/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/2/output.md b/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/2/output.md index d32493d39413c..23c73781b67ec 100644 --- a/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/2/output.md +++ b/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/2/output.md @@ -392,22 +392,22 @@ graph TD # Modules (dev) ## Part 0 ```js -import { foobarCopy } from "entry.js" assert { +import { foobarCopy } from "entry.js" with { __turbopack_chunk__: 9 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 11 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; "module evaluation"; @@ -419,16 +419,16 @@ import "other"; ``` ## Part 1 ```js -import { internal } from "entry.js" assert { +import { internal } from "entry.js" with { __turbopack_chunk__: 11 }; -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; export { external1 }; @@ -439,13 +439,13 @@ function external1() { ``` ## Part 2 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; export { foobar }; @@ -453,7 +453,7 @@ export { foobar }; ``` ## Part 3 ```js -import { foo } from "entry.js" assert { +import { foo } from "entry.js" with { __turbopack_chunk__: 6 }; export { foo }; @@ -461,10 +461,10 @@ export { foo }; ``` ## Part 4 ```js -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 9 }; export { external2 }; @@ -481,7 +481,7 @@ export { foobar }; ``` ## Part 6 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; const foo = foobar; @@ -496,10 +496,10 @@ export { bar }; ``` ## Part 8 ```js -import { bar } from "entry.js" assert { +import { bar } from "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; foobar += bar; @@ -508,10 +508,10 @@ export { foobar }; ``` ## Part 9 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; let foobarCopy = foobar; @@ -520,10 +520,10 @@ export { foobarCopy }; ``` ## Part 10 ```js -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 9 }; foobar += "foo"; @@ -532,13 +532,13 @@ export { foobar }; ``` ## Part 11 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; import { upper } from "module"; @@ -575,10 +575,10 @@ console.log(foobarCopy); # Modules (prod) ## Part 0 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; "module evaluation"; @@ -591,13 +591,13 @@ export { foobarCopy }; ``` ## Part 1 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; export { external1 }; @@ -612,13 +612,13 @@ function internal() { ``` ## Part 2 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; export { foobar }; @@ -626,7 +626,7 @@ export { foobar }; ``` ## Part 3 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; export { foo }; @@ -656,7 +656,7 @@ export { bar }; ``` ## Part 7 ```js -import { bar } from "entry.js" assert { +import { bar } from "entry.js" with { __turbopack_chunk__: 6 }; foobar += bar; diff --git a/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/3/output.md b/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/3/output.md index 650453250f4ec..454f40e823f93 100644 --- a/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/3/output.md +++ b/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/3/output.md @@ -329,19 +329,19 @@ graph TD # Modules (dev) ## Part 0 ```js -import { c1_3 } from "entry.js" assert { +import { c1_3 } from "entry.js" with { __turbopack_chunk__: 4 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import { c2_2 } from "entry.js" assert { +import { c2_2 } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; "module evaluation"; @@ -351,7 +351,7 @@ c2_2(); ``` ## Part 1 ```js -import { c1_1 } from "entry.js" assert { +import { c1_1 } from "entry.js" with { __turbopack_chunk__: 4 }; export { c1_1 }; @@ -359,7 +359,7 @@ export { c1_1 }; ``` ## Part 2 ```js -import { c1_3 } from "entry.js" assert { +import { c1_3 } from "entry.js" with { __turbopack_chunk__: 4 }; export { c1_3 }; @@ -367,7 +367,7 @@ export { c1_3 }; ``` ## Part 3 ```js -import { c2_2 } from "entry.js" assert { +import { c2_2 } from "entry.js" with { __turbopack_chunk__: 5 }; export { c2_2 }; @@ -375,10 +375,10 @@ export { c2_2 }; ``` ## Part 4 ```js -import { d1 } from "entry.js" assert { +import { d1 } from "entry.js" with { __turbopack_chunk__: 6 }; -import { d2 } from "entry.js" assert { +import { d2 } from "entry.js" with { __turbopack_chunk__: 7 }; function c1_1() { @@ -394,7 +394,7 @@ function c1_3() { ``` ## Part 5 ```js -import { d3 } from "entry.js" assert { +import { d3 } from "entry.js" with { __turbopack_chunk__: 8 }; function c2_1() { @@ -454,10 +454,10 @@ c2_2(); # Modules (prod) ## Part 0 ```js -import { c1_3 } from "entry.js" assert { +import { c1_3 } from "entry.js" with { __turbopack_chunk__: 4 }; -import { c2_2 } from "entry.js" assert { +import { c2_2 } from "entry.js" with { __turbopack_chunk__: 5 }; "module evaluation"; @@ -467,7 +467,7 @@ c2_2(); ``` ## Part 1 ```js -import { c1_1 } from "entry.js" assert { +import { c1_1 } from "entry.js" with { __turbopack_chunk__: 4 }; export { c1_1 }; @@ -475,7 +475,7 @@ export { c1_1 }; ``` ## Part 2 ```js -import { c1_3 } from "entry.js" assert { +import { c1_3 } from "entry.js" with { __turbopack_chunk__: 4 }; export { c1_3 }; @@ -483,7 +483,7 @@ export { c1_3 }; ``` ## Part 3 ```js -import { c2_2 } from "entry.js" assert { +import { c2_2 } from "entry.js" with { __turbopack_chunk__: 5 }; export { c2_2 }; @@ -491,10 +491,10 @@ export { c2_2 }; ``` ## Part 4 ```js -import { d1 } from "entry.js" assert { +import { d1 } from "entry.js" with { __turbopack_chunk__: 6 }; -import { d2 } from "entry.js" assert { +import { d2 } from "entry.js" with { __turbopack_chunk__: 7 }; function c1_1() { @@ -510,7 +510,7 @@ function c1_3() { ``` ## Part 5 ```js -import { d3 } from "entry.js" assert { +import { d3 } from "entry.js" with { __turbopack_chunk__: 8 }; function c2_1() { diff --git a/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/complex/output.md b/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/complex/output.md index 8fa78129359f0..9edf2198ba163 100644 --- a/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/complex/output.md +++ b/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/complex/output.md @@ -402,13 +402,13 @@ graph TD # Modules (dev) ## Part 0 ```js -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 11 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 13 }; "module evaluation"; @@ -416,7 +416,7 @@ import "entry.js" assert { ``` ## Part 1 ```js -import { dogRef } from "entry.js" assert { +import { dogRef } from "entry.js" with { __turbopack_chunk__: 5 }; export { dogRef }; @@ -424,7 +424,7 @@ export { dogRef }; ``` ## Part 2 ```js -import { cat } from "entry.js" assert { +import { cat } from "entry.js" with { __turbopack_chunk__: 14 }; export { cat }; @@ -432,7 +432,7 @@ export { cat }; ``` ## Part 3 ```js -import { cat } from "entry.js" assert { +import { cat } from "entry.js" with { __turbopack_chunk__: 14 }; export { initialCat }; @@ -442,19 +442,19 @@ export { initialCat }; ``` ## Part 4 ```js -import { cat } from "entry.js" assert { +import { cat } from "entry.js" with { __turbopack_chunk__: 14 }; -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 12 }; export { getChimera }; @@ -465,22 +465,22 @@ function getChimera() { ``` ## Part 5 ```js -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 13 }; -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 12 }; -import { getDog } from "entry.js" assert { +import { getDog } from "entry.js" with { __turbopack_chunk__: 9 }; function setDog(newDog) { @@ -508,10 +508,10 @@ export { dog }; ``` ## Part 8 ```js -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; console.log(dog); @@ -519,16 +519,16 @@ console.log(dog); ``` ## Part 9 ```js -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 12 }; function getDog() { @@ -538,7 +538,7 @@ function getDog() { ``` ## Part 10 ```js -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; dog += "!"; @@ -547,16 +547,16 @@ export { dog }; ``` ## Part 11 ```js -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; console.log(dog); @@ -564,7 +564,7 @@ console.log(dog); ``` ## Part 12 ```js -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 11 }; dog += "!"; @@ -573,22 +573,22 @@ export { dog }; ``` ## Part 13 ```js -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 12 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 11 }; console.log(dog); @@ -619,16 +619,16 @@ console.log(dog); # Modules (prod) ## Part 0 ```js -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; "module evaluation"; @@ -639,16 +639,16 @@ console.log(dog); ``` ## Part 1 ```js -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; export { dogRef }; @@ -668,7 +668,7 @@ export { dogRef }; ``` ## Part 2 ```js -import { cat } from "entry.js" assert { +import { cat } from "entry.js" with { __turbopack_chunk__: 9 }; export { cat }; @@ -676,7 +676,7 @@ export { cat }; ``` ## Part 3 ```js -import { cat } from "entry.js" assert { +import { cat } from "entry.js" with { __turbopack_chunk__: 9 }; export { initialCat }; @@ -686,19 +686,19 @@ export { initialCat }; ``` ## Part 4 ```js -import { cat } from "entry.js" assert { +import { cat } from "entry.js" with { __turbopack_chunk__: 9 }; -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; export { getChimera }; diff --git a/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/simple/output.md b/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/simple/output.md index b7a3798d69090..dc57106b6b849 100644 --- a/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/simple/output.md +++ b/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/simple/output.md @@ -129,7 +129,7 @@ graph TD ``` ## Part 1 ```js -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 3 }; export { DOG }; @@ -139,7 +139,7 @@ export { DOG }; ``` ## Part 2 ```js -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 3 }; export { CHIMERA }; @@ -168,7 +168,7 @@ export { dog }; ``` ## Part 1 ```js -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 3 }; export { DOG }; @@ -178,7 +178,7 @@ export { DOG }; ``` ## Part 2 ```js -import { dog } from "entry.js" assert { +import { dog } from "entry.js" with { __turbopack_chunk__: 3 }; export { CHIMERA }; diff --git a/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/test-config-1/output.md b/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/test-config-1/output.md index d513c9fdf1d5f..79e9885554f02 100644 --- a/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/test-config-1/output.md +++ b/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/test-config-1/output.md @@ -370,22 +370,22 @@ graph TD # Modules (dev) ## Part 0 ```js -import { foobarCopy } from "entry.js" assert { +import { foobarCopy } from "entry.js" with { __turbopack_chunk__: 9 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 11 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; "module evaluation"; @@ -396,13 +396,13 @@ console.log(foobarCopy); ``` ## Part 1 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; export { foobar }; @@ -410,7 +410,7 @@ export { foobar }; ``` ## Part 2 ```js -import { foo } from "entry.js" assert { +import { foo } from "entry.js" with { __turbopack_chunk__: 6 }; export { foo }; @@ -418,16 +418,16 @@ export { foo }; ``` ## Part 3 ```js -import { internal } from "entry.js" assert { +import { internal } from "entry.js" with { __turbopack_chunk__: 11 }; -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; export { external1 }; @@ -438,10 +438,10 @@ function external1() { ``` ## Part 4 ```js -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 9 }; export { external2 }; @@ -458,7 +458,7 @@ export { foobar }; ``` ## Part 6 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; const foo = foobar; @@ -473,10 +473,10 @@ export { bar }; ``` ## Part 8 ```js -import { bar } from "entry.js" assert { +import { bar } from "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; foobar += bar; @@ -485,10 +485,10 @@ export { foobar }; ``` ## Part 9 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; let foobarCopy = foobar; @@ -497,10 +497,10 @@ export { foobarCopy }; ``` ## Part 10 ```js -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 6 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 9 }; foobar += "foo"; @@ -509,13 +509,13 @@ export { foobar }; ``` ## Part 11 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 10 }; import { upper } from "module"; @@ -551,10 +551,10 @@ console.log(foobarCopy); # Modules (prod) ## Part 0 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; "module evaluation"; @@ -566,13 +566,13 @@ export { foobarCopy }; ``` ## Part 1 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; export { foobar }; @@ -580,7 +580,7 @@ export { foobar }; ``` ## Part 2 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; export { foo }; @@ -590,13 +590,13 @@ export { foo }; ``` ## Part 3 ```js -import { foobar } from "entry.js" assert { +import { foobar } from "entry.js" with { __turbopack_chunk__: 5 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 7 }; -import "entry.js" assert { +import "entry.js" with { __turbopack_chunk__: 8 }; export { external1 }; @@ -631,7 +631,7 @@ export { bar }; ``` ## Part 7 ```js -import { bar } from "entry.js" assert { +import { bar } from "entry.js" with { __turbopack_chunk__: 6 }; foobar += bar;