Skip to content

Commit e0e6213

Browse files
authored
ci: Enable experimental.isolatedDevBuild for test-experimental-dev (#84099)
1 parent 03c92e2 commit e0e6213

File tree

14 files changed

+77
-26
lines changed

14 files changed

+77
-26
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,7 @@ jobs:
980980
export __NEXT_EXPERIMENTAL_CACHE_COMPONENTS=true
981981
export NEXT_EXTERNAL_TESTS_FILTERS="test/experimental-tests-manifest.json"
982982
export NEXT_TEST_MODE=dev
983+
export __NEXT_EXPERIMENTAL_ISOLATED_DEV_BUILD=true
983984
984985
node run-tests.js \
985986
--timings \

packages/next/src/server/config-shared.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,8 @@ export const defaultConfig = Object.freeze({
14981498
slowModuleDetection: undefined,
14991499
globalNotFound: false,
15001500
browserDebugInfoInTerminal: false,
1501-
isolatedDevBuild: false,
1501+
isolatedDevBuild:
1502+
process.env.__NEXT_EXPERIMENTAL_ISOLATED_DEV_BUILD === 'true',
15021503
},
15031504
htmlLimitedBots: undefined,
15041505
bundlePagesRouterDependencies: false,

test/development/app-dir/typed-env/typed-env-prod.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('typed-env', () => {
1111

1212
it('should have env types from next config', async () => {
1313
await retry(async () => {
14-
const envDTS = await next.readFile('.next/types/env.d.ts')
14+
const envDTS = await next.readFile(`${next.distDir}/types/env.d.ts`)
1515
// since NODE_ENV is production, env types will
1616
// not include development-specific env
1717
expect(envDTS).not.toContain('FROM_ENV_DEV')

test/development/app-dir/typed-env/typed-env.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('typed-env', () => {
88

99
it('should have env types from next config', async () => {
1010
await retry(async () => {
11-
const envDTS = await next.readFile('.next/types/env.d.ts')
11+
const envDTS = await next.readFile(`${next.distDir}/types/env.d.ts`)
1212
// since NODE_ENV is development, env types will
1313
// not include production-specific env
1414
expect(envDTS).not.toContain('FROM_ENV_PROD')
@@ -39,7 +39,7 @@ describe('typed-env', () => {
3939

4040
it('should rewrite env types if .env is modified', async () => {
4141
await retry(async () => {
42-
const content = await next.readFile('.next/types/env.d.ts')
42+
const content = await next.readFile(`${next.distDir}/types/env.d.ts`)
4343
expect(content).toContain('FROM_ENV')
4444
})
4545

@@ -50,7 +50,7 @@ describe('typed-env', () => {
5050
// e.g. FROM_ENV?: string
5151
// but have MODIFIED_ENV?: string
5252
await retry(async () => {
53-
const content = await next.readFile('.next/types/env.d.ts')
53+
const content = await next.readFile(`${next.distDir}/types/env.d.ts`)
5454
expect(content).toMatchInlineSnapshot(`
5555
"// Type definitions for Next.js environment variables
5656
declare global {

test/e2e/app-dir/css-server-chunks/css-server-chunks.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('css-server-chunks', () => {
1919
expect((await next.fetch('/pages')).status).toBe(200)
2020

2121
let clientChunks = (
22-
await fs.readdir(path.join(next.testDir, '.next', 'static'), {
22+
await fs.readdir(path.join(next.testDir, next.distDir, 'static'), {
2323
recursive: true,
2424
})
2525
).filter((f) => f.endsWith('.js') || f.endsWith('.css'))
@@ -29,11 +29,12 @@ describe('css-server-chunks', () => {
2929

3030
let serverChunks = (
3131
await Promise.all(
32-
['.next/server/app', '.next/server/pages'].map((d) =>
33-
fs.readdir(path.join(next.testDir, d), {
34-
recursive: true,
35-
encoding: 'utf8',
36-
})
32+
[`${next.distDir}/server/app`, `${next.distDir}/server/pages`].map(
33+
(d) =>
34+
fs.readdir(path.join(next.testDir, d), {
35+
recursive: true,
36+
encoding: 'utf8',
37+
})
3738
)
3839
)
3940
)

test/e2e/app-dir/server-components-externals/index.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,16 @@ describe('app-dir - server components externals', () => {
3434
if (!isTurbopack) {
3535
it('should externalize serversExternalPackages for server rendering layer', async () => {
3636
await next.fetch('/client')
37-
const ssrBundle = await next.readFile('.next/server/app/client/page.js')
37+
const ssrBundle = await next.readFile(
38+
`${next.distDir}/server/app/client/page.js`
39+
)
3840
expect(ssrBundle).not.toContain('external-package-mark:index')
3941
expect(ssrBundle).not.toContain('external-package-mark:subpath')
4042

4143
await next.fetch('/')
42-
const rscBundle = await next.readFile('.next/server/app/page.js')
44+
const rscBundle = await next.readFile(
45+
`${next.distDir}/server/app/page.js`
46+
)
4347
expect(rscBundle).not.toContain('external-package-mark:index')
4448
expect(rscBundle).not.toContain('external-package-mark:subpath')
4549
})

test/e2e/app-dir/typed-routes/typed-links.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ describe('typed-links', () => {
1111
}
1212

1313
it('should generate types for next/link', async () => {
14-
const dts = await next.readFile('.next/types/link.d.ts')
14+
const dts = await next.readFile(`${next.distDir}/types/link.d.ts`)
1515
expect(dts).toContain(`declare module 'next/link'`)
1616
})
1717

1818
it('should include handler route from app/api-test/route.ts in generated link route definitions', async () => {
19-
const dts = await next.readFile('.next/types/link.d.ts')
19+
const dts = await next.readFile(`${next.distDir}/types/link.d.ts`)
2020
// Ensure the app route handler at app/api-test/route.ts ("/api-test") is present
2121
expect(dts).toContain('`/api-test`')
2222
})

test/e2e/app-dir/typed-routes/typed-routes.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ describe('typed-routes', () => {
2222
}
2323

2424
it('should generate route types correctly', async () => {
25-
const dts = await next.readFile('.next/types/routes.d.ts')
25+
const dts = await next.readFile(`${next.distDir}/types/routes.d.ts`)
2626
expect(dts).toContain(expectedDts)
2727
})
2828

2929
it('should correctly convert custom route patterns from path-to-regexp to bracket syntax', async () => {
30-
const dts = await next.readFile('.next/types/routes.d.ts')
30+
const dts = await next.readFile(`${next.distDir}/types/routes.d.ts`)
3131

3232
// Test standard dynamic segment: :slug -> [slug]
3333
expect(dts).toContain('"/project/[slug]"')
@@ -52,7 +52,9 @@ describe('typed-routes', () => {
5252
`
5353
)
5454

55-
const routeTypesContent = await next.readFile('.next/types/routes.d.ts')
55+
const routeTypesContent = await next.readFile(
56+
`${next.distDir}/types/routes.d.ts`
57+
)
5658

5759
expect(routeTypesContent).toContain(
5860
'type LayoutRoutes = "/" | "/dashboard" | "/new-layout"'
@@ -61,7 +63,7 @@ describe('typed-routes', () => {
6163
}
6264

6365
it('should generate RouteContext type for route handlers', async () => {
64-
const dts = await next.readFile('.next/types/routes.d.ts')
66+
const dts = await next.readFile(`${next.distDir}/types/routes.d.ts`)
6567
expect(dts).toContain(
6668
'interface RouteContext<AppRouteHandlerRoute extends AppRouteHandlerRoutes>'
6769
)

test/e2e/edge-can-use-wasm-files/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ describe('middleware can use wasm files', () => {
103103
it('lists the necessary wasm bindings in the manifest', async () => {
104104
const manifestPath = path.join(
105105
next.testDir,
106-
'.next/server/middleware-manifest.json'
106+
`${next.distDir}/server/middleware-manifest.json`
107107
)
108108
const manifest = await fs.readJSON(manifestPath)
109109
if (process.env.IS_TURBOPACK_TEST) {

test/e2e/edge-compiler-can-import-blob-assets/index.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ describe('Edge Compiler can import asset assets', () => {
5656
it('extracts all the assets from the bundle', async () => {
5757
const manifestPath = path.join(
5858
next.testDir,
59-
'.next/server/middleware-manifest.json'
59+
next.distDir,
60+
'server/middleware-manifest.json'
6061
)
6162
const manifest = await readJson(manifestPath)
6263
const orderedAssets = manifest.functions['/api/edge'].assets.sort(

0 commit comments

Comments
 (0)