Commit 88581b91 authored by Cong-Cong Pan's avatar Cong-Cong Pan Committed by Jiachi Liu

chore: upgrade rspack 1.6.0 (#84210)

1. Fixed the incremental update bug in buildChunkGraph.
2. Fixed a bug in Rspack's built-in CssChunkingPlugin.

For detailed release information, please see
https://github.com/web-infra-dev/rspack/releases.

Note: All the faulty Rspack test cases on GitHub, from what I can see,
either time out or also produce errors in Rspack version 1.5.0.

---------
Co-authored-by: 's avatarBenjamin Woodruff <benjamin.woodruff@vercel.com>
parent 4da7406f
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
"@next/third-parties": "workspace:*", "@next/third-parties": "workspace:*",
"@opentelemetry/api": "1.4.1", "@opentelemetry/api": "1.4.1",
"@picocss/pico": "1.5.10", "@picocss/pico": "1.5.10",
"@rspack/core": "1.5.0", "@rspack/core": "1.6.0",
"@slack/web-api": "7.9.1", "@slack/web-api": "7.9.1",
"@swc/cli": "0.1.55", "@swc/cli": "0.1.55",
"@swc/core": "1.11.24", "@swc/core": "1.11.24",
......
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
}, },
"types": "index.d.ts", "types": "index.d.ts",
"dependencies": { "dependencies": {
"@next/rspack-core": "1.0.0" "@next/rspack-core": "1.0.1"
} }
} }
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
"@next/swc": "16.0.2", "@next/swc": "16.0.2",
"@opentelemetry/api": "1.6.0", "@opentelemetry/api": "1.6.0",
"@playwright/test": "1.51.1", "@playwright/test": "1.51.1",
"@rspack/core": "1.5.0", "@rspack/core": "1.6.0",
"@storybook/addon-a11y": "8.6.0", "@storybook/addon-a11y": "8.6.0",
"@storybook/addon-essentials": "8.6.0", "@storybook/addon-essentials": "8.6.0",
"@storybook/addon-interactions": "8.6.0", "@storybook/addon-interactions": "8.6.0",
......
...@@ -287,6 +287,10 @@ export function hasExternalOtelApiPackage(): boolean { ...@@ -287,6 +287,10 @@ export function hasExternalOtelApiPackage(): boolean {
const UNSAFE_CACHE_REGEX = /[\\/]pages[\\/][^\\/]+(?:$|\?|#)/ const UNSAFE_CACHE_REGEX = /[\\/]pages[\\/][^\\/]+(?:$|\?|#)/
const NEGATIVE_UNSAFE_CACHE_REGEX = new RegExp(
`^(?!.*${UNSAFE_CACHE_REGEX.source}).*$`
)
export function getCacheDirectories( export function getCacheDirectories(
configs: webpack.Configuration[] configs: webpack.Configuration[]
): Set<string> { ): Set<string> {
...@@ -2257,12 +2261,8 @@ export default async function getBaseWebpackConfig( ...@@ -2257,12 +2261,8 @@ export default async function getBaseWebpackConfig(
} }
if (isRspack) { if (isRspack) {
// @ts-ignore // The layers experiment is now stable in Rspack
// Disable Rspack's incremental buildChunkGraph due to Next.js compatibility issues delete webpack5Config.experiments!.layers
// TODO: Remove this workaround after Rspack 1.5.1 release
webpack5Config.experiments.incremental = {
buildChunkGraph: false,
}
} }
webpack5Config.module!.parser = { webpack5Config.module!.parser = {
...@@ -2488,11 +2488,22 @@ export default async function getBaseWebpackConfig( ...@@ -2488,11 +2488,22 @@ export default async function getBaseWebpackConfig(
if (dev) { if (dev) {
if (webpackConfig.module) { if (webpackConfig.module) {
if (isRspack) {
;(webpackConfig.module.unsafeCache as any) = NEGATIVE_UNSAFE_CACHE_REGEX
} else {
webpackConfig.module.unsafeCache = (module: any) => webpackConfig.module.unsafeCache = (module: any) =>
!UNSAFE_CACHE_REGEX.test(module.resource) !UNSAFE_CACHE_REGEX.test(module.resource)
}
} else {
if (isRspack) {
;(webpackConfig.module as any) = {
unsafeCache: NEGATIVE_UNSAFE_CACHE_REGEX,
}
} else { } else {
webpackConfig.module = { webpackConfig.module = {
unsafeCache: (module: any) => !UNSAFE_CACHE_REGEX.test(module.resource), unsafeCache: (module: any) =>
!UNSAFE_CACHE_REGEX.test(module.resource),
}
} }
} }
} }
......
This diff is collapsed.
...@@ -1791,6 +1791,17 @@ version = "2.0.4" ...@@ -1791,6 +1791,17 @@ version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06432fb54d3be7964ecd3649233cddf80db2832f47fec34c01f65b3d9d774983" checksum = "06432fb54d3be7964ecd3649233cddf80db2832f47fec34c01f65b3d9d774983"
[[package]]
name = "io-uring"
version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b"
dependencies = [
"bitflags 2.9.1",
"cfg-if",
"libc",
]
[[package]] [[package]]
name = "ipnet" name = "ipnet"
version = "2.10.1" version = "2.10.1"
...@@ -6503,6 +6514,7 @@ checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" ...@@ -6503,6 +6514,7 @@ checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408"
dependencies = [ dependencies = [
"parking_lot", "parking_lot",
"pin-project-lite", "pin-project-lite",
"slab",
"tokio-macros", "tokio-macros",
"tracing", "tracing",
] ]
......
...@@ -438,8 +438,8 @@ packages: ...@@ -438,8 +438,8 @@ packages:
'@napi-rs/wasm-runtime@0.2.12': '@napi-rs/wasm-runtime@0.2.12':
resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==} resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==}
'@napi-rs/wasm-runtime@1.0.3': '@napi-rs/wasm-runtime@1.0.7':
resolution: {integrity: sha512-rZxtMsLwjdXkMUGC3WwsPwLNVqVqnTJT6MNIB6e+5fhMcSCPP0AOsNWuMQ5mdCq6HNjs/ZeWAEchpqeprqBD2Q==} resolution: {integrity: sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==}
'@napi-rs/wasm-runtime@1.0.7': '@napi-rs/wasm-runtime@1.0.7':
resolution: {integrity: sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==} resolution: {integrity: sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==}
...@@ -1066,7 +1066,7 @@ snapshots: ...@@ -1066,7 +1066,7 @@ snapshots:
'@napi-rs/lzma-wasm32-wasi@1.4.5': '@napi-rs/lzma-wasm32-wasi@1.4.5':
dependencies: dependencies:
'@napi-rs/wasm-runtime': 1.0.3 '@napi-rs/wasm-runtime': 1.0.7
optional: true optional: true
'@napi-rs/lzma-win32-arm64-msvc@1.4.5': '@napi-rs/lzma-win32-arm64-msvc@1.4.5':
...@@ -1174,11 +1174,11 @@ snapshots: ...@@ -1174,11 +1174,11 @@ snapshots:
'@tybys/wasm-util': 0.10.0 '@tybys/wasm-util': 0.10.0
optional: true optional: true
'@napi-rs/wasm-runtime@1.0.3': '@napi-rs/wasm-runtime@1.0.7':
dependencies: dependencies:
'@emnapi/core': 1.4.5 '@emnapi/core': 1.5.0
'@emnapi/runtime': 1.4.5 '@emnapi/runtime': 1.5.0
'@tybys/wasm-util': 0.10.0 '@tybys/wasm-util': 0.10.1
optional: true optional: true
'@napi-rs/wasm-runtime@1.0.7': '@napi-rs/wasm-runtime@1.0.7':
......
...@@ -4,13 +4,11 @@ import path from 'path' ...@@ -4,13 +4,11 @@ import path from 'path'
import { outdent } from 'outdent' import { outdent } from 'outdent'
describe('ReactRefreshLogBox-builtins app', () => { describe('ReactRefreshLogBox-builtins app', () => {
const { isTurbopack, next } = nextTestSetup({ const { isTurbopack, next, isRspack } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
skipStart: true, skipStart: true,
}) })
const isRspack = !!process.env.NEXT_RSPACK
// Module trace is only available with webpack 5 // Module trace is only available with webpack 5
test('Node.js builtins', async () => { test('Node.js builtins', async () => {
await using sandbox = await createSandbox( await using sandbox = await createSandbox(
...@@ -135,10 +133,10 @@ describe('ReactRefreshLogBox-builtins app', () => { ...@@ -135,10 +133,10 @@ describe('ReactRefreshLogBox-builtins app', () => {
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module not found: Can't resolve 'b' in '<FIXME-project-root>' × Module not found: Can't resolve 'b' in '<FIXME-project-root>'
╭─[2:17] ╭─[2:0]
1 │ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime"; 1 │ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2 │ import Comp from 'b'; 2 │ import Comp from 'b';
· ─── · ─────────────────────
3 │ export default function Oops() { 3 │ export default function Oops() {
4 │ return /*#__PURE__*/ _jsxDEV("div", { 4 │ return /*#__PURE__*/ _jsxDEV("div", {
╰──── ╰────
...@@ -204,10 +202,10 @@ describe('ReactRefreshLogBox-builtins app', () => { ...@@ -204,10 +202,10 @@ describe('ReactRefreshLogBox-builtins app', () => {
"label": "Build Error", "label": "Build Error",
"source": "./app/page.js "source": "./app/page.js
× Module not found: Can't resolve 'b' in '<FIXME-project-root>/app' × Module not found: Can't resolve 'b' in '<FIXME-project-root>/app'
╭─[2:17] ╭─[2:0]
1 │ /* __next_internal_client_entry_do_not_use__ default auto */ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime"; 1 │ /* __next_internal_client_entry_do_not_use__ default auto */ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2 │ import Comp from 'b'; 2 │ import Comp from 'b';
· ─── · ─────────────────────
3 │ export default function Oops() { 3 │ export default function Oops() {
4 │ return /*#__PURE__*/ _jsxDEV("div", { 4 │ return /*#__PURE__*/ _jsxDEV("div", {
╰──── ╰────
...@@ -270,10 +268,10 @@ describe('ReactRefreshLogBox-builtins app', () => { ...@@ -270,10 +268,10 @@ describe('ReactRefreshLogBox-builtins app', () => {
"label": "Build Error", "label": "Build Error",
"source": "./app/page.js "source": "./app/page.js
× Module not found: Can't resolve './non-existent.css' in '<FIXME-project-root>/app' × Module not found: Can't resolve './non-existent.css' in '<FIXME-project-root>/app'
╭─[2:7] ╭─[2:0]
1 │ /* __next_internal_client_entry_do_not_use__ default auto */ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime"; 1 │ /* __next_internal_client_entry_do_not_use__ default auto */ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2 │ import './non-existent.css'; 2 │ import './non-existent.css';
· ──────────────────── · ────────────────────────────
3 │ export default function Page(props) { 3 │ export default function Page(props) {
4 │ return /*#__PURE__*/ _jsxDEV("p", { 4 │ return /*#__PURE__*/ _jsxDEV("p", {
╰────", ╰────",
......
...@@ -6,14 +6,12 @@ import path from 'path' ...@@ -6,14 +6,12 @@ import path from 'path'
import { outdent } from 'outdent' import { outdent } from 'outdent'
describe('ReactRefreshLogBox app', () => { describe('ReactRefreshLogBox app', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack, isRspack } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
skipStart: true, skipStart: true,
patchFileDelay: 1000, patchFileDelay: 1000,
}) })
const isRspack = !!process.env.NEXT_RSPACK
test('should strip whitespace correctly with newline', async () => { test('should strip whitespace correctly with newline', async () => {
await using sandbox = await createSandbox(next) await using sandbox = await createSandbox(next)
const { browser, session } = sandbox const { browser, session } = sandbox
...@@ -1443,7 +1441,7 @@ describe('ReactRefreshLogBox app', () => { ...@@ -1443,7 +1441,7 @@ describe('ReactRefreshLogBox app', () => {
× Module not found: Can't resolve 'non-existing-module' in '<FIXME-project-root>/app' × Module not found: Can't resolve 'non-existing-module' in '<FIXME-project-root>/app'
╭──── ╭────
1 │ import "non-existing-module"; 1 │ import "non-existing-module";
· ───────────────────── · ─────────────────────────────
╰──── ╰────
Import trace for requested module: Import trace for requested module:
./app/module.js ./app/module.js
......
...@@ -4,11 +4,10 @@ import path from 'path' ...@@ -4,11 +4,10 @@ import path from 'path'
import { outdent } from 'outdent' import { outdent } from 'outdent'
describe('ReactRefreshLogBox app', () => { describe('ReactRefreshLogBox app', () => {
const { isTurbopack, next } = nextTestSetup({ const { isTurbopack, next, isRspack } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
skipStart: true, skipStart: true,
}) })
const isRspack = !!process.env.NEXT_RSPACK
test('server-side only compilation errors', async () => { test('server-side only compilation errors', async () => {
await using sandbox = await createSandbox(next) await using sandbox = await createSandbox(next)
......
...@@ -6,11 +6,10 @@ import path from 'path' ...@@ -6,11 +6,10 @@ import path from 'path'
import { outdent } from 'outdent' import { outdent } from 'outdent'
describe('Error recovery app', () => { describe('Error recovery app', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack, isRspack } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
skipStart: true, skipStart: true,
}) })
const isRspack = !!process.env.NEXT_RSPACK
test('can recover from a syntax error without losing state', async () => { test('can recover from a syntax error without losing state', async () => {
await using sandbox = await createSandbox(next) await using sandbox = await createSandbox(next)
......
...@@ -4,11 +4,10 @@ import { outdent } from 'outdent' ...@@ -4,11 +4,10 @@ import { outdent } from 'outdent'
import path from 'path' import path from 'path'
describe('ReactRefreshLogBox', () => { describe('ReactRefreshLogBox', () => {
const { isTurbopack, next } = nextTestSetup({ const { isTurbopack, next, isRspack } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
skipStart: true, skipStart: true,
}) })
const isRspack = !!process.env.NEXT_RSPACK
// Module trace is only available with webpack 5 // Module trace is only available with webpack 5
test('Node.js builtins', async () => { test('Node.js builtins', async () => {
...@@ -133,10 +132,10 @@ describe('ReactRefreshLogBox', () => { ...@@ -133,10 +132,10 @@ describe('ReactRefreshLogBox', () => {
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module not found: Can't resolve 'b' in '<FIXME-project-root>' × Module not found: Can't resolve 'b' in '<FIXME-project-root>'
╭─[2:17] ╭─[2:0]
1 │ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime"; 1 │ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2 │ import Comp from 'b'; 2 │ import Comp from 'b';
· ─── · ─────────────────────
3 │ export default function Oops() { 3 │ export default function Oops() {
4 │ return /*#__PURE__*/ _jsxDEV("div", { 4 │ return /*#__PURE__*/ _jsxDEV("div", {
╰──── ╰────
...@@ -202,10 +201,10 @@ describe('ReactRefreshLogBox', () => { ...@@ -202,10 +201,10 @@ describe('ReactRefreshLogBox', () => {
"label": "Build Error", "label": "Build Error",
"source": "./pages/index.js "source": "./pages/index.js
× Module not found: Can't resolve 'b' in '<FIXME-project-root>/pages' × Module not found: Can't resolve 'b' in '<FIXME-project-root>/pages'
╭─[2:17] ╭─[2:0]
1 │ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime"; 1 │ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2 │ import Comp from 'b'; 2 │ import Comp from 'b';
· ─── · ─────────────────────
3 │ export default function Oops() { 3 │ export default function Oops() {
4 │ return /*#__PURE__*/ _jsxDEV("div", { 4 │ return /*#__PURE__*/ _jsxDEV("div", {
╰──── ╰────
...@@ -277,10 +276,10 @@ describe('ReactRefreshLogBox', () => { ...@@ -277,10 +276,10 @@ describe('ReactRefreshLogBox', () => {
"label": "Build Error", "label": "Build Error",
"source": "./pages/_app.js "source": "./pages/_app.js
× Module not found: Can't resolve './non-existent.css' in '<FIXME-project-root>/pages' × Module not found: Can't resolve './non-existent.css' in '<FIXME-project-root>/pages'
╭─[2:7] ╭─[2:0]
1 │ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime"; 1 │ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2 │ import './non-existent.css'; 2 │ import './non-existent.css';
· ──────────────────── · ────────────────────────────
3 │ export default function App({ Component, pageProps }) { 3 │ export default function App({ Component, pageProps }) {
4 │ return /*#__PURE__*/ _jsxDEV(Component, { 4 │ return /*#__PURE__*/ _jsxDEV(Component, {
╰────", ╰────",
......
...@@ -13,11 +13,10 @@ import { outdent } from 'outdent' ...@@ -13,11 +13,10 @@ import { outdent } from 'outdent'
const isReact18 = parseInt(process.env.NEXT_TEST_REACT_VERSION) === 18 const isReact18 = parseInt(process.env.NEXT_TEST_REACT_VERSION) === 18
describe('ReactRefreshLogBox', () => { describe('ReactRefreshLogBox', () => {
const { isTurbopack, next } = nextTestSetup({ const { isTurbopack, next, isRspack } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
skipStart: true, skipStart: true,
}) })
const isRspack = !!process.env.NEXT_RSPACK
test('should strip whitespace correctly with newline', async () => { test('should strip whitespace correctly with newline', async () => {
await using sandbox = await createSandbox(next) await using sandbox = await createSandbox(next)
......
...@@ -6,10 +6,9 @@ import { outdent } from 'outdent' ...@@ -6,10 +6,9 @@ import { outdent } from 'outdent'
import path from 'path' import path from 'path'
const isReact18 = parseInt(process.env.NEXT_TEST_REACT_VERSION) === 18 const isReact18 = parseInt(process.env.NEXT_TEST_REACT_VERSION) === 18
const isRspack = !!process.env.NEXT_RSPACK
describe('pages/ error recovery', () => { describe('pages/ error recovery', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack, isRspack } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
skipStart: true, skipStart: true,
}) })
......
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
import { outdent } from 'outdent' import { outdent } from 'outdent'
describe('Cache Components Dev Errors', () => { describe('Cache Components Dev Errors', () => {
const { isTurbopack, next } = nextTestSetup({ const { isTurbopack, next, isRspack } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
...@@ -153,6 +153,26 @@ describe('Cache Components Dev Errors', () => { ...@@ -153,6 +153,26 @@ describe('Cache Components Dev Errors', () => {
"stack": [], "stack": [],
} }
`) `)
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": " × Module build failed:",
"environmentLabel": null,
"label": "Build Error",
"source": "./app/page.tsx
× Module build failed:
╰─▶ × Error: x Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it.
│ ,-[1:1]
│ 1 | export const revalidate = 10
│ : ^^^^^^^^^^
│ 2 | export default function Page() {
│ 3 | return (
│ 4 | <div>Hello World</div>
│ \`----
│",
"stack": [],
}
`)
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
......
...@@ -3,11 +3,10 @@ import stripAnsi from 'strip-ansi' ...@@ -3,11 +3,10 @@ import stripAnsi from 'strip-ansi'
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
describe('middleware - development errors', () => { describe('middleware - development errors', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack, isRspack } = nextTestSetup({
files: __dirname, files: __dirname,
patchFileDelay: 500, patchFileDelay: 500,
}) })
const isRspack = !!process.env.NEXT_RSPACK
beforeEach(async () => { beforeEach(async () => {
await next.stop() await next.stop()
......
...@@ -10,13 +10,12 @@ import path from 'path' ...@@ -10,13 +10,12 @@ import path from 'path'
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
describe('Client Navigation', () => { describe('Client Navigation', () => {
const { isTurbopack, next } = nextTestSetup({ const { isTurbopack, next, isRspack } = nextTestSetup({
files: path.join(__dirname, 'fixture'), files: path.join(__dirname, 'fixture'),
env: { env: {
TEST_STRICT_NEXT_HEAD: String(true), TEST_STRICT_NEXT_HEAD: String(true),
}, },
}) })
const isRspack = !!process.env.NEXT_RSPACK
describe('with empty getInitialProps()', () => { describe('with empty getInitialProps()', () => {
it('should render a redbox', async () => { it('should render a redbox', async () => {
......
...@@ -11,13 +11,12 @@ import url from 'url' ...@@ -11,13 +11,12 @@ import url from 'url'
const isReact18 = parseInt(process.env.NEXT_TEST_REACT_VERSION) === 18 const isReact18 = parseInt(process.env.NEXT_TEST_REACT_VERSION) === 18
describe('Client Navigation rendering', () => { describe('Client Navigation rendering', () => {
const { isTurbopack, next } = nextTestSetup({ const { isTurbopack, next, isRspack } = nextTestSetup({
files: path.join(__dirname, 'fixture'), files: path.join(__dirname, 'fixture'),
env: { env: {
TEST_STRICT_NEXT_HEAD: String(true), TEST_STRICT_NEXT_HEAD: String(true),
}, },
}) })
const isRspack = !!process.env.NEXT_RSPACK
function render( function render(
pathname: Parameters<typeof renderViaHTTP>[1], pathname: Parameters<typeof renderViaHTTP>[1],
......
...@@ -3,12 +3,11 @@ import { waitForNoErrorToast } from 'next-test-utils' ...@@ -3,12 +3,11 @@ import { waitForNoErrorToast } from 'next-test-utils'
import { getPrerenderOutput } from './utils' import { getPrerenderOutput } from './utils'
describe('Cache Components Errors', () => { describe('Cache Components Errors', () => {
const { next, isTurbopack, isNextStart, skipped } = nextTestSetup({ const { next, isTurbopack, isNextStart, skipped, isRspack } = nextTestSetup({
files: __dirname + '/fixtures/default', files: __dirname + '/fixtures/default',
skipStart: !isNextDev, skipStart: !isNextDev,
skipDeployment: true, skipDeployment: true,
}) })
const isRspack = !!process.env.NEXT_RSPACK
if (skipped) { if (skipped) {
return return
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
describe('metadata-invalid-image-file', () => { describe('metadata-invalid-image-file', () => {
const { next, isTurbopack, isNextDev, skipped } = nextTestSetup({ const { next, isTurbopack, isNextDev, skipped, isRspack } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true, skipDeployment: true,
skipStart: true, skipStart: true,
}) })
const isRspack = !!process.env.NEXT_RSPACK
if (skipped) return if (skipped) return
......
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
import * as path from 'path' import * as path from 'path'
describe('non-root-project-monorepo', () => { describe('non-root-project-monorepo', () => {
const { next, skipped, isTurbopack, isNextDev } = nextTestSetup({ const { next, skipped, isTurbopack, isNextDev, isRspack } = nextTestSetup({
files: { files: {
apps: new FileRef(path.resolve(__dirname, 'apps')), apps: new FileRef(path.resolve(__dirname, 'apps')),
packages: new FileRef(path.resolve(__dirname, 'packages')), packages: new FileRef(path.resolve(__dirname, 'packages')),
...@@ -23,7 +23,6 @@ describe('non-root-project-monorepo', () => { ...@@ -23,7 +23,6 @@ describe('non-root-project-monorepo', () => {
installCommand: 'pnpm i', installCommand: 'pnpm i',
skipDeployment: true, skipDeployment: true,
}) })
const isRspack = !!process.env.NEXT_RSPACK
if (skipped) { if (skipped) {
return return
......
...@@ -19,14 +19,13 @@ describe('app-dir - server source maps', () => { ...@@ -19,14 +19,13 @@ describe('app-dir - server source maps', () => {
'internal-pkg': `link:./internal-pkg`, 'internal-pkg': `link:./internal-pkg`,
'external-pkg': `file:./external-pkg`, 'external-pkg': `file:./external-pkg`,
} }
const { skipped, next, isNextDev, isTurbopack } = nextTestSetup({ const { skipped, next, isNextDev, isTurbopack, isRspack } = nextTestSetup({
dependencies, dependencies,
files: path.join(__dirname, 'fixtures/default'), files: path.join(__dirname, 'fixtures/default'),
// Deploy tests don't have access to runtime logs. // Deploy tests don't have access to runtime logs.
// Manually verify that the runtime logs match. // Manually verify that the runtime logs match.
skipDeployment: true, skipDeployment: true,
}) })
const isRspack = !!process.env.NEXT_RSPACK
if (skipped) return if (skipped) return
......
...@@ -3,14 +3,12 @@ import { waitForRedbox } from 'next-test-utils' ...@@ -3,14 +3,12 @@ import { waitForRedbox } from 'next-test-utils'
import stripAnsi from 'strip-ansi' import stripAnsi from 'strip-ansi'
describe('use-cache-segment-configs', () => { describe('use-cache-segment-configs', () => {
const { next, skipped, isNextDev, isTurbopack } = nextTestSetup({ const { next, skipped, isNextDev, isTurbopack, isRspack } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: process.env.NEXT_TEST_MODE !== 'dev', skipStart: process.env.NEXT_TEST_MODE !== 'dev',
skipDeployment: true, skipDeployment: true,
}) })
const isRspack = !!process.env.NEXT_RSPACK
if (skipped) { if (skipped) {
return return
} }
......
...@@ -9,10 +9,8 @@ import { ...@@ -9,10 +9,8 @@ import {
import stripAnsi from 'strip-ansi' import stripAnsi from 'strip-ansi'
import { createSandbox } from 'development-sandbox' import { createSandbox } from 'development-sandbox'
const isRspack = !!process.env.NEXT_RSPACK
describe('use-cache-unknown-cache-kind', () => { describe('use-cache-unknown-cache-kind', () => {
const { next, isNextStart, isTurbopack, skipped } = nextTestSetup({ const { next, isNextStart, isTurbopack, isRspack, skipped } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: process.env.NEXT_TEST_MODE !== 'dev', skipStart: process.env.NEXT_TEST_MODE !== 'dev',
skipDeployment: true, skipDeployment: true,
......
...@@ -13,10 +13,8 @@ const nextConfigWithUseCache: NextConfig = { ...@@ -13,10 +13,8 @@ const nextConfigWithUseCache: NextConfig = {
experimental: { useCache: true }, experimental: { useCache: true },
} }
const isRspack = !!process.env.NEXT_RSPACK
describe('use-cache-without-experimental-flag', () => { describe('use-cache-without-experimental-flag', () => {
const { next, isNextStart, isTurbopack, skipped } = nextTestSetup({ const { next, isNextStart, isTurbopack, skipped, isRspack } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: process.env.NEXT_TEST_MODE !== 'dev', skipStart: process.env.NEXT_TEST_MODE !== 'dev',
skipDeployment: true, skipDeployment: true,
......
...@@ -6,12 +6,10 @@ const cacheComponentsEnabled = process.env.__NEXT_CACHE_COMPONENTS === 'true' ...@@ -6,12 +6,10 @@ const cacheComponentsEnabled = process.env.__NEXT_CACHE_COMPONENTS === 'true'
const pprEnabled = process.env.__NEXT_EXPERIMENTAL_PPR === 'true' const pprEnabled = process.env.__NEXT_EXPERIMENTAL_PPR === 'true'
const isRspack = !!process.env.NEXT_RSPACK
describe('build-output-prerender', () => { describe('build-output-prerender', () => {
describe('with a next config file', () => { describe('with a next config file', () => {
describe('without --debug-prerender', () => { describe('without --debug-prerender', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack, isRspack } = nextTestSetup({
files: path.join(__dirname, 'fixtures/with-config-file'), files: path.join(__dirname, 'fixtures/with-config-file'),
skipStart: true, skipStart: true,
}) })
...@@ -97,7 +95,7 @@ describe('build-output-prerender', () => { ...@@ -97,7 +95,7 @@ describe('build-output-prerender', () => {
}) })
describe('with --debug-prerender', () => { describe('with --debug-prerender', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack, isRspack } = nextTestSetup({
files: path.join(__dirname, 'fixtures/with-config-file'), files: path.join(__dirname, 'fixtures/with-config-file'),
skipStart: true, skipStart: true,
buildArgs: ['--debug-prerender'], buildArgs: ['--debug-prerender'],
...@@ -215,7 +213,7 @@ describe('build-output-prerender', () => { ...@@ -215,7 +213,7 @@ describe('build-output-prerender', () => {
describe('without a next config file', () => { describe('without a next config file', () => {
describe('without --debug-prerender', () => { describe('without --debug-prerender', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack, isRspack } = nextTestSetup({
files: path.join(__dirname, 'fixtures/without-config-file'), files: path.join(__dirname, 'fixtures/without-config-file'),
skipStart: true, skipStart: true,
}) })
...@@ -270,7 +268,7 @@ describe('build-output-prerender', () => { ...@@ -270,7 +268,7 @@ describe('build-output-prerender', () => {
}) })
describe('with --debug-prerender', () => { describe('with --debug-prerender', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack, isRspack } = nextTestSetup({
files: path.join(__dirname, 'fixtures/without-config-file'), files: path.join(__dirname, 'fixtures/without-config-file'),
skipStart: true, skipStart: true,
buildArgs: ['--debug-prerender'], buildArgs: ['--debug-prerender'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment