Skip to content

Commit 3214560

Browse files
Merge branch 'canary' into fix-x-forwarded-port
2 parents 89c65d1 + 4064c64 commit 3214560

File tree

25 files changed

+150
-83
lines changed

25 files changed

+150
-83
lines changed

docs/02-app/02-api-reference/04-functions/cookies.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ A method that takes a cookie name and returns a `boolean` based on if the cookie
5252
import { cookies } from 'next/headers'
5353

5454
export default function Page() {
55-
const cookiesList = cookies()
56-
const hasCookie = cookiesList.has('theme')
55+
const cookieStore = cookies()
56+
const hasCookie = cookieStore.has('theme')
5757
return '...'
5858
}
5959
```

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": "14.2.0-canary.28"
19+
"version": "14.2.0-canary.29"
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": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
44
"keywords": [
55
"react",
66
"next",

packages/eslint-config-next/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-next",
3-
"version": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
44
"description": "ESLint configuration used by Next.js.",
55
"main": "index.js",
66
"license": "MIT",
@@ -10,9 +10,9 @@
1010
},
1111
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
1212
"dependencies": {
13-
"@next/eslint-plugin-next": "14.2.0-canary.28",
13+
"@next/eslint-plugin-next": "14.2.0-canary.29",
1414
"@rushstack/eslint-patch": "^1.3.3",
15-
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.1",
15+
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0",
1616
"eslint-import-resolver-node": "^0.3.6",
1717
"eslint-import-resolver-typescript": "^3.5.2",
1818
"eslint-plugin-import": "^2.28.1",

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": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
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,6 +1,6 @@
11
{
22
"name": "@next/font",
3-
"version": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
44
"repository": {
55
"url": "vercel/next.js",
66
"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": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
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": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
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": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
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": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
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": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
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": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
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": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
44
"description": "A polyfill for non-dead, nomodule browsers.",
55
"main": "dist/polyfill-nomodule.js",
66
"license": "MIT",

packages/next-swc/crates/next-api/src/app.rs

+1
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ impl AppEndpoint {
495495
Vc::upcast(FileSource::new(path)),
496496
self.page.clone(),
497497
self.app_project.project().project_path(),
498+
None,
498499
)
499500
}
500501

packages/next-swc/crates/next-core/src/next_app/app_favicon_entry.rs

+1
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,6 @@ pub async fn get_app_route_favicon_entry(
8989
// TODO(alexkirsz) Get this from the metadata?
9090
AppPage(vec![PageSegment::Static("/favicon.ico".to_string())]),
9191
project_root,
92+
None,
9293
))
9394
}

packages/next-swc/crates/next-core/src/next_app/app_route_entry.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,31 @@ use turbopack_binding::{
1616
};
1717

1818
use crate::{
19+
app_segment_config::NextSegmentConfig,
1920
next_app::{AppEntry, AppPage, AppPath},
2021
next_edge::entry::wrap_edge_entry,
2122
parse_segment_config_from_source,
2223
util::{load_next_js_template, NextRuntime},
2324
};
2425

2526
/// Computes the entry for a Next.js app route.
27+
/// # Arguments
28+
///
29+
/// * `original_segment_config` - A next segment config to be specified
30+
/// explicitly for the given source.
31+
/// For some cases `source` may not be the original but the handler (dynamic
32+
/// metadata) which will lose segment config.
2633
#[turbo_tasks::function]
2734
pub async fn get_app_route_entry(
2835
nodejs_context: Vc<ModuleAssetContext>,
2936
edge_context: Vc<ModuleAssetContext>,
3037
source: Vc<Box<dyn Source>>,
3138
page: AppPage,
3239
project_root: Vc<FileSystemPath>,
40+
original_segment_config: Option<Vc<NextSegmentConfig>>,
3341
) -> Result<Vc<AppEntry>> {
34-
let config = parse_segment_config_from_source(source);
42+
let config =
43+
original_segment_config.unwrap_or_else(|| parse_segment_config_from_source(source));
3544
let is_edge = matches!(config.await?.runtime, Some(NextRuntime::Edge));
3645
let context = if is_edge {
3746
edge_context

packages/next-swc/crates/next-core/src/next_app/metadata/route.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ use turbo_tasks::{ValueToString, Vc};
99
use turbopack_binding::{
1010
turbo::tasks_fs::{File, FileContent, FileSystemPath},
1111
turbopack::{
12-
core::{asset::AssetContent, source::Source, virtual_source::VirtualSource},
12+
core::{
13+
asset::AssetContent, file_source::FileSource, source::Source,
14+
virtual_source::VirtualSource,
15+
},
1316
ecmascript::utils::StringifyJs,
1417
turbopack::ModuleAssetContext,
1518
},
@@ -20,6 +23,7 @@ use crate::{
2023
app_structure::MetadataItem,
2124
mode::NextMode,
2225
next_app::{app_entry::AppEntry, app_route_entry::get_app_route_entry, AppPage, PageSegment},
26+
parse_segment_config_from_source,
2327
};
2428

2529
/// Computes the route source for a Next.js metadata file.
@@ -55,12 +59,22 @@ pub fn get_app_metadata_route_entry(
5559
mode: NextMode,
5660
metadata: MetadataItem,
5761
) -> Vc<AppEntry> {
62+
// Read original source's segment config before replacing source into
63+
// dynamic|static metadata route handler.
64+
let original_path = match metadata {
65+
MetadataItem::Static { path } | MetadataItem::Dynamic { path } => path,
66+
};
67+
68+
let source = Vc::upcast(FileSource::new(original_path));
69+
let config = parse_segment_config_from_source(source);
70+
5871
get_app_route_entry(
5972
nodejs_context,
6073
edge_context,
6174
get_app_metadata_route_source(page.clone(), mode, metadata),
6275
page,
6376
project_root,
77+
Some(config),
6478
)
6579
}
6680

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": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
44
"private": true,
55
"scripts": {
66
"clean": "node ../../scripts/rm.mjs native",

packages/next/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next",
3-
"version": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
44
"description": "The React Framework",
55
"main": "./dist/server/next.js",
66
"license": "MIT",
@@ -92,7 +92,7 @@
9292
]
9393
},
9494
"dependencies": {
95-
"@next/env": "14.2.0-canary.28",
95+
"@next/env": "14.2.0-canary.29",
9696
"@swc/helpers": "0.5.5",
9797
"busboy": "1.6.0",
9898
"caniuse-lite": "^1.0.30001579",
@@ -145,10 +145,10 @@
145145
"@jest/types": "29.5.0",
146146
"@mswjs/interceptors": "0.23.0",
147147
"@napi-rs/triples": "1.2.0",
148-
"@next/polyfill-module": "14.2.0-canary.28",
149-
"@next/polyfill-nomodule": "14.2.0-canary.28",
150-
"@next/react-refresh-utils": "14.2.0-canary.28",
151-
"@next/swc": "14.2.0-canary.28",
148+
"@next/polyfill-module": "14.2.0-canary.29",
149+
"@next/polyfill-nomodule": "14.2.0-canary.29",
150+
"@next/react-refresh-utils": "14.2.0-canary.29",
151+
"@next/swc": "14.2.0-canary.29",
152152
"@opentelemetry/api": "1.6.0",
153153
"@playwright/test": "1.41.2",
154154
"@taskr/clear": "1.1.0",

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": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
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": "14.2.0-canary.28",
3+
"version": "14.2.0-canary.29",
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": "14.2.0-canary.28",
29+
"next": "14.2.0-canary.29",
3030
"outdent": "0.8.0",
3131
"prettier": "2.5.1"
3232
},

pnpm-lock.yaml

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

test/development/acceptance/__snapshots__/error-recovery.test.ts.snap

+12
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,15 @@ exports[`ReactRefreshLogBox default syntax > runtime error 1`] = `
1111
7 | export default function FunctionNamed() {
1212
8 | return <div />"
1313
`;
14+
15+
exports[`ReactRefreshLogBox turbo syntax > runtime error 1`] = `
16+
"index.js (5:9) @ eval
17+
18+
3 | setInterval(() => {
19+
4 | i++
20+
> 5 | throw Error('no ' + i)
21+
| ^
22+
6 | }, 1000)
23+
7 | export default function FunctionNamed() {
24+
8 | return <div />"
25+
`;

0 commit comments

Comments
 (0)