Unverified Commit 81241756 authored by Sam Ko's avatar Sam Ko Committed by GitHub

Merge branch 'canary' into sam/webpack/css-chunking-plugin

parents 162f1ec9 7e87edd2
......@@ -146,10 +146,6 @@ jobs:
# --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default
# TODO: we should add the relevant envs later to to switch to strict mode
build: |
export CC=$(xcrun -f clang);
export CXX=$(xcrun -f clang++);
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && corepack enable
turbo run build-native-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target aarch64-apple-darwin
strip -x packages/next-swc/native/next-swc.*.node
......
......@@ -271,7 +271,7 @@ If you are using `fetch`, requests can be [memoized](/docs/app/building-your-app
>
> - In previous versions of Next.js, using `fetch` would have a default `cache` value of `force-cache`. This changed in version 15, to a default of `cache: no-store`.
```tsx filename="app/page.tsx" switcher
```tsx filename="app/blog/[id]/page.tsx" switcher
import { notFound } from 'next/navigation'
interface Post {
......@@ -281,21 +281,21 @@ interface Post {
}
async function getPost(id: string) {
let res = await fetch(`https://api.vercel.app/blog/${id}`, {
const res = await fetch(`https://api.vercel.app/blog/${id}`, {
cache: 'force-cache',
})
let post: Post = await res.json()
const post: Post = await res.json()
if (!post) notFound()
return post
}
export async function generateStaticParams() {
let posts = await fetch('https://api.vercel.app/blog', {
const posts = await fetch('https://api.vercel.app/blog', {
cache: 'force-cache',
}).then((res) => res.json())
return posts.map((post: Post) => ({
id: post.id,
id: String(post.id),
}))
}
......@@ -304,7 +304,8 @@ export async function generateMetadata({
}: {
params: Promise<{ id: string }>
}) {
let post = await getPost(params.id)
const { id } = await params
const post = await getPost(id)
return {
title: post.title,
......@@ -316,7 +317,8 @@ export default async function Page({
}: {
params: Promise<{ id: string }>
}) {
let post = await getPost(params.id)
const { id } = await params
const post = await getPost(id)
return (
<article>
......@@ -327,28 +329,29 @@ export default async function Page({
}
```
```jsx filename="app/page.js" switcher
```jsx filename="app/blog/[id]/page.js" switcher
import { notFound } from 'next/navigation'
async function getPost(id) {
let res = await fetch(`https://api.vercel.app/blog/${id}`)
let post = await res.json()
const res = await fetch(`https://api.vercel.app/blog/${id}`)
const post = await res.json()
if (!post) notFound()
return post
}
export async function generateStaticParams() {
let posts = await fetch('https://api.vercel.app/blog').then((res) =>
const posts = await fetch('https://api.vercel.app/blog').then((res) =>
res.json()
)
return posts.map((post) => ({
id: post.id,
id: String(post.id),
}))
}
export async function generateMetadata({ params }) {
let post = await getPost(params.id)
const { id } = await params
const post = await getPost(id)
return {
title: post.title,
......@@ -356,7 +359,8 @@ export async function generateMetadata({ params }) {
}
export default async function Page({ params }) {
let post = await getPost(params.id)
const { id } = await params
const post = await getPost(id)
return (
<article>
......
import Header from "../../../_components/header";
type Props = {
params: {
params: Promise<{
id: string;
comment: string;
};
}>;
};
export default function CommentPage({ params }: Props) {
export default async function CommentPage(props: Props) {
const params = await props.params;
return (
<>
<Header />
......
......@@ -2,12 +2,13 @@ import Link from "next/link";
import Header from "../../_components/header";
type Props = {
params: {
params: Promise<{
id: string;
};
}>;
};
export default function PostPage({ params }: Props) {
export default async function PostPage(props: Props) {
const params = await props.params;
return (
<>
<Header />
......
......@@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "15.0.4-canary.27"
"version": "15.0.4-canary.28"
}
{
"name": "create-next-app",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"keywords": [
"react",
"next",
......
{
"name": "eslint-config-next",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
......@@ -10,7 +10,7 @@
},
"homepage": "https://nextjs.org/docs/app/api-reference/config/eslint#eslint-config",
"dependencies": {
"@next/eslint-plugin-next": "15.0.4-canary.27",
"@next/eslint-plugin-next": "15.0.4-canary.28",
"@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",
......
{
"name": "@next/eslint-plugin-next",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"license": "MIT",
......
{
"name": "@next/font",
"private": true,
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
......
{
"name": "@next/bundle-analyzer",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
......
{
"name": "@next/codemod",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"license": "MIT",
"repository": {
"type": "git",
......
{
"name": "@next/env",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"keywords": [
"react",
"next",
......
{
"name": "@next/mdx",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"main": "index.js",
"license": "MIT",
"repository": {
......
{
"name": "@next/plugin-storybook",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
......
{
"name": "@next/polyfill-module",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"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",
......
{
"name": "@next/polyfill-nomodule",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
......
{
"name": "@next/swc",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
......
{
"name": "next",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
......@@ -97,7 +97,7 @@
]
},
"dependencies": {
"@next/env": "15.0.4-canary.27",
"@next/env": "15.0.4-canary.28",
"@swc/counter": "0.1.3",
"@swc/helpers": "0.5.13",
"busboy": "1.6.0",
......@@ -161,11 +161,11 @@
"@jest/types": "29.5.0",
"@mswjs/interceptors": "0.23.0",
"@napi-rs/triples": "1.2.0",
"@next/font": "15.0.4-canary.27",
"@next/polyfill-module": "15.0.4-canary.27",
"@next/polyfill-nomodule": "15.0.4-canary.27",
"@next/react-refresh-utils": "15.0.4-canary.27",
"@next/swc": "15.0.4-canary.27",
"@next/font": "15.0.4-canary.28",
"@next/polyfill-module": "15.0.4-canary.28",
"@next/polyfill-nomodule": "15.0.4-canary.28",
"@next/react-refresh-utils": "15.0.4-canary.28",
"@next/swc": "15.0.4-canary.28",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "1.41.2",
"@swc/core": "1.9.2-nightly-20241111.1",
......
{
"name": "@next/react-refresh-utils",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
......
{
"name": "@next/third-parties",
"version": "15.0.4-canary.27",
"version": "15.0.4-canary.28",
"repository": {
"url": "vercel/next.js",
"directory": "packages/third-parties"
......@@ -26,7 +26,7 @@
"third-party-capital": "1.0.20"
},
"devDependencies": {
"next": "15.0.4-canary.27",
"next": "15.0.4-canary.28",
"outdent": "0.8.0",
"prettier": "2.5.1",
"typescript": "5.6.3"
......
......@@ -795,7 +795,7 @@ importers:
packages/eslint-config-next:
dependencies:
'@next/eslint-plugin-next':
specifier: 15.0.4-canary.27
specifier: 15.0.4-canary.28
version: link:../eslint-plugin-next
'@rushstack/eslint-patch':
specifier: ^1.10.3
......@@ -859,7 +859,7 @@ importers:
packages/next:
dependencies:
'@next/env':
specifier: 15.0.4-canary.27
specifier: 15.0.4-canary.28
version: link:../next-env
'@swc/counter':
specifier: 0.1.3
......@@ -869,7 +869,7 @@ importers:
version: 0.5.13
babel-plugin-react-compiler:
specifier: '*'
version: 19.0.0-beta-0dec889-20241115
version: 19.0.0-beta-df7b47d-20241124
busboy:
specifier: 1.6.0
version: 1.6.0
......@@ -987,19 +987,19 @@ importers:
specifier: 1.2.0
version: 1.2.0
'@next/font':
specifier: 15.0.4-canary.27
specifier: 15.0.4-canary.28
version: link:../font
'@next/polyfill-module':
specifier: 15.0.4-canary.27
specifier: 15.0.4-canary.28
version: link:../next-polyfill-module
'@next/polyfill-nomodule':
specifier: 15.0.4-canary.27
specifier: 15.0.4-canary.28
version: link:../next-polyfill-nomodule
'@next/react-refresh-utils':
specifier: 15.0.4-canary.27
specifier: 15.0.4-canary.28
version: link:../react-refresh-utils
'@next/swc':
specifier: 15.0.4-canary.27
specifier: 15.0.4-canary.28
version: link:../next-swc
'@opentelemetry/api':
specifier: 1.6.0
......@@ -1633,7 +1633,7 @@ importers:
version: 1.0.20
devDependencies:
next:
specifier: 15.0.4-canary.27
specifier: 15.0.4-canary.28
version: link:../next
outdent:
specifier: 0.8.0
......@@ -6301,8 +6301,8 @@ packages:
babel-plugin-react-compiler@0.0.0-experimental-c23de8d-20240515:
resolution: {integrity: sha512-0XN2gmpT55QtAz5n7d5g91y1AuO9tRhWBaLgCRyc4ExHrlr7+LfxW+YTb3mOwxngkkiggwM8HyYsaEK9MqhnlQ==}
babel-plugin-react-compiler@19.0.0-beta-0dec889-20241115:
resolution: {integrity: sha512-sB912UbBt/vYl+6w40VO+LzWVnAt1Ty/XCDKs2qT5Fopljm+WpJNHVVkNESsX0IjU3sM5T5KvN31uuPpraUi7A==}
babel-plugin-react-compiler@19.0.0-beta-df7b47d-20241124:
resolution: {integrity: sha512-93iSASR20HNsotcOTQ+KPL0zpgfRFVWL86AtXpmHp995HuMVnC9femd8Winr3GxkPEh8lEOyaw3nqY4q2HUm5w==}
babel-plugin-transform-async-to-promises@0.8.15:
resolution: {integrity: sha512-fDXP68ZqcinZO2WCiimCL9zhGjGXOnn3D33zvbh+yheZ/qOrNVVDDIBtAaM3Faz8TRvQzHiRKsu3hfrBAhEncQ==}
......@@ -21276,7 +21276,7 @@ snapshots:
zod: 3.23.8
zod-validation-error: 2.1.0(zod@3.23.8)
babel-plugin-react-compiler@19.0.0-beta-0dec889-20241115:
babel-plugin-react-compiler@19.0.0-beta-df7b47d-20241124:
dependencies:
'@babel/types': 7.22.5
......@@ -270,9 +270,11 @@ describe('ReactRefreshRequire app', () => {
'leaf.js',
`log.push('init LeafV3'); export default {};`
)
expect((await session.evaluate(() => (window as any).log)).sort()).toEqual(
['init LeafV3', 'init MiddleAV1', 'init MiddleBV1'].sort()
)
expect(await session.evaluate(() => (window as any).log)).toEqual([
'init LeafV3',
'init MiddleAV1',
'init MiddleBV1',
])
// Now edit MiddleB. It should accept and re-run alone.
await session.evaluate(() => ((window as any).log = []))
......
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