Skip to content

Commit

Permalink
Merge branch 'canary' into logging/build-no-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed Sep 7, 2023
2 parents ca1e387 + 8076d0c commit 98d9abb
Show file tree
Hide file tree
Showing 184 changed files with 1,218 additions and 1,593 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
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"
}
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-we
import { callServer } from 'next/dist/client/app-call-server'
import { linkGc } from 'next/dist/client/app-link-gc'

import { HeadManagerContext } from 'next/dist/shared/lib/head-manager-context.shared-runtime'
import { HeadManagerContext } from 'next/dist/shared/lib/head-manager-context'

import { initializeHMR } from '@vercel/turbopack-next/dev/client'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import { IPC } from '@vercel/turbopack-node/ipc/index'

import 'next/dist/server/node-polyfill-fetch.js'
import 'next/dist/server/require-hook'
import './shims'

import type { IncomingMessage, ServerResponse } from 'node:http'

import type { RenderOpts } from 'next/dist/server/render'
import { renderToHTML, RenderOpts } from 'next/dist/server/render'
import { getRedirectStatus } from 'next/dist/lib/redirect-status'
import { PERMANENT_REDIRECT_STATUS } from 'next/dist/shared/lib/constants'
import { buildStaticPaths } from 'next/dist/build/utils'
Expand All @@ -22,9 +21,6 @@ import type { RenderData } from 'types/turbopack'
import type { ChunkGroup } from 'types/next'
import type { NextComponentType } from 'next/types'
import { parse } from 'node:querystring'
const {
renderToHTML,
} = require('next/dist/compiled/next-server/pages.runtime.dev')

const ipc = IPC as Ipc<IpcIncomingMessage, IpcOutgoingMessage>

Expand Down
17 changes: 6 additions & 11 deletions packages/next-swc/crates/next-core/src/app_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{collections::HashMap, io::Write as _, iter::once};

use anyhow::{bail, Result};
use indexmap::indexmap;
use indoc::formatdoc;
use indoc::indoc;
use serde_json::Value as JsonValue;
use turbo_tasks::Vc;
use turbopack_binding::{
Expand Down Expand Up @@ -964,18 +964,13 @@ impl AppRenderer {
.emit();
}

let mut result = RopeBuilder::from(
formatdoc!(
"
\"TURBOPACK {{ chunking-type: isolatedParallel; transition: {rsc_transition} }}\";
let mut result = RopeBuilder::from(indoc! {"
\"TURBOPACK { chunking-type: isolatedParallel; transition: next-edge-server-component }\";
import GlobalErrorMod from \"next/dist/client/components/error-boundary\"
const {{ GlobalError }} = GlobalErrorMod;
\"TURBOPACK {{ chunking-type: isolatedParallel; transition: {rsc_transition} }}\";
const { GlobalError } = GlobalErrorMod;
\"TURBOPACK { chunking-type: isolatedParallel; transition: next-edge-server-component }\";
import base from \"next/dist/server/app-render/entry-base\"\n
"
)
.into_bytes(),
);
"});

for import in loader_tree_module.imports {
writeln!(result, "{import}")?;
Expand Down
7 changes: 4 additions & 3 deletions packages/next-swc/crates/next-core/src/next_edge/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ pub async fn get_edge_resolve_options_context(
];

match ty {
ServerContextType::AppRSC { .. } => custom_conditions.push("react-server".to_string()),
ServerContextType::AppRoute { .. }
| ServerContextType::Pages { .. }
ServerContextType::AppRSC { .. } | ServerContextType::AppRoute { .. } => {
custom_conditions.push("react-server".to_string())
}
ServerContextType::Pages { .. }
| ServerContextType::PagesData { .. }
| ServerContextType::AppSSR { .. }
| ServerContextType::Middleware { .. } => {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,24 @@ impl Transition for NextEdgeRouteTransition {

#[turbo_tasks::function]
async fn process_module(
self: Vc<Self>,
&self,
asset: Vc<Box<dyn Module>>,
context: Vc<ModuleAssetContext>,
) -> Result<Vc<Box<dyn Module>>> {
let new_context = self.process_context(context);
let this = self.await?;
let new_asset = route_bootstrap(
asset,
Vc::upcast(new_context),
this.base_path,
this.bootstrap_asset,
Vc::upcast(context),
self.base_path,
self.bootstrap_asset,
Vc::cell(indexmap! {
"NAME".to_string() => this.entry_name.clone(),
"NAME".to_string() => self.entry_name.clone(),
}),
);

let asset = ChunkGroupFilesAsset {
module: Vc::upcast(new_asset),
client_root: this.output_path,
chunking_context: this.edge_chunking_context,
client_root: self.output_path,
chunking_context: self.edge_chunking_context,
runtime_entries: None,
};

Expand Down

0 comments on commit 98d9abb

Please sign in to comment.