Skip to content

Commit 96b5aae

Browse files
committed
Merge remote-tracking branch 'origin/canary' into wbinnssmith/write-all-endpoints
2 parents 313f5b7 + 7a0eb3c commit 96b5aae

File tree

39 files changed

+443
-381
lines changed

39 files changed

+443
-381
lines changed

.github/workflows/build_and_deploy.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ jobs:
231231
rustup show &&
232232
rustup target add x86_64-unknown-linux-musl &&
233233
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" &&
234-
export RUSTFLAGS="--cfg tokio_unstable -Zshare-generics=y -Zthreads=8 -Csymbol-mangling-version=v0 -Ctarget-feature=-crt-static" &&
234+
export RUSTFLAGS='--cfg tokio_unstable -Zshare-generics=y -Zthreads=8 -Csymbol-mangling-version=v0 -Ctarget-feature=-crt-static' &&
235235
cd packages/next-swc && npm run build-native-release -- --target x86_64-unknown-linux-musl &&
236236
strip native/next-swc.*.node
237237
@@ -273,7 +273,7 @@ jobs:
273273
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" &&
274274
rustup show &&
275275
rustup target add aarch64-unknown-linux-musl &&
276-
export RUSTFLAGS="--cfg tokio_unstable -Zshare-generics=y -Zthreads=8 -Zunstable-options -Csymbol-mangling-version=v0 -Clinker-flavor=gnu-lld-cc -Clink-self-contained=+linker" &&
276+
export RUSTFLAGS='--cfg tokio_unstable -Zshare-generics=y -Zthreads=8 -Zunstable-options -Csymbol-mangling-version=v0 -Clinker-flavor=gnu-lld-cc -Clink-self-contained=+linker' &&
277277
cd packages/next-swc && npm run build-native-release -- --target aarch64-unknown-linux-musl &&
278278
llvm-strip -x native/next-swc.*.node
279279

.github/workflows/build_reusable.yml

+1
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ jobs:
247247
path: |
248248
test/test-junit-report
249249
test/turbopack-test-junit-report
250+
test/rspack-test-junit-report
250251
if-no-files-found: ignore
251252

252253
# upload playwright snapshots from failed tests

Cargo.lock

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/napi/src/next_api/project.rs

+16-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{path::PathBuf, sync::Arc, thread, time::Duration};
1+
use std::{io::Write, path::PathBuf, sync::Arc, thread, time::Duration};
22

33
use anyhow::{anyhow, bail, Context, Result};
44
use napi::{
@@ -387,27 +387,21 @@ pub async fn project_new(
387387
memory_limit,
388388
dependency_tracking,
389389
)?;
390-
if !persistent_caching {
391-
use std::io::Write;
392-
let stats_path = std::env::var_os("NEXT_TURBOPACK_TASK_STATISTICS");
393-
if let Some(stats_path) = stats_path {
394-
let Some(backend) = turbo_tasks.memory_backend() else {
395-
return Err(anyhow!("task statistics require a memory backend").into());
396-
};
397-
let task_stats = backend.task_statistics().enable().clone();
398-
exit.on_exit(async move {
399-
tokio::task::spawn_blocking(move || {
400-
let mut file = std::fs::File::create(&stats_path)
401-
.with_context(|| format!("failed to create or open {stats_path:?}"))?;
402-
serde_json::to_writer(&file, &task_stats)
403-
.context("failed to serialize or write task statistics")?;
404-
file.flush().context("failed to flush file")
405-
})
406-
.await
407-
.unwrap()
408-
.unwrap();
409-
});
410-
}
390+
let stats_path = std::env::var_os("NEXT_TURBOPACK_TASK_STATISTICS");
391+
if let Some(stats_path) = stats_path {
392+
let task_stats = turbo_tasks.task_statistics().enable().clone();
393+
exit.on_exit(async move {
394+
tokio::task::spawn_blocking(move || {
395+
let mut file = std::fs::File::create(&stats_path)
396+
.with_context(|| format!("failed to create or open {stats_path:?}"))?;
397+
serde_json::to_writer(&file, &task_stats)
398+
.context("failed to serialize or write task statistics")?;
399+
file.flush().context("failed to flush file")
400+
})
401+
.await
402+
.unwrap()
403+
.unwrap();
404+
});
411405
}
412406
let options: ProjectOptions = options.into();
413407
let container = turbo_tasks

crates/napi/src/next_api/utils.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use napi::{
1010
};
1111
use serde::Serialize;
1212
use turbo_tasks::{
13-
get_effects, trace::TraceRawVcs, Effects, OperationVc, ReadRef, TaskId, TryJoinIterExt,
14-
TurboTasks, UpdateInfo, Vc, VcValueType,
13+
get_effects, task_statistics::TaskStatisticsApi, trace::TraceRawVcs, Effects, OperationVc,
14+
ReadRef, TaskId, TryJoinIterExt, TurboTasks, TurboTasksApi, UpdateInfo, Vc, VcValueType,
1515
};
1616
use turbo_tasks_backend::{
1717
default_backing_storage, noop_backing_storage, DefaultBackingStorage, NoopBackingStorage,
@@ -111,17 +111,17 @@ impl NextTurboTasks {
111111
}
112112
}
113113

114-
pub fn memory_backend(&self) -> Option<&turbo_tasks_memory::MemoryBackend> {
114+
pub async fn stop_and_wait(&self) {
115115
match self {
116-
NextTurboTasks::Memory(_) => None,
117-
NextTurboTasks::PersistentCaching(_) => None,
116+
NextTurboTasks::Memory(turbo_tasks) => turbo_tasks.stop_and_wait().await,
117+
NextTurboTasks::PersistentCaching(turbo_tasks) => turbo_tasks.stop_and_wait().await,
118118
}
119119
}
120120

121-
pub async fn stop_and_wait(&self) {
121+
pub fn task_statistics(&self) -> &TaskStatisticsApi {
122122
match self {
123-
NextTurboTasks::Memory(turbo_tasks) => turbo_tasks.stop_and_wait().await,
124-
NextTurboTasks::PersistentCaching(turbo_tasks) => turbo_tasks.stop_and_wait().await,
123+
NextTurboTasks::Memory(turbo_tasks) => turbo_tasks.task_statistics(),
124+
NextTurboTasks::PersistentCaching(turbo_tasks) => turbo_tasks.task_statistics(),
125125
}
126126
}
127127
}

crates/next-core/src/transform_options.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,15 @@ pub async fn get_jsx_transform_options(
126126
) -> Result<Vc<JsxTransformOptions>> {
127127
let tsconfig = get_typescript_options(project_path).await?;
128128

129-
let enable_react_refresh = if let Some(resolve_options_context) = resolve_options_context {
130-
assert_can_resolve_react_refresh(project_path, resolve_options_context)
131-
.await?
132-
.is_found()
129+
let is_react_development = mode.await?.is_react_development();
130+
let enable_react_refresh = if is_react_development {
131+
if let Some(resolve_options_context) = resolve_options_context {
132+
assert_can_resolve_react_refresh(project_path, resolve_options_context)
133+
.await?
134+
.is_found()
135+
} else {
136+
false
137+
}
133138
} else {
134139
false
135140
};

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"registry": "https://registry.npmjs.org/"
1717
}
1818
},
19-
"version": "15.2.0-canary.36"
19+
"version": "15.2.0-canary.37"
2020
}

packages/create-next-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-next-app",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"keywords": [
55
"react",
66
"next",

packages/eslint-config-next/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-next",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"description": "ESLint configuration used by Next.js.",
55
"main": "index.js",
66
"license": "MIT",
@@ -10,7 +10,7 @@
1010
},
1111
"homepage": "https://nextjs.org/docs/app/api-reference/config/eslint",
1212
"dependencies": {
13-
"@next/eslint-plugin-next": "15.2.0-canary.36",
13+
"@next/eslint-plugin-next": "15.2.0-canary.37",
1414
"@rushstack/eslint-patch": "^1.10.3",
1515
"@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
1616
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",

packages/eslint-plugin-next/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/eslint-plugin-next",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"description": "ESLint plugin for Next.js.",
55
"main": "dist/index.js",
66
"license": "MIT",

packages/font/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@next/font",
33
"private": true,
4-
"version": "15.2.0-canary.36",
4+
"version": "15.2.0-canary.37",
55
"repository": {
66
"url": "vercel/next.js",
77
"directory": "packages/font"

packages/next-bundle-analyzer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/bundle-analyzer",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"main": "index.js",
55
"types": "index.d.ts",
66
"license": "MIT",

packages/next-codemod/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/codemod",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"license": "MIT",
55
"repository": {
66
"type": "git",

packages/next-env/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/env",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"keywords": [
55
"react",
66
"next",

packages/next-mdx/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/mdx",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"main": "index.js",
55
"license": "MIT",
66
"repository": {

packages/next-plugin-storybook/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/plugin-storybook",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"repository": {
55
"url": "vercel/next.js",
66
"directory": "packages/next-plugin-storybook"

packages/next-polyfill-module/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/polyfill-module",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
55
"main": "dist/polyfill-module.js",
66
"license": "MIT",

packages/next-polyfill-nomodule/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/polyfill-nomodule",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"description": "A polyfill for non-dead, nomodule browsers.",
55
"main": "dist/polyfill-nomodule.js",
66
"license": "MIT",

packages/next-swc/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/swc",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"private": true,
55
"scripts": {
66
"clean": "node ../../scripts/rm.mjs native",

packages/next/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"description": "The React Framework",
55
"main": "./dist/server/next.js",
66
"license": "MIT",
@@ -100,7 +100,7 @@
100100
]
101101
},
102102
"dependencies": {
103-
"@next/env": "15.2.0-canary.36",
103+
"@next/env": "15.2.0-canary.37",
104104
"@swc/counter": "0.1.3",
105105
"@swc/helpers": "0.5.15",
106106
"busboy": "1.6.0",
@@ -164,11 +164,11 @@
164164
"@jest/types": "29.5.0",
165165
"@mswjs/interceptors": "0.23.0",
166166
"@napi-rs/triples": "1.2.0",
167-
"@next/font": "15.2.0-canary.36",
168-
"@next/polyfill-module": "15.2.0-canary.36",
169-
"@next/polyfill-nomodule": "15.2.0-canary.36",
170-
"@next/react-refresh-utils": "15.2.0-canary.36",
171-
"@next/swc": "15.2.0-canary.36",
167+
"@next/font": "15.2.0-canary.37",
168+
"@next/polyfill-module": "15.2.0-canary.37",
169+
"@next/polyfill-nomodule": "15.2.0-canary.37",
170+
"@next/react-refresh-utils": "15.2.0-canary.37",
171+
"@next/swc": "15.2.0-canary.37",
172172
"@opentelemetry/api": "1.6.0",
173173
"@playwright/test": "1.41.2",
174174
"@storybook/addon-a11y": "8.5.2",

packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/use-error-hook.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@ export function useErrorHook({
110110
? rootLayoutMissingTags.length
111111
: !!buildError
112112
? 1
113-
: errors.length,
113+
: readyErrors.length,
114114
}
115115
}

packages/react-refresh-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/react-refresh-utils",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"description": "An experimental package providing utilities for React Refresh.",
55
"repository": {
66
"url": "vercel/next.js",

packages/third-parties/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/third-parties",
3-
"version": "15.2.0-canary.36",
3+
"version": "15.2.0-canary.37",
44
"repository": {
55
"url": "vercel/next.js",
66
"directory": "packages/third-parties"
@@ -26,7 +26,7 @@
2626
"third-party-capital": "1.0.20"
2727
},
2828
"devDependencies": {
29-
"next": "15.2.0-canary.36",
29+
"next": "15.2.0-canary.37",
3030
"outdent": "0.8.0",
3131
"prettier": "2.5.1",
3232
"typescript": "5.7.2"

pnpm-lock.yaml

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/e2e/app-dir/hello-world/app/global-error.tsx

-13
This file was deleted.

turbopack/crates/turbo-tasks-backend/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ turbo-tasks-testing = { workspace = true }
5454

5555
[dev-dependencies]
5656
criterion = { workspace = true, features = ["async_tokio"] }
57+
regex = { workspace = true }
58+
serde_json = { workspace = true }
5759

5860
[build-dependencies]
5961
turbo-tasks-build = { workspace = true }

0 commit comments

Comments
 (0)