Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/canary' into wbinnssmith/rspack-…
Browse files Browse the repository at this point in the history
…canary-gate
  • Loading branch information
wbinnssmith committed Feb 28, 2025
2 parents 3e0763d + 24b8756 commit 2612b05
Show file tree
Hide file tree
Showing 235 changed files with 22,570 additions and 21,483 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@ jobs:
strategy:
fail-fast: false
matrix:
exclude:
# Excluding React 18 tests unless on `canary` branch until budget is approved.
- react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }}
group: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6]
# Empty value uses default
# TODO: Run with React 18.
# Integration tests use the installed React version in next/package.json.include:
# We can't easily switch like we do for e2e tests.
# Skipping this dimensions until we can figure out a way to test multiple React versions.
react: ['']
uses: ./.github/workflows/build_reusable.yml
with:
Expand Down Expand Up @@ -545,9 +546,9 @@ jobs:
- 11/13
- 12/13
- 13/13
# Empty value uses default
# TODO: Run with React 18.
# Integration tests use the installed React version in next/package.json.include:
# Empty value uses default
# TODO: Run with React 18.
# Integration tests use the installed React version in next/package.json.include:
# We can't easily switch like we do for e2e tests.
# Skipping this dimensions until we can figure out a way to test multiple React versions.
react: ['']
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/integration_tests_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,13 @@ jobs:
fail-fast: false
matrix:
group: ${{ fromJSON(needs.generate-matrices.outputs.e2e) }}
# Empty value uses default
react: ['', '18.3.1']
uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: |
# e2e and ${{ inputs.test_type }} tests with `node run-tests.js`
export NEXT_TEST_CONTINUE_ON_ERROR=TRUE
export NEXT_E2E_TEST_TIMEOUT=240000
export NEXT_TEST_REACT_VERSION=${{ matrix.react }}
export NEXT_TEST_MODE=${{
inputs.test_type == 'development' && 'dev' || 'start'
}}
Expand All @@ -122,8 +119,6 @@ jobs:
fail-fast: false
matrix:
group: ${{ fromJSON(needs.generate-matrices.outputs.integration) }}
# Empty value uses default
react: ['', '18.3.1']
uses: ./.github/workflows/build_reusable.yml
with:
nodeVersion: 18.18.2
Expand All @@ -132,7 +127,6 @@ jobs:
export NEXT_TEST_CONTINUE_ON_ERROR=TRUE
export NEXT_E2E_TEST_TIMEOUT=240000
export NEXT_TEST_REACT_VERSION=${{ matrix.react }}
# HACK: Despite the name, these environment variables are just used to
# gate tests, so they're applicable to both turbopack and rspack tests
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/rspack-update-tests-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
BRANCH_NAME: rspack-manifest
SCRIPT: test/build-rspack-dev-tests-manifest.js
# We need to use `--override` for rspack (but not for turbopack).
# We don't currently have any CI running on every PR, so it's quite
# possible for us to regress on tests. We need to skip the
# only-promote-to-passing merge logic.
SCRIPT: test/update_build_manifest.js --bundler rspack --testSuite dev --override
PR_TITLE: Update bundler development test manifest
PR_BODY: This auto-generated PR updates the development integration test manifest used when testing alternative bundlers.
update_build_manifest:
Expand Down Expand Up @@ -77,6 +81,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
BRANCH_NAME: rspack-manifest
SCRIPT: test/build-rspack-build-tests-manifest.js
SCRIPT: test/update_build_manifest.js --bundler rspack --testSuite build --override
PR_TITLE: Update bundler production test manifest
PR_BODY: This auto-generated PR updates the production integration test manifest used when testing alternative bundlers.
4 changes: 2 additions & 2 deletions .github/workflows/turbopack-update-tests-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
BRANCH_NAME: turbopack-manifest
SCRIPT: test/build-turbopack-dev-tests-manifest.js
SCRIPT: test/update_build_manifest.js --bundler turbopack --testSuite dev
PR_TITLE: Update Turbopack development test manifest
PR_BODY: This auto-generated PR updates the development integration test manifest used when testing Turbopack.
update_build_manifest:
Expand Down Expand Up @@ -77,6 +77,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
BRANCH_NAME: turbopack-manifest
SCRIPT: test/build-turbopack-build-tests-manifest.js
SCRIPT: test/update_build_manifest.js --bundler turbopack --testSuite build
PR_TITLE: Update Turbopack production test manifest
PR_BODY: This auto-generated PR updates the production integration test manifest used when testing Turbopack.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"packages/next/src/server/app-render/after-task-async-storage-instance.ts",
"packages/next/src/server/app-render/clean-async-snapshot-instance.ts",
"packages/next/src/server/app-render/work-async-storage-instance.ts",
"packages/next/src/server/app-render/work-unit-async-storage-instance.ts"
"packages/next/src/server/app-render/work-unit-async-storage-instance.ts",
"packages/next/src/client/components/segment-cache-impl/*"
],
// Disable TypeScript surveys.
"typescript.surveys.enabled": false,
Expand Down
13 changes: 6 additions & 7 deletions crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ impl AppEndpoint {
let mut server_assets = fxindexset![];
let mut client_assets = fxindexset![];
// assets to add to the middleware manifest (to be loaded in the edge runtime).
let mut middleware_assets = vec![];
let mut middleware_assets = fxindexset![];

let runtime = app_entry.config.await?.runtime.unwrap_or_default();

Expand Down Expand Up @@ -1314,7 +1314,6 @@ impl AppEndpoint {
.values()
{
let ssr_chunks = ssr_chunks.await?;

middleware_assets.extend(ssr_chunks);
}
}
Expand Down Expand Up @@ -1387,7 +1386,7 @@ impl AppEndpoint {
.await?;
server_assets.insert(entry_manifest);
if runtime == NextRuntime::Edge {
middleware_assets.push(entry_manifest);
middleware_assets.insert(entry_manifest);
}
client_reference_manifest = Some(entry_manifest);

Expand All @@ -1411,13 +1410,13 @@ impl AppEndpoint {
// global variables defined in these files
//
// they are created in `setup-dev-bundler.ts`
let mut file_paths_from_root = vec![
let mut file_paths_from_root = fxindexset![
"server/server-reference-manifest.js".into(),
"server/middleware-build-manifest.js".into(),
"server/next-font-manifest.js".into(),
"server/interception-route-rewrite-manifest.js".into(),
];
let mut wasm_paths_from_root = vec![];
let mut wasm_paths_from_root = fxindexset![];

let node_root_value = node_root.await?;

Expand Down Expand Up @@ -1476,8 +1475,8 @@ impl AppEndpoint {
..Default::default()
};
let edge_function_definition = EdgeFunctionDefinition {
files: file_paths_from_root,
wasm: wasm_paths_to_bindings(wasm_paths_from_root),
files: file_paths_from_root.into_iter().collect(),
wasm: wasm_paths_to_bindings(wasm_paths_from_root.into_iter().collect()),
assets: paths_to_bindings(all_assets),
name: app_entry.pathname.clone(),
page: app_entry.original_name.clone(),
Expand Down
12 changes: 6 additions & 6 deletions crates/next-api/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ pub async fn all_paths_in_root(

pub(crate) async fn get_paths_from_root(
root: &FileSystemPath,
output_assets: &[ResolvedVc<Box<dyn OutputAsset>>],
output_assets: impl IntoIterator<Item = &ResolvedVc<Box<dyn OutputAsset>>>,
filter: impl FnOnce(&str) -> bool + Copy,
) -> Result<Vec<RcStr>> {
output_assets
.iter()
.into_iter()
.map(move |&file| async move {
let path = &*file.path().await?;
let Some(relative) = root.get_path_to(path) else {
Expand All @@ -101,21 +101,21 @@ pub(crate) async fn get_paths_from_root(

pub(crate) async fn get_js_paths_from_root(
root: &FileSystemPath,
output_assets: &[ResolvedVc<Box<dyn OutputAsset>>],
output_assets: impl IntoIterator<Item = &ResolvedVc<Box<dyn OutputAsset>>>,
) -> Result<Vec<RcStr>> {
get_paths_from_root(root, output_assets, |path| path.ends_with(".js")).await
}

pub(crate) async fn get_wasm_paths_from_root(
root: &FileSystemPath,
output_assets: &[ResolvedVc<Box<dyn OutputAsset>>],
output_assets: impl IntoIterator<Item = &ResolvedVc<Box<dyn OutputAsset>>>,
) -> Result<Vec<RcStr>> {
get_paths_from_root(root, output_assets, |path| path.ends_with(".wasm")).await
}

pub(crate) async fn get_asset_paths_from_root(
root: &FileSystemPath,
output_assets: &[ResolvedVc<Box<dyn OutputAsset>>],
output_assets: impl IntoIterator<Item = &ResolvedVc<Box<dyn OutputAsset>>>,
) -> Result<Vec<RcStr>> {
get_paths_from_root(root, output_assets, |path| {
!path.ends_with(".js") && !path.ends_with(".map") && !path.ends_with(".wasm")
Expand All @@ -125,7 +125,7 @@ pub(crate) async fn get_asset_paths_from_root(

pub(crate) async fn get_font_paths_from_root(
root: &FileSystemPath,
output_assets: &[ResolvedVc<Box<dyn OutputAsset>>],
output_assets: impl IntoIterator<Item = &ResolvedVc<Box<dyn OutputAsset>>>,
) -> Result<Vec<RcStr>> {
get_paths_from_root(root, output_assets, |path| {
path.ends_with(".woff")
Expand Down
11 changes: 9 additions & 2 deletions crates/next-core/src/app_page_loader_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,18 @@ impl AppPageLoaderTreeBuilder {
return Ok(());
};

let manifest_route = &format!("/{}", get_metadata_route_name(manifest).await?);
let metadata_manifest_route = get_metadata_route_name(manifest).await?;
// prefix with base_path if it exists
let manifest_route = if let Some(base_path) = &self.base_path {
format!("{}/{}", base_path, metadata_manifest_route)
} else {
metadata_manifest_route.to_string()
};

writeln!(
self.loader_tree_code,
" manifest: {},",
StringifyJs(manifest_route)
StringifyJs(&manifest_route)
)?;

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "15.2.1-canary.1"
"version": "15.2.1-canary.3"
}
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": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"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": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,7 +10,7 @@
},
"homepage": "https://nextjs.org/docs/app/api-reference/config/eslint",
"dependencies": {
"@next/eslint-plugin-next": "15.2.1-canary.1",
"@next/eslint-plugin-next": "15.2.1-canary.3",
"@rushstack/eslint-patch": "^1.10.3",
"@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
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": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"license": "MIT",
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": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"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": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"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": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"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": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"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": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-rspack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-rspack",
"version": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-rspack"
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": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"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": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"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": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"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-swc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "15.2.1-canary.1",
"version": "15.2.1-canary.3",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
Expand Down
10 changes: 9 additions & 1 deletion packages/next/errors.json
Original file line number Diff line number Diff line change
Expand Up @@ -650,5 +650,13 @@
"649": "Cache handlers not initialized",
"650": "experimental.nodeMiddleware",
"651": "Unexpected module type %s",
"652": "Rspack support is only available in Next.js canary."
"652": "Expected cached value for cache key %s not to be a %s kind, got \"FETCH\" instead.",
"653": "Expected cached value for cache key %s to be a \"FETCH\" kind, got %s instead.",
"654": "Segment Cache experiment is not enabled. This is a bug in Next.js.",
"655": "If providing both the stale and expire options, the expire option must be greater than the stale option. The expire option indicates how many seconds from the start until it can no longer be used.",
"656": "If providing both the revalidate and expire options, the expire option must be greater than the revalidate option. The expire option indicates how many seconds from the start until it can no longer be used.",
"657": "revalidate must be a number for image-cache",
"658": "Pass `Infinity` instead of `false` if you want to cache on the server forever without checking with the origin.",
"659": "SSG should not return an image cache value",
"660": "Rspack support is only available in Next.js canary."
}
Loading

0 comments on commit 2612b05

Please sign in to comment.