Skip to content

Commit 23cd7a0

Browse files
authored
Turbopack build: Skip typedRoutes tests (experimental feature) (#67891)
This feature is not supported yet in Turbopack and since it's experimental it will be implemented after stable 👍 <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
1 parent e7bdb61 commit 23cd7a0

File tree

4 files changed

+47
-40
lines changed

4 files changed

+47
-40
lines changed

docs/04-architecture/turbopack.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ These features are currently not supported:
4646
- We are planning to implement this in the future.
4747
- [Relay transforms](/docs/architecture/nextjs-compiler#relay)
4848
- We are planning to implement this in the future.
49+
- [`experimental.typedRoutes](https://nextjs.org/docs/app/api-reference/next-config-js/typedRoutes)
50+
- We are planning to implement this in the future.
4951
- `experimental.nextScriptWorkers`
5052
- We are planning to implement this in the future.
5153
- `experimental.sri.algorithm`

test/integration/app-types/app-types.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { nextBuild } from 'next-test-utils'
66

77
const appDir = __dirname
88

9-
describe('app type checking', () => {
9+
// Turbopack doesn't support additional experimental features in the first version
10+
;(process.env.TURBOPACK ? describe.skip : describe)('app type checking', () => {
1011
;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
1112
'production mode',
1213
() => {
Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
import { nextBuild } from 'next-test-utils'
22
import path from 'path'
3+
;(process.env.TURBOPACK ? describe.skip : describe)(
4+
'app dir - typed-routes-with-webpack-worker',
5+
() => {
6+
it('builds successfully without errors', async () => {
7+
const output = await nextBuild(
8+
path.join(__dirname, 'good-routes'),
9+
undefined,
10+
{
11+
stdout: true,
12+
stderr: true,
13+
}
14+
)
315

4-
describe('app dir - typed-routes-with-webpack-worker', () => {
5-
it('builds successfully without errors', async () => {
6-
const output = await nextBuild(
7-
path.join(__dirname, 'good-routes'),
8-
undefined,
9-
{
10-
stdout: true,
11-
stderr: true,
12-
}
13-
)
16+
// check for the experimental flag warning
17+
expect(output.stdout).toContain('webpackBuildWorker')
18+
// should have a successful build
19+
expect(output.code).toBe(0)
20+
// with no errors
21+
expect(output.stderr).not.toContain(`"/" is not an existing route.`)
22+
})
1423

15-
// check for the experimental flag warning
16-
expect(output.stdout).toContain('webpackBuildWorker')
17-
// should have a successful build
18-
expect(output.code).toBe(0)
19-
// with no errors
20-
expect(output.stderr).not.toContain(`"/" is not an existing route.`)
21-
})
24+
it('builds with valid errors', async () => {
25+
const output = await nextBuild(
26+
path.join(__dirname, 'bad-routes'),
27+
undefined,
28+
{
29+
stdout: true,
30+
stderr: true,
31+
}
32+
)
2233

23-
it('builds with valid errors', async () => {
24-
const output = await nextBuild(
25-
path.join(__dirname, 'bad-routes'),
26-
undefined,
27-
{
28-
stdout: true,
29-
stderr: true,
30-
}
31-
)
32-
33-
// check for the experimental flag warning
34-
expect(output.stdout).toContain('webpackBuildWorker')
35-
// should have a failed build
36-
expect(output.code).toBe(1)
37-
// with correct error
38-
expect(output.stderr).toContain(`"/asdfasdfasdf" is not an existing route.`)
39-
})
40-
})
34+
// check for the experimental flag warning
35+
expect(output.stdout).toContain('webpackBuildWorker')
36+
// should have a failed build
37+
expect(output.code).toBe(1)
38+
// with correct error
39+
expect(output.stderr).toContain(
40+
`"/asdfasdfasdf" is not an existing route.`
41+
)
42+
})
43+
}
44+
)

test/turbopack-build-tests-manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6890,12 +6890,12 @@
68906890
},
68916891
"test/integration/app-types/app-types.test.js": {
68926892
"passed": [],
6893-
"failed": [
6893+
"failed": [],
6894+
"pending": [
68946895
"app type checking production mode should generate route types correctly and report link error",
68956896
"app type checking production mode should generate route types correctly and report router API errors",
68966897
"app type checking production mode should type check invalid entry exports"
68976898
],
6898-
"pending": [],
68996899
"flakey": [],
69006900
"runtimeError": false
69016901
},
@@ -15548,11 +15548,11 @@
1554815548
},
1554915549
"test/production/app-dir/typed-routes-with-webpack-worker/typed-routes-with-webpack-worker.test.ts": {
1555015550
"passed": [],
15551-
"failed": [
15551+
"failed": [],
15552+
"pending": [
1555215553
"app dir - typed-routes-with-webpack-worker builds successfully without errors",
1555315554
"app dir - typed-routes-with-webpack-worker builds with valid errors"
1555415555
],
15555-
"pending": [],
1555615556
"flakey": [],
1555715557
"runtimeError": false
1555815558
},

0 commit comments

Comments
 (0)