Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bench/module-cost/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"devDependencies": {
"rimraf": "6.0.1",
"next": "workspace:*",
"playwright": "^1.40.0"
"playwright": "1.58.2"
}
}
4 changes: 2 additions & 2 deletions crates/next-api/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ pub struct ProjectOptions {
/// The version of Next.js that is running.
pub next_version: RcStr,

/// Whether server-side HMR is enabled (--experimental-server-fast-refresh).
/// Whether server-side HMR is enabled (disabled with --no-server-fast-refresh).
pub server_hmr: bool,
}

Expand Down Expand Up @@ -960,7 +960,7 @@ pub struct Project {
/// Whether to enable persistent caching
is_persistent_caching_enabled: bool,

/// Whether server-side HMR is enabled (--experimental-server-fast-refresh).
/// Whether server-side HMR is enabled (disabled with --no-server-fast-refresh).
server_hmr: bool,
}

Expand Down
14 changes: 13 additions & 1 deletion crates/next-core/src/next_import_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,16 @@ pub async fn get_next_client_import_map(
.await?;

match &ty {
ClientContextType::Pages { .. } => {}
ClientContextType::Pages { .. } => {
// Resolve next/error to the ESM entry point so the bundler can
// tree-shake the error-boundary dependency chain from Pages
// Router bundles that only use the default Error component.
insert_exact_alias_or_js(
&mut import_map,
rcstr!("next/error"),
request_to_import_mapping(project_path.clone(), rcstr!("next/dist/api/error")),
);
}
ClientContextType::App { app_dir } => {
// Keep in sync with file:///./../../../packages/next/src/lib/needs-experimental-react.ts
let taint = *next_config.enable_taint().await?;
Expand Down Expand Up @@ -404,6 +413,7 @@ pub async fn get_next_edge_import_map(
rcstr!("next/app") => rcstr!("next/dist/api/app"),
rcstr!("next/document") => rcstr!("next/dist/api/document"),
rcstr!("next/dynamic") => rcstr!("next/dist/api/dynamic"),
rcstr!("next/error") => rcstr!("next/dist/api/error"),
rcstr!("next/form") => rcstr!("next/dist/api/form"),
rcstr!("next/head") => rcstr!("next/dist/api/head"),
rcstr!("next/headers") => rcstr!("next/dist/api/headers"),
Expand Down Expand Up @@ -953,6 +963,7 @@ async fn apply_vendored_react_aliases_server(
if react_condition == "server" {
// This is used in the server runtime to import React Server Components.
alias.extend(fxindexmap! {
rcstr!("next/error") => rcstr!("next/dist/api/error.react-server"),
rcstr!("next/navigation") => rcstr!("next/dist/api/navigation.react-server"),
rcstr!("next/link") => rcstr!("next/dist/client/app-dir/link.react-server"),
});
Expand Down Expand Up @@ -983,6 +994,7 @@ async fn rsc_aliases(
if ty.should_use_react_server_condition() {
// This is used in the server runtime to import React Server Components.
alias.extend(fxindexmap! {
rcstr!("next/error") => rcstr!("next/dist/api/error.react-server"),
rcstr!("next/navigation") => rcstr!("next/dist/api/navigation.react-server"),
rcstr!("next/link") => rcstr!("next/dist/client/app-dir/link.react-server"),
});
Expand Down
2 changes: 1 addition & 1 deletion crates/next-core/src/pages_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ async fn get_pages_structure_for_root_directory(
PagesStructureItem::new(
pages_path.join("_error")?,
page_extensions,
Some(next_package.join("error.js")?),
Some(next_package.join("dist/pages/_error.js")?),
error_router_path.clone(),
error_router_path,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ impl ReactServerComponentValidator {
"useFormState",
],
),
(atom!("next/error").into(), vec!["unstable_catchError"]),
(
atom!("next/navigation").into(),
vec![
Expand Down
2 changes: 1 addition & 1 deletion crates/next-napi-bindings/src/next_api/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pub struct NapiProjectOptions {
/// The version of Next.js that is running.
pub next_version: RcStr,

/// Whether server-side HMR is enabled (--experimental-server-fast-refresh).
/// Whether server-side HMR is enabled (disabled with --no-server-fast-refresh).
pub server_hmr: Option<bool>,
}

Expand Down
15 changes: 11 additions & 4 deletions crates/next-napi-bindings/src/next_api/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ pub fn root_task_dispose(
Ok(())
}

/// [Peeks] at the [`Issue`] held by the given source and returns it as a [`PlainDiagnostic`].
/// It does not [consume] any [`Issue`]s held by the source.
///
/// [Peeks]: turbo_tasks::CollectiblesSource::peek_collectibles
/// [`Issue`]: turbopack_core::issue::Issue
/// [consume]: turbo_tasks::CollectiblesSource::take_collectibles
pub async fn get_issues<T: Send>(
source: OperationVc<T>,
filter: Vc<IssueFilter>,
Expand All @@ -107,10 +113,11 @@ pub async fn get_issues<T: Send>(
))
}

/// Reads the [turbopack_core::diagnostics::Diagnostic] held
/// by the given source and returns it as a
/// [turbopack_core::diagnostics::PlainDiagnostic]. It does
/// not consume any Diagnostics held by the source.
/// [Peeks] at the [`Diagnostic`]s held by the given source and returns it as a [`PlainDiagnostic`].
/// It does not [consume] any [`Diagnostic`]s held by the source.
///
/// [Peeks]: turbo_tasks::CollectiblesSource::peek_collectibles
/// [consume]: turbo_tasks::CollectiblesSource::take_collectibles
pub async fn get_diagnostics<T: Send>(
source: OperationVc<T>,
) -> Result<Arc<Vec<ReadRef<PlainDiagnostic>>>> {
Expand Down
11 changes: 7 additions & 4 deletions crates/next-taskless/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ pub const NODE_EXTERNALS: [&str; 68] = [
"zlib",
];

/// List of node.js internals that are supported by edge runtime.
/// If anything Node.js builtin module apart from these these imports are
/// used and user does not provide alias for the polyfill, a runtime error will be thrown.
/// See https://vercel.com/docs/functions/runtimes/edge-runtime#compatible-node.js-modules
/// The Node.js built-in modules that are supported by edge runtime.
///
/// If any Node.js builtin module apart from these these imports are used and the user does not
/// provide an alias for it (i.e. a polyfill), a runtime error will be thrown.
///
/// See <https://vercel.com/docs/functions/runtimes/edge-runtime#compatible-node.js-modules>
//
// SAFETY: This has to be sorted alphabetically since we are doing binary search on it
pub const EDGE_NODE_EXTERNALS: [&str; 7] = [
"assert",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "16.2.0-canary.100"
"version": "16.2.0-canary.101"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@
"octokit": "3.1.0",
"outdent": "0.8.0",
"pixrem": "5.0.0",
"playwright": "1.48.0",
"playwright-chromium": "1.48.0",
"playwright": "1.58.2",
"playwright-chromium": "1.58.2",
"postcss": "8.4.31",
"postcss-nested": "4.2.1",
"postcss-pseudoelements": "5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"description": "ESLint configuration used by Next.js.",
"license": "MIT",
"repository": {
Expand All @@ -12,7 +12,7 @@
"dist"
],
"dependencies": {
"@next/eslint-plugin-next": "16.2.0-canary.100",
"@next/eslint-plugin-next": "16.2.0-canary.101",
"eslint-import-resolver-node": "^0.3.6",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.32.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-internal/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@next/eslint-plugin-internal",
"private": true,
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"description": "ESLint plugin for working on Next.js.",
"exports": {
".": "./src/eslint-plugin-internal.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@next/font",
"private": true,
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion packages/next-playwright/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/playwright",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-playwright"
Expand All @@ -26,6 +26,7 @@
}
},
"devDependencies": {
"@playwright/test": "1.58.2",
"typescript": "5.9.2"
}
}
13 changes: 8 additions & 5 deletions packages/next-playwright/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ export async function instant<T>(
// navigation-testing-lock.ts, which acquires the in-memory navigation lock.
const { hostname } = new URL(resolveURL(page, options))
await step('Acquire Instant Lock', () =>
page
.context()
.addCookies([
{ name: INSTANT_COOKIE, value: '[0]', domain: hostname, path: '/' },
])
page.context().addCookies([
{
name: INSTANT_COOKIE,
value: JSON.stringify([0, `p${Math.random()}`]),
domain: hostname,
path: '/',
},
])
)
try {
return await fn()
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-routing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/routing",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-rspack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-rspack",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-rspack"
Expand Down
5 changes: 3 additions & 2 deletions packages/next-swc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "16.2.0-canary.100",
"version": "16.2.0-canary.101",
"private": true,
"files": [
"native/"
Expand All @@ -16,8 +16,9 @@
"build-native-wasi": "npx --package=@napi-rs/cli@3.0.0-alpha.45 napi build --platform --target wasm32-wasip1-threads -p next-napi-bindings --cwd ../../ --output-dir packages/next-swc/native --no-default-features",
"build-wasm": "wasm-pack build ../../crates/wasm --scope=next",
"cache-build-native": "[ -d native ] && echo $(ls native)",
"rust-check-fmt": "cd ../..; cargo fmt -- --check",
"rust-check-clippy": "cargo clippy --workspace --all-targets -- -D warnings -A deprecated",
"rust-check-doc": "RUSTDOCFLAGS='-Zunstable-options --output-format=json' cargo doc --no-deps --workspace",
"rust-check-fmt": "cd ../..; cargo fmt -- --check",
"rust-check-napi": "cargo check -p next-napi-bindings",
"test-cargo-unit": "cargo nextest run --workspace --exclude next-napi-bindings --exclude turbo-tasks-macros --cargo-profile release-with-assertions-no-lto --no-fail-fast"
},
Expand Down
24 changes: 20 additions & 4 deletions packages/next-swc/turbo.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,14 @@
"outputs": ["native/*.node", "native/index.d.ts"],
},
"rust-check": {
"dependsOn": ["rust-check-fmt", "rust-check-clippy", "rust-check-napi"],
"dependsOn": [
"rust-check-clippy",
"rust-check-doc",
"rust-check-fmt",
"rust-check-napi",
],
},
"rust-check-fmt": {
"rust-check-clippy": {
"inputs": [
"../../.cargo/**",
"../../crates/**",
Expand All @@ -148,9 +153,8 @@
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain.toml",
],
"cache": false,
},
"rust-check-clippy": {
"rust-check-doc": {
"inputs": [
"../../.cargo/**",
"../../crates/**",
Expand All @@ -161,6 +165,18 @@
"../../rust-toolchain.toml",
],
},
"rust-check-fmt": {
"inputs": [
"../../.cargo/**",
"../../crates/**",
"../../turbopack/crates/**",
"../../**/Cargo.toml",
"../../**/Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain.toml",
],
"cache": false,
},
"rust-check-napi": {
"inputs": [
"../../.cargo/**",
Expand Down
4 changes: 2 additions & 2 deletions packages/next/error.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import Error from './dist/pages/_error'
export * from './dist/pages/_error'
import Error from './dist/api/error'
export * from './dist/api/error'
export default Error
Loading
Loading