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
feb594bd
Unverified
Commit
feb594bd
authored
Mar 31, 2026
by
Niklas Mischkulnig
Committed by
GitHub
Mar 31, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: use same hash for immutable-static-hashes.json (#92157)
parent
6a204593
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
1 deletion
+36
-1
project_asset_hashes_manifest.rs
crates/next-api/src/project_asset_hashes_manifest.rs
+1
-1
my-adapter.mjs
test/production/deployment-id-handling/app/my-adapter.mjs
+9
-0
next.config.js
test/production/deployment-id-handling/app/next.config.js
+2
-0
deployment-id-handling.test.ts
...ion/deployment-id-handling/deployment-id-handling.test.ts
+24
-0
No files found.
crates/next-api/src/project_asset_hashes_manifest.rs
View file @
feb594bd
...
@@ -142,7 +142,7 @@ impl Asset for AssetHashesManifestAsset {
...
@@ -142,7 +142,7 @@ impl Asset for AssetHashesManifestAsset {
.map
(
async
|(
asset
,
path
)|
{
.map
(
async
|(
asset
,
path
)|
{
Ok
((
Ok
((
path
,
path
,
asset
.content_hash
(
HashAlgorithm
::
Xxh3Hash128
Hex
)
.await
?
,
asset
.content_hash
(
HashAlgorithm
::
Xxh3Hash128
Base38
)
.await
?
,
))
))
})
})
.try_join
()
.try_join
()
...
...
test/production/deployment-id-handling/app/my-adapter.mjs
0 → 100644
View file @
feb594bd
import
fs
from
'fs/promises'
/** @type {import('next').NextAdapter } */
export
default
{
name
:
'deployment-id-handling'
,
async
onBuildComplete
(
ctx
)
{
await
fs
.
writeFile
(
'build-complete.json'
,
JSON
.
stringify
(
ctx
,
null
,
2
))
},
}
test/production/deployment-id-handling/app/next.config.js
View file @
feb594bd
...
@@ -9,4 +9,6 @@ module.exports = {
...
@@ -9,4 +9,6 @@ module.exports = {
?
`imm-
${
process
.
env
.
IMMUTABLE_ASSET_TOKEN
}
`
?
`imm-
${
process
.
env
.
IMMUTABLE_ASSET_TOKEN
}
`
:
undefined
,
:
undefined
,
},
},
adapterPath
:
process
.
env
.
NEXT_ADAPTER_PATH
??
require
.
resolve
(
'./my-adapter.mjs'
),
}
}
test/production/deployment-id-handling/deployment-id-handling.test.ts
View file @
feb594bd
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
NextAdapter
}
from
'next'
import
{
retry
}
from
'next-test-utils'
import
{
retry
}
from
'next-test-utils'
import
{
join
}
from
'node:path'
import
{
join
}
from
'node:path'
...
@@ -182,6 +183,29 @@ describe.each([
...
@@ -182,6 +183,29 @@ describe.each([
(
headers
)
=>
headers
[
'x-deployment-id'
]
===
deploymentId
(
headers
)
=>
headers
[
'x-deployment-id'
]
===
deploymentId
)
)
})
})
if
(
envKey
===
'IMMUTABLE_ASSET_TOKEN'
)
{
it
(
'should emit hashes to adapter'
,
async
()
=>
{
const
{
outputs
}:
Parameters
<
NextAdapter
[
'onBuildComplete'
]
>
[
0
]
=
await
next
.
readJSON
(
'build-complete.json'
)
const
immutableAssets
=
outputs
.
staticFiles
.
filter
(
(
a
)
=>
a
.
pathname
.
startsWith
(
'/_next/static/'
)
&&
!
(
a
.
pathname
.
endsWith
(
'/_buildManifest.js'
)
||
a
.
pathname
.
endsWith
(
'/_clientMiddlewareManifest.js'
)
||
a
.
pathname
.
endsWith
(
'/_ssgManifest.js'
)
)
)
expect
(
immutableAssets
).
not
.
toBeEmpty
()
expect
(
immutableAssets
).
toSatisfyAll
(
(
f
)
=>
// Should be same hash as in the filename, for better build performance
f
.
immutableHash
&&
f
.
pathname
.
includes
(
f
.
immutableHash
.
slice
(
0
,
13
))
)
})
}
}
}
)
)
...
...
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