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
11 changes: 10 additions & 1 deletion .github/workflows/release-next-rspack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
required: false
default: false
type: boolean
npm-name:
description: 'NPM package name to publish'
required: false
default: '@next/rspack-core'
type: string
npm-tag:
description: 'NPM tag for publishing'
required: false
Expand Down Expand Up @@ -48,13 +53,13 @@ jobs:
run: |
echo "🚀 Release Configuration:"
echo " - Dry-run mode: ${{ inputs.dry-run }}"
echo " - NPM name: ${{ inputs.npm-name || '@next/rspack-core' }}"
echo " - NPM tag: ${{ inputs.npm-tag || 'latest' }}"
if [ "${{ inputs.dry-run }}" == "true" ]; then
echo " - ⚠️ This is a DRY RUN - no packages will be published"
else
echo " - 📦 This will PUBLISH packages to npm"
fi

- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -66,6 +71,10 @@ jobs:
- name: Setup pnpm
run: corepack prepare

- name: Change npm name
run: pnpm run change-npm-name "${{ inputs.npm-name }}"
working-directory: ./rspack

- name: Cache pnpm dependencies
uses: actions/cache@v3
with:
Expand Down
113 changes: 38 additions & 75 deletions apps/docs/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
import Image from 'next/image'
import Link from 'next/link'

export default function Home() {
return (
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
<main className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
<div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black font-[family-name:var(--font-geist-sans)]">
<main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start">
<Image
className="dark:invert"
src="/next.svg"
alt="Next.js logo"
width={180}
height={38}
width={100}
height={20}
priority
/>
<ol className="list-inside list-decimal text-sm/6 text-center sm:text-left font-[family-name:var(--font-geist-mono)]">
<li className="mb-2 tracking-[-.01em]">
Get started by editing{' '}
<code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-[family-name:var(--font-geist-mono)] font-semibold">
app/page.tsx
</code>
.
</li>
<li className="tracking-[-.01em]">
Save and see your changes instantly.
</li>
</ol>

<div className="flex gap-4 items-center flex-col sm:flex-row">
<div className="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left">
<h1 className="max-w-xs text-3xl font-semibold leading-10 tracking-tight text-black dark:text-zinc-50">
To get started, edit the page.tsx file.
</h1>
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400">
Looking for a starting point or more instructions? Head over to{' '}
<a
href="https://vercel.com/templates?framework=next.js"
className="font-medium text-zinc-950 dark:text-zinc-50"
>
Template
</a>{' '}
or the{' '}
<a
href="https://nextjs.org/learn"
className="font-medium text-zinc-950 dark:text-zinc-50"
>
Learning
</a>{' '}
center.
</p>
</div>
<div className="flex flex-col gap-4 text-base font-medium sm:flex-row">
<a
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] font-medium text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 sm:w-auto"
className="flex h-12 w-full items-center justify-center gap-2 rounded-full bg-foreground px-5 text-background transition-colors hover:bg-[#383838] dark:hover:bg-[#ccc] md:w-[158px]"
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
Expand All @@ -37,66 +45,21 @@ export default function Home() {
className="dark:invert"
src="/vercel.svg"
alt="Vercel logomark"
width={20}
height={20}
width={16}
height={16}
/>
Deploy now
Deploy Now
</a>
<Link
className="rounded-full border border-solid border-black/[.08] dark:border-white/[.145] transition-colors flex items-center justify-center hover:bg-[#f2f2f2] dark:hover:bg-[#1a1a1a] hover:border-transparent font-medium text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 w-full sm:w-auto md:w-[158px]"
href="/docs"
<a
className="flex h-12 w-full items-center justify-center rounded-full border border-solid border-black/[.08] px-5 transition-colors hover:border-transparent hover:bg-black/[.04] dark:border-white/[.145] dark:hover:bg-[#1a1a1a] md:w-[158px]"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Read our docs
</Link>
Documentation
</a>
</div>
</main>
<footer className="row-start-3 flex gap-[24px] flex-wrap items-center justify-center">
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/file.svg"
alt="File icon"
width={16}
height={16}
/>
Learn
</a>
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/window.svg"
alt="Window icon"
width={16}
height={16}
/>
Examples
</a>
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/globe.svg"
alt="Globe icon"
width={16}
height={16}
/>
Go to nextjs.org →
</a>
</footer>
</div>
)
}
66 changes: 30 additions & 36 deletions crates/next-core/src/next_app/metadata/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,26 +291,24 @@ async fn dynamic_sitemap_route_with_generate_source(
const paramsPromise = ctx.params
const idPromise = paramsPromise.then(params => params?.__metadata_id__)

if (process.env.NODE_ENV !== 'production') {{
const id = await idPromise
const hasXmlExtension = id ? id.endsWith('.xml') : false
const sitemaps = await generateSitemaps()
let foundId
for (const item of sitemaps) {{
if (item?.id == null) {{
throw new Error('id property is required for every item returned from generateSitemaps')
}}
const baseId = id && hasXmlExtension ? id.slice(0, -4) : undefined
if (item.id.toString() === baseId) {{
foundId = item.id
}}
const id = await idPromise
const hasXmlExtension = id ? id.endsWith('.xml') : false
const sitemaps = await generateSitemaps()
let foundId
for (const item of sitemaps) {{
if (item?.id == null) {{
throw new Error('id property is required for every item returned from generateSitemaps')
}}
if (foundId == null) {{
return new NextResponse('Not Found', {{
status: 404,
}})
const baseId = id && hasXmlExtension ? id.slice(0, -4) : undefined
if (item.id.toString() === baseId) {{
foundId = item.id
}}
}}
if (foundId == null) {{
return new NextResponse('Not Found', {{
status: 404,
}})
}}

const targetIdPromise = idPromise.then(id => {{
const hasXmlExtension = id ? id.endsWith('.xml') : false
Expand All @@ -329,7 +327,6 @@ async fn dynamic_sitemap_route_with_generate_source(

export * from {resource_path}

export const dynamicParams = false
export async function generateStaticParams() {{
const sitemaps = await generateSitemaps()
const params = []
Expand Down Expand Up @@ -445,32 +442,29 @@ async fn dynamic_image_route_with_metadata_source(
const {{ __metadata_id__, ...rest }} = params
return rest
}})

if (process.env.NODE_ENV !== 'production') {{
const restParams = await restParamsPromise
const __metadata_id__ = await idPromise
const imageMetadata = await generateImageMetadata({{ params: restParams }})
const id = imageMetadata.find((item) => {{
if (item?.id == null) {{
throw new Error('id property is required for every item returned from generateImageMetadata')
}}

return item.id.toString() === __metadata_id__
}})?.id

if (id == null) {{
return new NextResponse('Not Found', {{
status: 404,
}})

const restParams = await restParamsPromise
const __metadata_id__ = await idPromise
const imageMetadata = await generateImageMetadata({{ params: restParams }})
const id = imageMetadata.find((item) => {{
if (item?.id == null) {{
throw new Error('id property is required for every item returned from generateImageMetadata')
}}

return item.id.toString() === __metadata_id__
}})?.id

if (id == null) {{
return new NextResponse('Not Found', {{
status: 404,
}})
}}

return handler({{ params: restParamsPromise, id: idPromise }})
}}

export * from {resource_path}

export const dynamicParams = false
export async function generateStaticParams({{ params }}) {{
const imageMetadata = await generateImageMetadata({{ params }})
const staticParams = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ impl ReactServerComponentValidator {
],

invalid_client_lib_apis_mapping: FxHashMap::from_iter([
("next/server", vec!["after", "unstable_rootParams"]),
("next/server", vec!["after"]),
(
"next/cache",
vec![
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* This is a comment.
*/

import { unstable_rootParams } from 'next/server'
import { lang } from 'next/root-params'

export default function () {
return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';
/**
* This is a comment.
*/ import { unstable_rootParams } from 'next/server';
*/ import { lang } from 'next/root-params';
export default function() {
return null;
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
x You're importing a component that needs "unstable_rootParams". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/
| building-your-application/rendering/server-components
x You're importing a component that needs "next/root-params". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-
| your-application/rendering/server-components
|
|
,-[input.js:9:1]
8 |
9 | import { unstable_rootParams } from 'next/server'
: ^^^^^^^^^^^^^^^^^^^
9 | import { lang } from 'next/root-params'
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
"eslint-plugin-jsdoc": "48.0.4",
"eslint-plugin-mdx": "3.1.5",
"eslint-plugin-react": "7.35.0",
"eslint-plugin-react-hooks": "0.0.0-experimental-d15d7fd7-20250929",
"eslint-plugin-react-hooks": "0.0.0-experimental-548235db-20251001",
"eslint-v8": "npm:eslint@^8.57.0",
"event-stream": "4.0.1",
"execa": "2.0.3",
Expand Down Expand Up @@ -238,16 +238,16 @@
"pretty-ms": "7.0.0",
"random-seed": "0.3.0",
"react": "19.0.0",
"react-builtin": "npm:react@19.2.0-canary-d15d7fd7-20250929",
"react-builtin": "npm:react@19.2.0-canary-548235db-20251001",
"react-dom": "19.0.0",
"react-dom-builtin": "npm:react-dom@19.2.0-canary-d15d7fd7-20250929",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-d15d7fd7-20250929",
"react-experimental-builtin": "npm:react@0.0.0-experimental-d15d7fd7-20250929",
"react-is-builtin": "npm:react-is@19.2.0-canary-d15d7fd7-20250929",
"react-server-dom-turbopack": "19.2.0-canary-d15d7fd7-20250929",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-d15d7fd7-20250929",
"react-server-dom-webpack": "19.2.0-canary-d15d7fd7-20250929",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-d15d7fd7-20250929",
"react-dom-builtin": "npm:react-dom@19.2.0-canary-548235db-20251001",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-548235db-20251001",
"react-experimental-builtin": "npm:react@0.0.0-experimental-548235db-20251001",
"react-is-builtin": "npm:react-is@19.2.0-canary-548235db-20251001",
"react-server-dom-turbopack": "19.2.0-canary-548235db-20251001",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-548235db-20251001",
"react-server-dom-webpack": "19.2.0-canary-548235db-20251001",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-548235db-20251001",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -257,8 +257,8 @@
"resolve-from": "5.0.0",
"sass": "1.54.0",
"satori": "0.15.2",
"scheduler-builtin": "npm:scheduler@0.27.0-canary-d15d7fd7-20250929",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-d15d7fd7-20250929",
"scheduler-builtin": "npm:scheduler@0.27.0-canary-548235db-20251001",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-548235db-20251001",
"seedrandom": "3.0.5",
"semver": "7.3.7",
"serve-handler": "6.1.6",
Expand Down Expand Up @@ -302,10 +302,10 @@
"@types/react-dom": "19.1.7",
"@types/retry": "0.12.0",
"jest-snapshot": "30.0.0-alpha.6",
"react": "19.2.0-canary-d15d7fd7-20250929",
"react-dom": "19.2.0-canary-d15d7fd7-20250929",
"react-is": "19.2.0-canary-d15d7fd7-20250929",
"scheduler": "0.27.0-canary-d15d7fd7-20250929"
"react": "19.2.0-canary-548235db-20251001",
"react-dom": "19.2.0-canary-548235db-20251001",
"react-is": "19.2.0-canary-548235db-20251001",
"scheduler": "0.27.0-canary-548235db-20251001"
},
"packageExtensions": {
"eslint-plugin-react-hooks@0.0.0-experimental-6de32a5a-20250822": {
Expand Down
Loading
Loading