Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure edge prerender-manifest is minimal #64946

Merged
merged 3 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,10 @@ async function writeEdgePartialPrerenderManifest(
// Use env vars in JS bundle and inject the actual vars to edge manifest.
const edgePartialPrerenderManifest: DeepReadonly<Partial<PrerenderManifest>> =
{
...manifest,
routes: {},
dynamicRoutes: {},
notFoundRoutes: [],
version: manifest.version,
preview: {
previewModeId: 'process.env.__NEXT_PREVIEW_MODE_ID',
previewModeSigningKey: 'process.env.__NEXT_PREVIEW_MODE_SIGNING_KEY',
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/app-dir/app/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ createNextDescribe(
)
})

it('should not have entire prerender-manifest for edge', async () => {
expect(
await next.readFile('.next/prerender-manifest.js')
).not.toContain('initialRevalidate')
})

if (!process.env.NEXT_EXPERIMENTAL_COMPILE) {
it('should have correct size in build output', async () => {
expect(next.cliOutput).toMatch(
Expand Down
1 change: 1 addition & 0 deletions test/turbopack-build-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@
"app dir - basic should not apply client router filter on shallow",
"app dir - basic should not create new root layout when nested (optional)",
"app dir - basic should not have loader generated function for edge runtime",
"app dir - basic should not have entire prerender-manifest for edge",
"app dir - basic should not include parent when not in parent directory",
"app dir - basic should not rerender layout when navigating between routes in the same layout",
"app dir - basic should not serve when layout is provided but no folder index",
Expand Down
Loading