Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
a51f3556
Unverified
Commit
a51f3556
authored
Jun 07, 2026
by
Luke Sandberg
Committed by
GitHub
Jun 07, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove turbopackMemoryLimit it is dead (#94483)
This feature has never worked, and we should just drop it
parent
0d0dbb6c
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
57 additions
and
25 deletions
+57
-25
project.rs
crates/next-napi-bindings/src/next_api/project.rs
+0
-7
turbopack_ctx.rs
crates/next-napi-bindings/src/next_api/turbopack_ctx.rs
+0
-1
commonjs-var.output.js
...xt-experimental-turbo-to-turbopack/commonjs-var.output.js
+0
-1
esm.output.js
...ures__/next-experimental-turbo-to-turbopack/esm.output.js
+0
-1
mixed-config.output.js
...xt-experimental-turbo-to-turbopack/mixed-config.output.js
+0
-1
modified-var.input.js
...ext-experimental-turbo-to-turbopack/modified-var.input.js
+1
-1
modified-var.output.js
...xt-experimental-turbo-to-turbopack/modified-var.output.js
+1
-2
property-assignment.input.js
...erimental-turbo-to-turbopack/property-assignment.input.js
+1
-0
property-assignment.output.js
...rimental-turbo-to-turbopack/property-assignment.output.js
+0
-1
typescript-as-const.output.ts
...rimental-turbo-to-turbopack/typescript-as-const.output.ts
+0
-1
typescript.output.ts
...next-experimental-turbo-to-turbopack/typescript.output.ts
+0
-1
wrapped-function.output.js
...xperimental-turbo-to-turbopack/wrapped-function.output.js
+0
-1
next-experimental-turbo-to-turbopack.ts
...odemod/transforms/next-experimental-turbo-to-turbopack.ts
+54
-4
generated-native.d.ts
packages/next/src/build/swc/generated-native.d.ts
+0
-2
config-schema.ts
packages/next/src/server/config-schema.ts
+0
-1
No files found.
crates/next-napi-bindings/src/next_api/project.rs
View file @
a51f3556
...
@@ -272,8 +272,6 @@ pub struct NapiDefineEnv {
...
@@ -272,8 +272,6 @@ pub struct NapiDefineEnv {
#[napi(object)]
#[napi(object)]
pub
struct
NapiTurboEngineOptions
{
pub
struct
NapiTurboEngineOptions
{
/// An upper bound of memory that turbopack will attempt to stay under.
pub
memory_limit
:
Option
<
f64
>
,
/// Track dependencies between tasks. If false, any change during build will error.
/// Track dependencies between tasks. If false, any change during build will error.
pub
dependency_tracking
:
Option
<
bool
>
,
pub
dependency_tracking
:
Option
<
bool
>
,
/// Whether the project is running in a CI environment.
/// Whether the project is running in a CI environment.
...
@@ -555,10 +553,6 @@ pub fn project_new(
...
@@ -555,10 +553,6 @@ pub fn project_new(
env
.spawn_future
(
env
.spawn_future
(
async
move
{
async
move
{
let
memory_limit
=
turbo_engine_options
.memory_limit
.map
(|
m
|
m
as
usize
)
.unwrap_or
(
usize
::
MAX
);
let
dependency_tracking
=
turbo_engine_options
.dependency_tracking
.unwrap_or
(
true
);
let
dependency_tracking
=
turbo_engine_options
.dependency_tracking
.unwrap_or
(
true
);
let
is_ci
=
turbo_engine_options
.is_ci
.unwrap_or
(
false
);
let
is_ci
=
turbo_engine_options
.is_ci
.unwrap_or
(
false
);
let
is_short_session
=
turbo_engine_options
.is_short_session
.unwrap_or
(
false
);
let
is_short_session
=
turbo_engine_options
.is_short_session
.unwrap_or
(
false
);
...
@@ -568,7 +562,6 @@ pub fn project_new(
...
@@ -568,7 +562,6 @@ pub fn project_new(
PathBuf
::
from
(
&
options
.dist_dir
),
PathBuf
::
from
(
&
options
.dist_dir
),
&
options
.next_version
,
&
options
.next_version
,
options
.is_persistent_caching_enabled
,
options
.is_persistent_caching_enabled
,
memory_limit
,
dependency_tracking
,
dependency_tracking
,
is_ci
,
is_ci
,
is_short_session
,
is_short_session
,
...
...
crates/next-napi-bindings/src/next_api/turbopack_ctx.rs
View file @
a51f3556
...
@@ -248,7 +248,6 @@ pub fn create_turbo_tasks(
...
@@ -248,7 +248,6 @@ pub fn create_turbo_tasks(
output_path
:
PathBuf
,
output_path
:
PathBuf
,
next_version
:
&
str
,
next_version
:
&
str
,
persistent_caching
:
bool
,
persistent_caching
:
bool
,
_memory_limit
:
usize
,
dependency_tracking
:
bool
,
dependency_tracking
:
bool
,
is_ci
:
bool
,
is_ci
:
bool
,
is_short_session
:
bool
,
is_short_session
:
bool
,
...
...
packages/next-codemod/transforms/__testfixtures__/next-experimental-turbo-to-turbopack/commonjs-var.output.js
View file @
a51f3556
...
@@ -3,7 +3,6 @@ const config = {
...
@@ -3,7 +3,6 @@ const config = {
experimental
:
{
experimental
:
{
serverActions
:
true
,
serverActions
:
true
,
typedRoutes
:
false
,
typedRoutes
:
false
,
turbopackMemoryLimit
:
4096
,
turbopackMinify
:
true
,
turbopackMinify
:
true
,
turbopackTreeShaking
:
false
,
turbopackTreeShaking
:
false
,
turbopackSourceMaps
:
true
turbopackSourceMaps
:
true
...
...
packages/next-codemod/transforms/__testfixtures__/next-experimental-turbo-to-turbopack/esm.output.js
View file @
a51f3556
...
@@ -2,7 +2,6 @@ export default {
...
@@ -2,7 +2,6 @@ export default {
experimental
:
{
experimental
:
{
serverActions
:
true
,
serverActions
:
true
,
typedRoutes
:
false
,
typedRoutes
:
false
,
turbopackMemoryLimit
:
4096
,
turbopackMinify
:
true
,
turbopackMinify
:
true
,
turbopackTreeShaking
:
false
,
turbopackTreeShaking
:
false
,
turbopackSourceMaps
:
true
turbopackSourceMaps
:
true
...
...
packages/next-codemod/transforms/__testfixtures__/next-experimental-turbo-to-turbopack/mixed-config.output.js
View file @
a51f3556
...
@@ -2,7 +2,6 @@ module.exports = {
...
@@ -2,7 +2,6 @@ module.exports = {
experimental
:
{
experimental
:
{
serverActions
:
true
,
serverActions
:
true
,
typedRoutes
:
false
,
typedRoutes
:
false
,
turbopackMemoryLimit
:
4096
,
turbopackMinify
:
true
,
turbopackMinify
:
true
,
turbopackTreeShaking
:
false
,
turbopackTreeShaking
:
false
,
turbopackSourceMaps
:
true
turbopackSourceMaps
:
true
...
...
packages/next-codemod/transforms/__testfixtures__/next-experimental-turbo-to-turbopack/modified-var.input.js
View file @
a51f3556
...
@@ -5,8 +5,8 @@ const config = {
...
@@ -5,8 +5,8 @@ const config = {
resolveAlias
:
{
resolveAlias
:
{
underscore
:
'lodash'
,
underscore
:
'lodash'
,
},
},
memoryLimit
:
4096
,
},
},
turbopackMemoryLimit
:
4096
,
typedRoutes
:
true
,
typedRoutes
:
true
,
},
},
};
};
...
...
packages/next-codemod/transforms/__testfixtures__/next-experimental-turbo-to-turbopack/modified-var.output.js
View file @
a51f3556
// CommonJS configuration with variable declaration and modification
// CommonJS configuration with variable declaration and modification
const
config
=
{
const
config
=
{
experimental
:
{
experimental
:
{
typedRoutes
:
true
,
typedRoutes
:
true
turbopackMemoryLimit
:
4096
,
},
},
turbopack
:
{
turbopack
:
{
...
...
packages/next-codemod/transforms/__testfixtures__/next-experimental-turbo-to-turbopack/property-assignment.input.js
View file @
a51f3556
...
@@ -14,6 +14,7 @@ const config = {
...
@@ -14,6 +14,7 @@ const config = {
config
.
experimental
.
turbo
.
resolveAlias
.
foo
=
'bar'
;
config
.
experimental
.
turbo
.
resolveAlias
.
foo
=
'bar'
;
config
.
experimental
.
turbo
.
minify
=
true
;
config
.
experimental
.
turbo
.
minify
=
true
;
config
.
experimental
.
turbo
.
memoryLimit
=
4096
;
config
.
experimental
.
turbo
.
memoryLimit
=
4096
;
config
.
experimental
.
turbopackMemoryLimit
=
4096
;
// Add regular property
// Add regular property
config
.
images
=
{
config
.
images
=
{
...
...
packages/next-codemod/transforms/__testfixtures__/next-experimental-turbo-to-turbopack/property-assignment.output.js
View file @
a51f3556
...
@@ -14,7 +14,6 @@ const config = {
...
@@ -14,7 +14,6 @@ const config = {
// Add properties to the turbo object
// Add properties to the turbo object
config
.
turbopack
.
resolveAlias
.
foo
=
'bar'
;
config
.
turbopack
.
resolveAlias
.
foo
=
'bar'
;
config
.
experimental
.
turbopackMinify
=
true
;
config
.
experimental
.
turbopackMinify
=
true
;
config
.
experimental
.
turbopackMemoryLimit
=
4096
;
// Add regular property
// Add regular property
config
.
images
=
{
config
.
images
=
{
...
...
packages/next-codemod/transforms/__testfixtures__/next-experimental-turbo-to-turbopack/typescript-as-const.output.ts
View file @
a51f3556
...
@@ -3,7 +3,6 @@ import type { NextConfig } from 'next';
...
@@ -3,7 +3,6 @@ import type { NextConfig } from 'next';
const
config
=
{
const
config
=
{
experimental
:
{
experimental
:
{
typedRoutes
:
true
,
typedRoutes
:
true
,
turbopackMemoryLimit
:
4096
,
turbopackMinify
:
true
,
turbopackMinify
:
true
,
turbopackTreeShaking
:
false
,
turbopackTreeShaking
:
false
,
turbopackSourceMaps
:
true
turbopackSourceMaps
:
true
...
...
packages/next-codemod/transforms/__testfixtures__/next-experimental-turbo-to-turbopack/typescript.output.ts
View file @
a51f3556
...
@@ -5,7 +5,6 @@ const config: NextConfig = {
...
@@ -5,7 +5,6 @@ const config: NextConfig = {
// Removed serverActions due to TypeScript compatibility
// Removed serverActions due to TypeScript compatibility
typedRoutes
:
true
,
typedRoutes
:
true
,
turbopackMemoryLimit
:
4096
,
turbopackMinify
:
true
,
turbopackMinify
:
true
,
turbopackTreeShaking
:
false
,
turbopackTreeShaking
:
false
,
turbopackSourceMaps
:
true
turbopackSourceMaps
:
true
...
...
packages/next-codemod/transforms/__testfixtures__/next-experimental-turbo-to-turbopack/wrapped-function.output.js
View file @
a51f3556
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
const
nextConfig
=
{
const
nextConfig
=
{
experimental
:
{
experimental
:
{
typedRoutes
:
true
,
typedRoutes
:
true
,
turbopackMemoryLimit
:
4096
,
turbopackMinify
:
true
,
turbopackMinify
:
true
,
turbopackTreeShaking
:
false
,
turbopackTreeShaking
:
false
,
turbopackSourceMaps
:
true
turbopackSourceMaps
:
true
...
...
packages/next-codemod/transforms/next-experimental-turbo-to-turbopack.ts
View file @
a51f3556
...
@@ -3,8 +3,12 @@
...
@@ -3,8 +3,12 @@
* the new top-level `turbopack` configuration.
* the new top-level `turbopack` configuration.
*
*
* It moves most properties from experimental.turbo to the top-level turbopack
* It moves most properties from experimental.turbo to the top-level turbopack
* property, with special handling for certain properties like m
emoryLimit, m
inify,
* property, with special handling for certain properties like minify,
* treeShaking, and sourceMaps which become experimental.turbopack* properties instead.
* treeShaking, and sourceMaps which become experimental.turbopack* properties instead.
*
* The `memoryLimit` option is no longer supported, so it is removed entirely in
* both its old location (`experimental.turbo.memoryLimit`) and the location the
* previous version of this codemod produced (`experimental.turbopackMemoryLimit`).
*/
*/
import
type
{
import
type
{
...
@@ -23,12 +27,17 @@ import { isNextConfigFile } from './lib/utils'
...
@@ -23,12 +27,17 @@ import { isNextConfigFile } from './lib/utils'
// Properties that need to be moved to experimental.turbopack*
// Properties that need to be moved to experimental.turbopack*
const
RENAMED_EXPERIMENTAL_PROPERTIES
=
{
const
RENAMED_EXPERIMENTAL_PROPERTIES
=
{
memoryLimit
:
'turbopackMemoryLimit'
,
minify
:
'turbopackMinify'
,
minify
:
'turbopackMinify'
,
treeShaking
:
'turbopackTreeShaking'
,
treeShaking
:
'turbopackTreeShaking'
,
sourceMaps
:
'turbopackSourceMaps'
,
sourceMaps
:
'turbopackSourceMaps'
,
}
}
// `memoryLimit` is no longer supported and is removed entirely. We drop it under
// both its old `experimental.turbo.*` name and the `experimental.*` name produced
// by the previous version of this codemod.
const
REMOVED_TURBO_PROPERTY
=
'memoryLimit'
const
REMOVED_EXPERIMENTAL_PROPERTY
=
'turbopackMemoryLimit'
export
default
function
transformer
(
export
default
function
transformer
(
file
:
FileInfo
,
file
:
FileInfo
,
_api
:
JSCodeShiftAPI
,
_api
:
JSCodeShiftAPI
,
...
@@ -87,6 +96,16 @@ export default function transformer(
...
@@ -87,6 +96,16 @@ export default function transformer(
const
specialProps
=
[]
const
specialProps
=
[]
turboObj
.
properties
.
forEach
((
prop
)
=>
{
turboObj
.
properties
.
forEach
((
prop
)
=>
{
if
(
isStaticProperty
(
prop
)
&&
prop
.
key
&&
prop
.
key
.
type
===
'Identifier'
&&
prop
.
key
.
name
===
REMOVED_TURBO_PROPERTY
)
{
// Drop: `memoryLimit` is no longer supported.
return
}
if
(
if
(
isStaticProperty
(
prop
)
&&
isStaticProperty
(
prop
)
&&
prop
.
key
&&
prop
.
key
&&
...
@@ -112,7 +131,10 @@ export default function transformer(
...
@@ -112,7 +131,10 @@ export default function transformer(
isStaticProperty
(
prop
)
&&
isStaticProperty
(
prop
)
&&
prop
.
key
&&
prop
.
key
&&
prop
.
key
.
type
===
'Identifier'
&&
prop
.
key
.
type
===
'Identifier'
&&
prop
.
key
.
name
===
'turbo'
// Drop the `turbo` object (moved above) and a pre-existing
// `turbopackMemoryLimit` (no longer supported).
(
prop
.
key
.
name
===
'turbo'
||
prop
.
key
.
name
===
REMOVED_EXPERIMENTAL_PROPERTY
)
)
)
)
)
...
@@ -193,7 +215,14 @@ export default function transformer(
...
@@ -193,7 +215,14 @@ export default function transformer(
return
return
}
}
// For special properties like memoryLimit, minify, etc.
// `memoryLimit` is no longer supported: remove the assignment entirely.
if
(
propName
===
REMOVED_TURBO_PROPERTY
)
{
j
(
path
).
remove
()
hasChanges
=
true
return
}
// For special properties like minify, treeShaking, etc.
if
(
propName
&&
RENAMED_EXPERIMENTAL_PROPERTIES
[
propName
])
{
if
(
propName
&&
RENAMED_EXPERIMENTAL_PROPERTIES
[
propName
])
{
const
newAssignment
=
j
.
assignmentExpression
(
const
newAssignment
=
j
.
assignmentExpression
(
'='
,
'='
,
...
@@ -298,6 +327,27 @@ export default function transformer(
...
@@ -298,6 +327,27 @@ export default function transformer(
}
}
})
})
// Remove `config.experimental.turbopackMemoryLimit = value` assignments left
// behind by the previous version of this codemod (no longer supported).
root
.
find
(
j
.
AssignmentExpression
,
{
left
:
{
type
:
'MemberExpression'
,
object
:
{
type
:
'MemberExpression'
,
property
:
{
type
:
'Identifier'
,
name
:
'experimental'
},
},
property
:
{
type
:
'Identifier'
,
name
:
REMOVED_EXPERIMENTAL_PROPERTY
,
},
},
})
.
forEach
((
path
)
=>
{
j
(
path
).
remove
()
hasChanges
=
true
})
// Only return a string if we changed the AST, otherwise return the original source
// Only return a string if we changed the AST, otherwise return the original source
return
hasChanges
?
root
.
toSource
(
options
)
:
file
.
source
return
hasChanges
?
root
.
toSource
(
options
)
:
file
.
source
}
}
...
...
packages/next/src/build/swc/generated-native.d.ts
View file @
a51f3556
...
@@ -309,8 +309,6 @@ export interface NapiDefineEnv {
...
@@ -309,8 +309,6 @@ export interface NapiDefineEnv {
nodejs
:
Array
<
NapiOptionEnvVar
>
nodejs
:
Array
<
NapiOptionEnvVar
>
}
}
export
interface
NapiTurboEngineOptions
{
export
interface
NapiTurboEngineOptions
{
/** An upper bound of memory that turbopack will attempt to stay under. */
memoryLimit
?:
number
/** Track dependencies between tasks. If false, any change during build will error. */
/** Track dependencies between tasks. If false, any change during build will error. */
dependencyTracking
?:
boolean
dependencyTracking
?:
boolean
/** Whether the project is running in a CI environment. */
/** Whether the project is running in a CI environment. */
...
...
packages/next/src/server/config-schema.ts
View file @
a51f3556
...
@@ -364,7 +364,6 @@ export const experimentalSchema = {
...
@@ -364,7 +364,6 @@ export const experimentalSchema = {
typedRoutes
:
z
.
boolean
().
optional
(),
typedRoutes
:
z
.
boolean
().
optional
(),
webpackBuildWorker
:
z
.
boolean
().
optional
(),
webpackBuildWorker
:
z
.
boolean
().
optional
(),
webpackMemoryOptimizations
:
z
.
boolean
().
optional
(),
webpackMemoryOptimizations
:
z
.
boolean
().
optional
(),
turbopackMemoryLimit
:
z
.
number
().
optional
(),
turbopackMemoryEviction
:
z
turbopackMemoryEviction
:
z
.
union
([
z
.
literal
(
false
),
z
.
literal
(
'full'
)])
.
union
([
z
.
literal
(
false
),
z
.
literal
(
'full'
)])
.
optional
(),
.
optional
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment