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
9ec56531
Unverified
Commit
9ec56531
authored
Oct 14, 2026
by
Niklas Mischkulnig
Committed by
GitHub
Oct 14, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: speed up use-cache-cross-deployment even more (#100181)
Get rid of a few more unnecessary rebuilds
parent
9c70ede1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
52 deletions
+38
-52
use-cache-cross-deployment.test.ts
...cache-cross-deployment/use-cache-cross-deployment.test.ts
+38
-52
No files found.
test/production/app-dir/use-cache-cross-deployment/use-cache-cross-deployment.test.ts
View file @
9ec56531
...
@@ -196,7 +196,41 @@ async function execute(
...
@@ -196,7 +196,41 @@ async function execute(
}
}
}
}
const
prerenderedRoutes
:
Record
<
string
,
{
pathname
:
string
;
value
:
string
}
>
=
{}
// Use the manifest only to discover concrete prerendered URLs; check
// cache reuse through their observable HTTP responses below.
const
manifest
=
await
next
.
readJSON
(
'.next/prerender-manifest.json'
)
for
(
const
route
of
[
'generator-layout'
,
'generator-route'
,
'generator-sitemap'
,
'generator-image'
,
'static-params'
,
])
{
const
routes
=
Object
.
keys
(
manifest
.
routes
).
filter
(
(
pathname
)
=>
pathname
.
startsWith
(
`/
${
route
}
/`
)
&&
!
pathname
.
includes
(
'['
)
)
expect
(
routes
).
toHaveLength
(
1
)
const
pathname
=
routes
[
0
]
const
response
=
await
next
.
fetch
(
pathname
)
expect
({
pathname
,
status
:
response
.
status
}).
toEqual
({
pathname
,
status
:
200
,
})
const
value
=
pathname
.
includes
(
'generator-layout'
)
||
pathname
.
includes
(
'static-params'
)
?
(
await
next
.
render$
(
pathname
))(
'p'
).
text
()
:
await
response
.
text
()
prerenderedRoutes
[
route
]
=
{
pathname
,
value
}
}
return
{
return
{
prerenderedRoutes
,
runtimeValues
,
runtimeValues
,
keyRoot
,
keyRoot
,
keyNested
,
keyNested
,
...
@@ -429,56 +463,6 @@ describe.each(['NEXT_DEPLOYMENT_ID', 'BUILD_ID', 'default'])(
...
@@ -429,56 +463,6 @@ describe.each(['NEXT_DEPLOYMENT_ID', 'BUILD_ID', 'default'])(
expect
(
key1
.
runtimeValues
.
action
).
not
.
toBeEmpty
()
expect
(
key1
.
runtimeValues
.
action
).
not
.
toBeEmpty
()
expect
(
key2
.
runtimeValues
.
action
).
toBe
(
key1
.
runtimeValues
.
action
)
expect
(
key2
.
runtimeValues
.
action
).
toBe
(
key1
.
runtimeValues
.
action
)
})
})
})
describe
(
'durable build-time generators'
,
()
=>
{
let
first
:
Record
<
string
,
{
pathname
:
string
;
value
:
string
}
>
let
second
:
Record
<
string
,
{
pathname
:
string
;
value
:
string
}
>
async
function
buildAndRead
(
deploymentId
:
string
)
{
await
next
.
start
({
env
:
{
NEXT_DEPLOYMENT_ID
:
deploymentId
}
})
try
{
const
values
:
Record
<
string
,
{
pathname
:
string
;
value
:
string
}
>
=
{}
// Use the manifest only to discover concrete prerendered URLs; check
// cache reuse through their observable HTTP responses below.
const
manifest
=
await
next
.
readJSON
(
'.next/prerender-manifest.json'
)
for
(
const
route
of
[
'generator-layout'
,
'generator-route'
,
'generator-sitemap'
,
'generator-image'
,
'static-params'
,
])
{
const
routes
=
Object
.
keys
(
manifest
.
routes
).
filter
(
(
pathname
)
=>
pathname
.
startsWith
(
`/
${
route
}
/`
)
&&
!
pathname
.
includes
(
'['
)
)
expect
(
routes
).
toHaveLength
(
1
)
const
pathname
=
routes
[
0
]
const
response
=
await
next
.
fetch
(
pathname
)
expect
({
pathname
,
status
:
response
.
status
}).
toEqual
({
pathname
,
status
:
200
,
})
const
value
=
pathname
.
includes
(
'generator-layout'
)
||
pathname
.
includes
(
'static-params'
)
?
(
await
next
.
render$
(
pathname
))(
'p'
).
text
()
:
await
response
.
text
()
values
[
route
]
=
{
pathname
,
value
}
}
return
values
}
finally
{
await
next
.
stop
()
}
}
beforeAll
(
async
()
=>
{
await
next
.
stop
()
first
=
await
buildAndRead
(
'generators-first'
)
second
=
await
buildAndRead
(
'generators-second'
)
})
it
.
each
([
it
.
each
([
[
'layout generateStaticParams'
,
'generator-layout'
],
[
'layout generateStaticParams'
,
'generator-layout'
],
...
@@ -488,8 +472,10 @@ describe.each(['NEXT_DEPLOYMENT_ID', 'BUILD_ID', 'default'])(
...
@@ -488,8 +472,10 @@ describe.each(['NEXT_DEPLOYMENT_ID', 'BUILD_ID', 'default'])(
[
'generateImageMetadata'
,
'generator-image'
],
[
'generateImageMetadata'
,
'generator-image'
],
[
'page generateStaticParams'
,
'static-params'
],
[
'page generateStaticParams'
,
'static-params'
],
])(
'should reuse durable entries in %s'
,
(
_name
,
route
)
=>
{
])(
'should reuse durable entries in %s'
,
(
_name
,
route
)
=>
{
expect
(
first
[
route
].
value
).
not
.
toBeEmpty
()
expect
(
key1
.
prerenderedRoutes
[
route
].
value
).
not
.
toBeEmpty
()
expect
(
second
[
route
]).
toEqual
(
first
[
route
])
expect
(
key2
.
prerenderedRoutes
[
route
]).
toEqual
(
key1
.
prerenderedRoutes
[
route
]
)
})
})
})
})
...
...
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