Skip to content

Commit

Permalink
add dev flag and fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed May 3, 2024
1 parent 7090f87 commit b883542
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/next/src/server/dev/hot-reloader-turbopack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export async function createHotReloaderTurbopack(
// of the current `next dev` invocation.
hotReloaderSpan.stop()

const encryptionKey = await generateEncryptionKeyBase64()
const encryptionKey = await generateEncryptionKeyBase64(true)
const project = await bindings.turbo.createProject({
projectPath: dir,
rootPath: opts.nextConfig.experimental.outputFileTracingRoot || dir,
Expand All @@ -143,7 +143,7 @@ export async function createHotReloaderTurbopack(
// TODO: Implement
middlewareMatchers: undefined,
}),
buildId: 'development',
buildId,
encryptionKey,
previewProps: opts.fsChecker.prerenderManifest.preview,
})
Expand All @@ -169,7 +169,7 @@ export async function createHotReloaderTurbopack(
const manifestLoader = new TurbopackManifestLoader({
buildId,
distDir,
encryptionKey: encryptionKey,
encryptionKey,
})

// Dev specific
Expand Down
13 changes: 7 additions & 6 deletions test/e2e/middleware-general/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ describe('Middleware Runtime', () => {
...manifest.middleware['/'],
}
const envs = {
...middlewareWithoutEnvs.environments,
...middlewareWithoutEnvs.env,
}
delete middlewareWithoutEnvs.environments
delete middlewareWithoutEnvs.env
expect(middlewareWithoutEnvs).toEqual({
files: expect.arrayContaining([
'server/edge-runtime-webpack.js',
Expand All @@ -186,10 +186,11 @@ describe('Middleware Runtime', () => {
regions: 'auto',
})
expect(envs).toContainAllKeys([
'buildId',
'previewModeEncryptionKey',
'previewModeId',
'previewModeSigningKey',
'NEXT_SERVER_ACTIONS_ENCRYPTION_KEY',
'__NEXT_BUILD_ID',
'__NEXT_PREVIEW_MODE_ENCRYPTION_KEY',
'__NEXT_PREVIEW_MODE_ID',
'__NEXT_PREVIEW_MODE_SIGNING_KEY',
])
})

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/middleware-trailing-slash/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('Middleware Runtime trailing slash', () => {
const middlewareWithoutEnvs = {
...manifest.middleware['/'],
}
delete middlewareWithoutEnvs.environments
delete middlewareWithoutEnvs.env
expect(middlewareWithoutEnvs).toEqual({
files: expect.arrayContaining([
'prerender-manifest.js',
Expand Down

0 comments on commit b883542

Please sign in to comment.