Skip to content

Commit 5869543

Browse files
authored
Turbopack: enable side effects optimization by default in all test cases (#82463)
### What? enable side effects optimization by default in all but 2 test cases
1 parent 3552445 commit 5869543

File tree

19 files changed

+24
-47
lines changed

19 files changed

+24
-47
lines changed

turbopack/crates/turbopack-tests/tests/execution.rs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,25 +244,33 @@ async fn run_inner_operation(
244244
}
245245

246246
#[derive(
247-
PartialEq,
248-
Eq,
249-
Debug,
250-
Default,
251-
Serialize,
252-
Deserialize,
253-
TraceRawVcs,
254-
ValueDebugFormat,
255-
NonLocalValue,
247+
PartialEq, Eq, Debug, Serialize, Deserialize, TraceRawVcs, ValueDebugFormat, NonLocalValue,
256248
)]
257249
#[serde(rename_all = "camelCase", deny_unknown_fields)]
258250
struct TestOptions {
251+
#[serde(default = "default_tree_shaking_mode")]
259252
tree_shaking_mode: Option<TreeShakingMode>,
260253
remove_unused_exports: Option<bool>,
261254
scope_hoisting: Option<bool>,
262255
#[serde(default)]
263256
minify: bool,
264257
}
265258

259+
fn default_tree_shaking_mode() -> Option<TreeShakingMode> {
260+
Some(TreeShakingMode::ReexportsOnly)
261+
}
262+
263+
impl Default for TestOptions {
264+
fn default() -> Self {
265+
Self {
266+
tree_shaking_mode: default_tree_shaking_mode(),
267+
remove_unused_exports: None,
268+
scope_hoisting: None,
269+
minify: false,
270+
}
271+
}
272+
}
273+
266274
#[turbo_tasks::value]
267275
struct PreparedTest {
268276
path: FileSystemPath,

turbopack/crates/turbopack-tests/tests/execution/turbopack/async-modules/async-reexport-side-effects-split/options.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ warning - [analysis] /turbopack/crates/turbopack-tests/tests/execution/turbopack
66
Import trace:
77
test:
88
./turbopack/crates/turbopack-tests/tests/execution/turbopack/async-modules/export-all/input/exports.js
9-
./turbopack/crates/turbopack-tests/tests/execution/turbopack/async-modules/export-all/input/tla.js
109
./turbopack/crates/turbopack-tests/tests/execution/turbopack/async-modules/export-all/input/index.js
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"treeShakingMode": null
3+
}

turbopack/crates/turbopack-tests/tests/execution/turbopack/exports/invalid-export-parse-error/options.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

turbopack/crates/turbopack-tests/tests/execution/turbopack/exports/invalid-export/options.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

turbopack/crates/turbopack-tests/tests/execution/turbopack/resolving/require-resolve/options.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

turbopack/crates/turbopack-tests/tests/execution/turbopack/scope-hoisting/circular-import/options.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

turbopack/crates/turbopack-tests/tests/execution/turbopack/scope-hoisting/reexport-all-as/options.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

turbopack/crates/turbopack-tests/tests/execution/turbopack/side-effects-optimization/basic/options.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)