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
2b54a007
Unverified
Commit
2b54a007
authored
Apr 08, 2025
by
Will Binns-Smith
Committed by
GitHub
Apr 08, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack builds: Remove canary-gate and add experimental warning (#77808)
parent
e69918dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
index.ts
packages/next/src/build/index.ts
+26
-0
impl.ts
packages/next/src/build/turbopack-build/impl.ts
+0
-7
No files found.
packages/next/src/build/index.ts
View file @
2b54a007
...
@@ -3709,6 +3709,10 @@ export default async function build(
...
@@ -3709,6 +3709,10 @@ export default async function build(
// Ensure we wait for lockfile patching if present
// Ensure we wait for lockfile patching if present
await
lockfilePatchPromise
.
cur
await
lockfilePatchPromise
.
cur
if
(
isTurbopack
&&
!
process
.
env
.
__NEXT_TEST_MODE
)
{
warnAboutTurbopackBuilds
(
loadedConfig
)
}
// Ensure all traces are flushed before finishing the command
// Ensure all traces are flushed before finishing the command
await
flushAllTraces
()
await
flushAllTraces
()
teardownTraceSubscriber
()
teardownTraceSubscriber
()
...
@@ -3725,3 +3729,25 @@ export default async function build(
...
@@ -3725,3 +3729,25 @@ export default async function build(
}
}
}
}
}
}
function
warnAboutTurbopackBuilds
(
config
?:
NextConfigComplete
)
{
let
warningStr
=
`Support for Turbopack builds is experimental. `
+
bold
(
`We don't recommend deploying mission-critical applications to production.`
)
warningStr
+=
'
\
n
\
n- It is expected that your bundle size might be different from `next build` with webpack. This will be improved as we work towards stability.'
if
(
!
config
?.
experimental
.
turbo
?.
unstablePersistentCaching
)
{
warningStr
+=
'
\
n- This build is without disk caching; subsequent builds will become faster when disk caching becomes available.'
}
warningStr
+=
'
\
n- When comparing output to webpack builds, make sure to first clear the Next.js cache by deleting the `.next` directory.'
warningStr
+=
'
\
n
\
nProvide feedback for Turbopack builds at https://github.com/vercel/next.js/discussions/77721'
Log
.
warn
(
warningStr
)
}
packages/next/src/build/turbopack-build/impl.ts
View file @
2b54a007
...
@@ -19,19 +19,12 @@ import loadConfig from '../../server/config'
...
@@ -19,19 +19,12 @@ import loadConfig from '../../server/config'
import
{
hasCustomExportOutput
}
from
'../../export/utils'
import
{
hasCustomExportOutput
}
from
'../../export/utils'
import
{
Telemetry
}
from
'../../telemetry/storage'
import
{
Telemetry
}
from
'../../telemetry/storage'
import
{
setGlobal
}
from
'../../trace'
import
{
setGlobal
}
from
'../../trace'
import
{
isStableBuild
,
CanaryOnlyError
}
from
'../../shared/lib/canary-only'
export
async
function
turbopackBuild
():
Promise
<
{
export
async
function
turbopackBuild
():
Promise
<
{
duration
:
number
duration
:
number
buildTraceContext
:
undefined
buildTraceContext
:
undefined
shutdownPromise
:
Promise
<
void
>
shutdownPromise
:
Promise
<
void
>
}
>
{
}
>
{
if
(
isStableBuild
())
{
throw
new
CanaryOnlyError
(
'Turbopack builds are only available in canary builds of Next.js.'
)
}
await
validateTurboNextConfig
({
await
validateTurboNextConfig
({
dir
:
NextBuildContext
.
dir
!
,
dir
:
NextBuildContext
.
dir
!
,
isDev
:
false
,
isDev
:
false
,
...
...
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