Unverified Commit afeb404c authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

refactor(turbopack): Disable tree shaking by default (#73421)

### What?

Disable tree shaking by default

### Why?

x-ref: https://vercel.slack.com/archives/C03EWR7LGEN/p1733106700499869

### How?
parent d19d26ff
......@@ -1246,7 +1246,7 @@ impl NextConfig {
#[turbo_tasks::function]
pub fn tree_shaking_mode_for_foreign_code(
&self,
is_development: bool,
_is_development: bool,
) -> Vc<OptionTreeShaking> {
let tree_shaking = self
.experimental
......@@ -1257,19 +1257,13 @@ impl NextConfig {
OptionTreeShaking(match tree_shaking {
Some(false) => Some(TreeShakingMode::ReexportsOnly),
Some(true) => Some(TreeShakingMode::ModuleFragments),
None => {
if is_development {
Some(TreeShakingMode::ReexportsOnly)
} else {
Some(TreeShakingMode::ModuleFragments)
}
}
None => Some(TreeShakingMode::ReexportsOnly),
})
.cell()
}
#[turbo_tasks::function]
pub fn tree_shaking_mode_for_user_code(&self, is_development: bool) -> Vc<OptionTreeShaking> {
pub fn tree_shaking_mode_for_user_code(&self, _is_development: bool) -> Vc<OptionTreeShaking> {
let tree_shaking = self
.experimental
.turbo
......@@ -1279,13 +1273,7 @@ impl NextConfig {
OptionTreeShaking(match tree_shaking {
Some(false) => Some(TreeShakingMode::ReexportsOnly),
Some(true) => Some(TreeShakingMode::ModuleFragments),
None => {
if is_development {
Some(TreeShakingMode::ReexportsOnly)
} else {
Some(TreeShakingMode::ModuleFragments)
}
}
None => Some(TreeShakingMode::ReexportsOnly),
})
.cell()
}
......
......@@ -15604,37 +15604,37 @@
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/basic/basic.test.ts": {
"passed": [
"passed": [],
"failed": [
"actions-tree-shaking - basic should not have the unused action in the manifest"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/mixed-module-actions/mixed-module-actions-edge.test.ts": {
"passed": [
"passed": [],
"failed": [
"actions-tree-shaking - mixed-module-actions should not do tree shake for cjs module when import server actions"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/mixed-module-actions/mixed-module-actions.test.ts": {
"passed": [
"passed": [],
"failed": [
"actions-tree-shaking - mixed-module-actions should not do tree shake for cjs module when import server actions"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/reexport/reexport-edge.test.ts": {
"passed": [
"actions-tree-shaking - reexport should not have the unused action in the manifest"
],
"passed": [],
"failed": [
"actions-tree-shaking - reexport should not tree-shake namespace exports the manifest",
"actions-tree-shaking - reexport should not have the unused action in the manifest",
"actions-tree-shaking - reexport should keep all the action exports for namespace export case on client layer"
],
"pending": [],
......@@ -15642,10 +15642,10 @@
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/reexport/reexport.test.ts": {
"passed": [
"actions-tree-shaking - reexport should not have the unused action in the manifest"
],
"passed": [],
"failed": [
"actions-tree-shaking - reexport should not tree-shake namespace exports the manifest",
"actions-tree-shaking - reexport should not have the unused action in the manifest",
"actions-tree-shaking - reexport should keep all the action exports for namespace export case on client layer"
],
"pending": [],
......@@ -15653,19 +15653,19 @@
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/shared-module-actions/shared-module-actions-edge.test.ts": {
"passed": [
"passed": [],
"failed": [
"actions-tree-shaking - shared-module-actions should not have the unused action in the manifest"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/shared-module-actions/shared-module-actions.test.ts": {
"passed": [
"passed": [],
"failed": [
"actions-tree-shaking - shared-module-actions should not have the unused action in the manifest"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -15689,10 +15689,10 @@
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/client-actions-tree-shaking.test.ts": {
"passed": [
"passed": [],
"failed": [
"app-dir - client-actions-tree-shaking should not bundle unused server reference id in client bundles"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment