Skip to content

Commit

Permalink
Merge branch 'canary' into fix-x-forwarded-port
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan-Arrowood committed Mar 18, 2024
2 parents 89c65d1 + 4064c64 commit 3214560
Show file tree
Hide file tree
Showing 25 changed files with 150 additions and 83 deletions.
4 changes: 2 additions & 2 deletions docs/02-app/02-api-reference/04-functions/cookies.mdx
Expand Up @@ -52,8 +52,8 @@ A method that takes a cookie name and returns a `boolean` based on if the cookie
import { cookies } from 'next/headers'

export default function Page() {
const cookiesList = cookies()
const hasCookie = cookiesList.has('theme')
const cookieStore = cookies()
const hasCookie = cookieStore.has('theme')
return '...'
}
```
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "14.2.0-canary.28"
"version": "14.2.0-canary.29"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"keywords": [
"react",
"next",
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-config-next/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,9 +10,9 @@
},
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
"dependencies": {
"@next/eslint-plugin-next": "14.2.0-canary.28",
"@next/eslint-plugin-next": "14.2.0-canary.29",
"@rushstack/eslint-patch": "^1.3.3",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.1",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0",
"eslint-import-resolver-node": "^0.3.6",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.28.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/font",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"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
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions packages/next-swc/crates/next-api/src/app.rs
Expand Up @@ -495,6 +495,7 @@ impl AppEndpoint {
Vc::upcast(FileSource::new(path)),
self.page.clone(),
self.app_project.project().project_path(),
None,
)
}

Expand Down
Expand Up @@ -89,5 +89,6 @@ pub async fn get_app_route_favicon_entry(
// TODO(alexkirsz) Get this from the metadata?
AppPage(vec![PageSegment::Static("/favicon.ico".to_string())]),
project_root,
None,
))
}
Expand Up @@ -16,22 +16,31 @@ use turbopack_binding::{
};

use crate::{
app_segment_config::NextSegmentConfig,
next_app::{AppEntry, AppPage, AppPath},
next_edge::entry::wrap_edge_entry,
parse_segment_config_from_source,
util::{load_next_js_template, NextRuntime},
};

/// Computes the entry for a Next.js app route.
/// # Arguments
///
/// * `original_segment_config` - A next segment config to be specified
/// explicitly for the given source.
/// For some cases `source` may not be the original but the handler (dynamic
/// metadata) which will lose segment config.
#[turbo_tasks::function]
pub async fn get_app_route_entry(
nodejs_context: Vc<ModuleAssetContext>,
edge_context: Vc<ModuleAssetContext>,
source: Vc<Box<dyn Source>>,
page: AppPage,
project_root: Vc<FileSystemPath>,
original_segment_config: Option<Vc<NextSegmentConfig>>,
) -> Result<Vc<AppEntry>> {
let config = parse_segment_config_from_source(source);
let config =
original_segment_config.unwrap_or_else(|| parse_segment_config_from_source(source));
let is_edge = matches!(config.await?.runtime, Some(NextRuntime::Edge));
let context = if is_edge {
edge_context
Expand Down
Expand Up @@ -9,7 +9,10 @@ use turbo_tasks::{ValueToString, Vc};
use turbopack_binding::{
turbo::tasks_fs::{File, FileContent, FileSystemPath},
turbopack::{
core::{asset::AssetContent, source::Source, virtual_source::VirtualSource},
core::{
asset::AssetContent, file_source::FileSource, source::Source,
virtual_source::VirtualSource,
},
ecmascript::utils::StringifyJs,
turbopack::ModuleAssetContext,
},
Expand All @@ -20,6 +23,7 @@ use crate::{
app_structure::MetadataItem,
mode::NextMode,
next_app::{app_entry::AppEntry, app_route_entry::get_app_route_entry, AppPage, PageSegment},
parse_segment_config_from_source,
};

/// Computes the route source for a Next.js metadata file.
Expand Down Expand Up @@ -55,12 +59,22 @@ pub fn get_app_metadata_route_entry(
mode: NextMode,
metadata: MetadataItem,
) -> Vc<AppEntry> {
// Read original source's segment config before replacing source into
// dynamic|static metadata route handler.
let original_path = match metadata {
MetadataItem::Static { path } | MetadataItem::Dynamic { path } => path,
};

let source = Vc::upcast(FileSource::new(original_path));
let config = parse_segment_config_from_source(source);

get_app_route_entry(
nodejs_context,
edge_context,
get_app_metadata_route_source(page.clone(), mode, metadata),
page,
project_root,
Some(config),
)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
Expand Down
12 changes: 6 additions & 6 deletions packages/next/package.json
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -92,7 +92,7 @@
]
},
"dependencies": {
"@next/env": "14.2.0-canary.28",
"@next/env": "14.2.0-canary.29",
"@swc/helpers": "0.5.5",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001579",
Expand Down Expand Up @@ -145,10 +145,10 @@
"@jest/types": "29.5.0",
"@mswjs/interceptors": "0.23.0",
"@napi-rs/triples": "1.2.0",
"@next/polyfill-module": "14.2.0-canary.28",
"@next/polyfill-nomodule": "14.2.0-canary.28",
"@next/react-refresh-utils": "14.2.0-canary.28",
"@next/swc": "14.2.0-canary.28",
"@next/polyfill-module": "14.2.0-canary.29",
"@next/polyfill-nomodule": "14.2.0-canary.29",
"@next/react-refresh-utils": "14.2.0-canary.29",
"@next/swc": "14.2.0-canary.29",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "1.41.2",
"@taskr/clear": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-refresh-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/react-refresh-utils",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/third-parties/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/third-parties",
"version": "14.2.0-canary.28",
"version": "14.2.0-canary.29",
"repository": {
"url": "vercel/next.js",
"directory": "packages/third-parties"
Expand All @@ -26,7 +26,7 @@
"third-party-capital": "1.0.20"
},
"devDependencies": {
"next": "14.2.0-canary.28",
"next": "14.2.0-canary.29",
"outdent": "0.8.0",
"prettier": "2.5.1"
},
Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -11,3 +11,15 @@ exports[`ReactRefreshLogBox default syntax > runtime error 1`] = `
7 | export default function FunctionNamed() {
8 | return <div />"
`;
exports[`ReactRefreshLogBox turbo syntax > runtime error 1`] = `
"index.js (5:9) @ eval
3 | setInterval(() => {
4 | i++
> 5 | throw Error('no ' + i)
| ^
6 | }, 1000)
7 | export default function FunctionNamed() {
8 | return <div />"
`;

0 comments on commit 3214560

Please sign in to comment.