Skip to content

Commit

Permalink
Merge branch 'canary' into logging/support-expand-url
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Sep 7, 2023
2 parents f539794 + 904d8ee commit 028e5c6
Show file tree
Hide file tree
Showing 201 changed files with 1,858 additions and 1,965 deletions.
5 changes: 1 addition & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,7 @@
},
{
"files": ["packages/**"],
"excludedFiles": [
"packages/next/taskfile*.js",
"packages/next/webpack.config.js"
],
"excludedFiles": ["packages/next/taskfile.js"],
"rules": {
"no-shadow": ["warn", { "builtinGlobals": false }],
"import/no-extraneous-dependencies": [
Expand Down
9 changes: 2 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,15 @@
],
// Disable Jest autoRun as otherwise it will start running all tests the first time.
"jest.autoRun": "off",

// Debugging.
"debug.javascript.unmapMissingSources": true,

"files.exclude": {
"**/node_modules": false,
"node_modules": true,
"*[!test]**/node_modules": true
},

// Ensure enough terminal history is preserved when running tests.
"terminal.integrated.scrollback": 10000,

// Configure todo-tree to exclude node_modules, dist, and compiled.
"todo-tree.filtering.excludeGlobs": [
"**/node_modules",
Expand All @@ -48,10 +44,8 @@
"[x]",
"TODO-APP"
],

// Disable TypeScript surveys.
"typescript.surveys.enabled": false,

// Enable file nesting for unit test files.
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
Expand Down Expand Up @@ -82,5 +76,6 @@
"language": "markdown",
"scheme": "file"
}
]
],
"typescript.tsdk": "node_modules/typescript/lib"
}
5 changes: 0 additions & 5 deletions bench/basic-app/app/api/app/route.js

This file was deleted.

12 changes: 0 additions & 12 deletions bench/basic-app/app/layout.js

This file was deleted.

7 changes: 0 additions & 7 deletions bench/basic-app/app/page.js

This file was deleted.

5 changes: 0 additions & 5 deletions bench/basic-app/next.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions bench/basic-app/pages/api/index.js

This file was deleted.

7 changes: 0 additions & 7 deletions bench/basic-app/pages/pages/index.js

This file was deleted.

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": "13.4.20-canary.20"
"version": "13.4.20-canary.21"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"@types/node-fetch": "2.6.1",
"@types/react": "18.2.8",
"@types/react-dom": "18.2.4",
"@types/relay-runtime": "13.0.0",
"@types/relay-runtime": "14.1.13",
"@types/selenium-webdriver": "4.0.15",
"@types/sharp": "0.29.3",
"@types/string-hash": "1.1.1",
Expand Down Expand Up @@ -226,7 +226,7 @@
"tree-kill": "1.2.2",
"tsec": "0.2.1",
"turbo": "1.10.9",
"typescript": "5.1.3",
"typescript": "5.2.2",
"unfetch": "4.2.0",
"wait-port": "0.2.2",
"webpack": "5.86.0",
Expand Down
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": "13.4.20-canary.20",
"version": "13.4.20-canary.21",
"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": "13.4.20-canary.20",
"version": "13.4.20-canary.21",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,7 +10,7 @@
},
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
"dependencies": {
"@next/eslint-plugin-next": "13.4.20-canary.20",
"@next/eslint-plugin-next": "13.4.20-canary.21",
"@rushstack/eslint-patch": "^1.3.3",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0",
"eslint-import-resolver-node": "^0.3.6",
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": "13.4.20-canary.20",
"version": "13.4.20-canary.21",
"description": "ESLint plugin for NextJS.",
"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,6 +1,6 @@
{
"name": "@next/font",
"version": "13.4.20-canary.20",
"version": "13.4.20-canary.21",
"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": "13.4.20-canary.20",
"version": "13.4.20-canary.21",
"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": "13.4.20-canary.20",
"version": "13.4.20-canary.21",
"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": "13.4.20-canary.20",
"version": "13.4.20-canary.21",
"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": "13.4.20-canary.20",
"version": "13.4.20-canary.21",
"main": "index.js",
"license": "MIT",
"repository": {
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": "13.4.20-canary.20",
"version": "13.4.20-canary.21",
"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": "13.4.20-canary.20",
"version": "13.4.20-canary.21",
"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": "13.4.20-canary.20",
"version": "13.4.20-canary.21",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
34 changes: 10 additions & 24 deletions packages/next-swc/crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use next_core::{
mode::NextMode,
next_app::{
get_app_client_references_chunks, get_app_client_shared_chunks, get_app_page_entry,
get_app_route_entry, AppEntry,
get_app_route_entry, AppEntry, AppPage,
},
next_client::{
get_client_module_options_context, get_client_resolve_options_context,
Expand Down Expand Up @@ -344,8 +344,7 @@ impl AppProject {
.map(|(pathname, app_entrypoint)| async {
Ok((
pathname.clone(),
*app_entry_point_to_route(self, app_entrypoint.clone(), pathname.clone())
.await?,
*app_entry_point_to_route(self, app_entrypoint.clone()).await?,
))
})
.try_join()
Expand All @@ -360,22 +359,17 @@ impl AppProject {
pub async fn app_entry_point_to_route(
app_project: Vc<AppProject>,
entrypoint: AppEntrypoint,
pathname: String,
) -> Vc<Route> {
match entrypoint {
AppEntrypoint::AppPage {
original_name,
loader_tree,
} => Route::AppPage {
AppEntrypoint::AppPage { page, loader_tree } => Route::AppPage {
html_endpoint: Vc::upcast(
AppEndpoint {
ty: AppEndpointType::Page {
ty: AppPageEndpointType::Html,
loader_tree,
},
app_project,
pathname: pathname.clone(),
original_name: original_name.clone(),
page: page.clone(),
}
.cell(),
),
Expand All @@ -386,22 +380,17 @@ pub async fn app_entry_point_to_route(
loader_tree,
},
app_project,
pathname,
original_name,
page,
}
.cell(),
),
},
AppEntrypoint::AppRoute {
original_name,
path,
} => Route::AppRoute {
AppEntrypoint::AppRoute { page, path } => Route::AppRoute {
endpoint: Vc::upcast(
AppEndpoint {
ty: AppEndpointType::Route { path },
app_project,
pathname,
original_name,
page,
}
.cell(),
),
Expand Down Expand Up @@ -431,8 +420,7 @@ enum AppEndpointType {
struct AppEndpoint {
ty: AppEndpointType,
app_project: Vc<AppProject>,
pathname: String,
original_name: String,
page: AppPage,
}

#[turbo_tasks::value_impl]
Expand All @@ -444,8 +432,7 @@ impl AppEndpoint {
self.app_project.edge_rsc_module_context(),
loader_tree,
self.app_project.app_dir(),
self.pathname.clone(),
self.original_name.clone(),
self.page.clone(),
self.app_project.project().project_path(),
)
}
Expand All @@ -456,8 +443,7 @@ impl AppEndpoint {
self.app_project.rsc_module_context(),
self.app_project.edge_rsc_module_context(),
Vc::upcast(FileSource::new(path)),
self.pathname.clone(),
self.original_name.clone(),
self.page.clone(),
self.app_project.project().project_path(),
)
}
Expand Down
18 changes: 5 additions & 13 deletions packages/next-swc/crates/next-build/src/next_app/app_entries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,31 +187,23 @@ pub async fn get_app_entries(
let mut entries = entrypoints
.await?
.iter()
.map(|(pathname, entrypoint)| async move {
.map(|(_, entrypoint)| async move {
Ok(match entrypoint {
Entrypoint::AppPage {
original_name,
loader_tree,
} => get_app_page_entry(
Entrypoint::AppPage { page, loader_tree } => get_app_page_entry(
rsc_context,
// TODO add edge support
rsc_context,
*loader_tree,
app_dir,
pathname.clone(),
original_name.clone(),
page.clone(),
project_root,
),
Entrypoint::AppRoute {
original_name,
path,
} => get_app_route_entry(
Entrypoint::AppRoute { page, path } => get_app_route_entry(
rsc_context,
// TODO add edge support
rsc_context,
Vc::upcast(FileSource::new(*path)),
pathname.clone(),
original_name.clone(),
page.clone(),
project_root,
),
})
Expand Down
1 change: 1 addition & 0 deletions packages/next-swc/crates/next-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ turbopack-binding = { workspace = true, features = [
"__turbo_tasks_hash",
"__turbopack",
"__turbopack_build",
"__turbopack_cli_utils",
"__turbopack_core",
"__turbopack_dev",
"__turbopack_dev_server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// the other imports
import startOperationStreamHandler from '../internal/operation-stream'

import 'next/dist/server/node-polyfill-fetch'

import { join } from 'path'
import { parse as parseUrl } from 'node:url'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
import startOperationStreamHandler from '../internal/operation-stream'

import '../polyfill/app-polyfills.ts'
// TODO: when actions are supported, this should be removed/changed
process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = 'next'
import 'next/dist/server/require-hook'

import type { IncomingMessage } from 'node:http'

import type { RenderData } from 'types/turbopack'
import type { RenderOpts } from 'next/dist/server/app-render/types'

import { renderToHTMLOrFlight } from 'next/dist/server/app-render/app-render'
import { RSC_VARY_HEADER } from 'next/dist/client/components/app-router-headers'
import { headersFromEntries, initProxiedHeaders } from '../internal/headers'
import { parse, ParsedUrlQuery } from 'node:querystring'
Expand All @@ -25,10 +23,6 @@ import { join } from 'node:path'
import { nodeFs } from 'next/dist/server/lib/node-fs-methods'
import { IncrementalCache } from 'next/dist/server/lib/incremental-cache'

const {
renderToHTMLOrFlight,
} = require('next/dist/compiled/next-server/app-page.runtime.dev')

installRequireAndChunkLoad()

const MIME_TEXT_HTML_UTF8 = 'text/html; charset=utf-8'
Expand Down
Loading

0 comments on commit 028e5c6

Please sign in to comment.