Unverified Commit d6b43616 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Merge branch 'canary' into 11-14-Move_externals_together_in_taskfile.js

parents 9c07caf4 493f69ff
......@@ -34,5 +34,4 @@ rustflags = [
"tokio_unstable",
"-Zshare-generics=y",
"-Csymbol-mangling-version=v0",
"-Aclippy::too_many_arguments",
]
This diff is collapsed.
......@@ -14,6 +14,9 @@ members = [
"packages/next-swc/crates/next-transform-strip-page-exports",
]
[workspace.lints.clippy]
too_many_arguments = "allow"
# This is a workaround for wasm timeout issue
[profile.dev.package."*"]
debug-assertions = false
......@@ -33,18 +36,18 @@ next-transform-dynamic = { path = "packages/next-swc/crates/next-transform-dynam
next-transform-strip-page-exports = { path = "packages/next-swc/crates/next-transform-strip-page-exports" }
# SWC crates
swc_core = { version = "0.86.40", features = [
swc_core = { version = "0.86.60", features = [
"ecma_loader_lru",
"ecma_loader_parking_lot",
] }
testing = { version = "0.35.7" }
testing = { version = "0.35.10" }
# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231114.2" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231120.2" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231114.2" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231120.2" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231114.2" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231120.2" }
# General Deps
......@@ -132,3 +135,4 @@ url = "2.2.2"
urlencoding = "2.1.2"
webbrowser = "0.8.7"
dhat = { version = "0.3.2" }
......@@ -726,7 +726,7 @@ export default function Page() {
### Optimistic Updates
Use `useOptimistic` to optimistically update the UI before the Server Action finishes, rather than waiting for the response:
Use [`useOptimistic`](https://react.dev/reference/react/useOptimistic) to optimistically update the UI before the Server Action finishes, rather than waiting for the response:
```tsx filename="app/page.tsx" switcher
'use client'
......
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
# Upload file with Next.js and Server Actions
This example shows how you can build upload forms with Next.js and Server Actions.
## Deploy your own
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/next.js/tree/canary/examples/server-actions-upload&project-name=server-actions-upload&repository-name=server-actions-upload)
## How to use
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:
```bash
npx create-next-app --example server-actions-upload next-upload-app
```
```bash
yarn create next-app --example server-actions-upload next-upload-app
```
```bash
pnpm create next-app --example server-actions-upload next-upload-app
```
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
'use server'
import fs from 'fs'
import path from 'path'
import { promisify } from 'util'
const writeFile = promisify(fs.writeFile)
export async function saveData(formData: FormData) {
const file = formData.get('file') as File
const fileBuffer = await file.arrayBuffer()
const filePath = path.join(`/tmp/${file.name}`)
await writeFile(filePath, Buffer.from(fileBuffer))
const payload = {
email: formData.get('email'),
}
console.log('payload', payload)
return payload
}
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
const inter = Inter({ subsets: ['latin'] })
export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
}
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
)
}
import UploadForm from './upload-form'
export default function Home() {
return <UploadForm />
}
'use client'
import { useFormStatus } from 'react-dom'
import { saveData } from './action'
import { useRef } from 'react'
function Submit() {
const { pending } = useFormStatus()
return <button disabled={pending}>{pending ? 'Submitting' : 'Submit'}</button>
}
export default function UploadForm() {
const formRef = useRef<HTMLFormElement | null>(null)
async function formAction(formData: FormData) {
await saveData(formData)
formRef.current?.reset()
alert('Save success!')
}
return (
<form action={formAction} ref={formRef}>
<h1>Upload Demo</h1>
<div>Email</div>
<input type="email" name="email" required />
<br />
<br />
<div>Select file</div>
<input type="file" name="file" required />
<br />
<br />
<br />
<Submit />
</form>
)
}
/** @type {import('next').NextConfig} */
const nextConfig = {}
module.exports = nextConfig
{
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"react": "^18",
"react-dom": "^18",
"next": "latest"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18"
}
}
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
},
"forceConsistentCasingInFileNames": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
......@@ -10,9 +10,9 @@
"component:headless": "cypress run --component"
},
"dependencies": {
"next": "latest",
"react": "18.2.0",
"react-dom": "18.2.0"
"next": "^14.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "18.0.6",
......
import type { AppProps } from 'next/app'
import '../styles/globals.css'
function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}
export default MyApp
import AboutComponent from '../components/about-component'
import styles from '../styles/Home.module.css'
import AboutComponent from '../../components/about-component'
import styles from '../Home.module.css'
export default function About() {
return (
......
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
import { ReactNode } from 'react'
const inter = Inter({ subsets: ['latin'] })
export const metadata: Metadata = {
title: 'Nextjs with cypress',
description: 'Nextjs with cypress',
}
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
)
}
import Head from 'next/head'
import Image from 'next/image'
import Link from 'next/link'
import styles from '../styles/Home.module.css'
import styles from './Home.module.css'
export default function Home() {
return (
......
import AboutComponent from './about-component'
import AboutComponent from '../../src/components/about-component'
/* eslint-disable */
// Disable ESLint to prevent failing linting inside the Next.js repo.
// If you're using ESLint on your project, we recommend installing the ESLint Cypress plugin instead:
......
import Link from 'next/link'
import React from 'react'
import styles from '../styles/Home.module.css'
import styles from '../app/Home.module.css'
export default function AboutComponent() {
return (
......
......@@ -13,8 +13,13 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
"incremental": true,
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
......@@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "14.0.4-canary.1"
"version": "14.0.4-canary.6"
}
{
"name": "create-next-app",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"keywords": [
"react",
"next",
......
{
"name": "eslint-config-next",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
......@@ -10,7 +10,7 @@
},
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
"dependencies": {
"@next/eslint-plugin-next": "14.0.4-canary.1",
"@next/eslint-plugin-next": "14.0.4-canary.6",
"@rushstack/eslint-patch": "^1.3.3",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0",
"eslint-import-resolver-node": "^0.3.6",
......
{
"name": "@next/eslint-plugin-next",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"license": "MIT",
......
{
"name": "@next/font",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
......
{
"name": "@next/bundle-analyzer",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
......
{
"name": "@next/codemod",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"license": "MIT",
"repository": {
"type": "git",
......
{
"name": "@next/env",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"keywords": [
"react",
"next",
......
{
"name": "@next/mdx",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"main": "index.js",
"license": "MIT",
"repository": {
......
{
"name": "@next/plugin-storybook",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
......
{
"name": "@next/polyfill-module",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"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": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
......
......@@ -7,6 +7,9 @@ publish = false
[features]
plugin = ["turbopack-binding/__swc_core_binding_napi_plugin"]
[lints]
workspace = true
[dependencies]
chrono = "0.4"
convert_case = "0.5.0"
......@@ -35,8 +38,8 @@ turbopack-binding = { workspace = true, features = [
"__swc_transform_modularize_imports",
"__swc_transform_relay",
] }
react_remove_properties = "0.10.0"
remove_console = "0.11.0"
react_remove_properties = "0.11.0"
remove_console = "0.12.0"
[dev-dependencies]
turbopack-binding = { workspace = true, features = [
......
......@@ -44,7 +44,7 @@ impl Visit for CjsFinder {
(&*member_expr.obj, &member_expr.prop)
{
if &*obj.sym == "Object" && &*prop.sym == "defineProperty" {
if let Some(ExprOrSpread { expr: expr0, .. }) = e.args.get(0) {
if let Some(ExprOrSpread { expr: expr0, .. }) = e.args.first() {
if let Expr::Ident(arg0) = &**expr0 {
if &*arg0.sym == "exports" {
if let Some(ExprOrSpread { expr: expr1, .. }) = e.args.get(1) {
......
......@@ -216,7 +216,7 @@ impl VisitMut for CjsOptimizer {
{
if let Expr::Ident(ident) = &**callee {
if ident.span.ctxt == self.unresolved_ctxt && ident.sym == *"require" {
if let Some(arg) = args.get(0) {
if let Some(arg) = args.first() {
if let Expr::Lit(Lit::Str(v)) = &*arg.expr {
// TODO: Config
......
......@@ -39,6 +39,9 @@ __internal_dhat-heap = ["dhat"]
# effectively does nothing.
__internal_dhat-ad-hoc = ["dhat"]
[lints]
workspace = true
[dependencies]
anyhow = "1.0.66"
backtrace = "0.3"
......
......@@ -29,7 +29,6 @@ DEALINGS IN THE SOFTWARE.
#![recursion_limit = "2048"]
//#![deny(clippy::all)]
#![feature(arbitrary_self_types)]
#![feature(async_fn_in_trait)]
#[macro_use]
extern crate napi_derive;
......
......@@ -16,6 +16,9 @@ custom_allocator = [
"turbopack-binding/__turbo_tasks_malloc_custom_allocator",
]
[lints]
workspace = true
[dependencies]
anyhow = { workspace = true, features = ["backtrace"] }
futures = { workspace = true }
......
#![feature(future_join)]
#![feature(arbitrary_self_types)]
#![feature(async_fn_in_trait)]
mod app;
mod dynamic_imports;
......
......@@ -30,6 +30,9 @@ custom_allocator = [
serializable = []
profile = []
[lints]
workspace = true
[dependencies]
anyhow = { workspace = true }
async-recursion = { workspace = true }
......
#![feature(type_alias_impl_trait)]
#![feature(arbitrary_self_types)]
#![feature(async_fn_in_trait)]
use turbopack_binding::turbo::{
tasks::{run_once, TransientInstance, TurboTasks},
......
......@@ -8,6 +8,9 @@ edition = "2021"
[lib]
bench = false
[lints]
workspace = true
[dependencies]
anyhow = { workspace = true }
async-recursion = { workspace = true }
......
......@@ -4,7 +4,6 @@
#![feature(str_split_remainder)]
#![feature(impl_trait_in_assoc_type)]
#![feature(arbitrary_self_types)]
#![feature(async_fn_in_trait)]
mod app_segment_config;
pub mod app_structure;
......
......@@ -237,12 +237,14 @@ pub async fn get_client_module_options_context(
.cell()
});
let use_lightningcss = *next_config.use_lightningcss().await?;
let source_transforms = vec![
*get_swc_ecma_transform_plugin(project_path, next_config).await?,
*get_relay_transform_plugin(next_config).await?,
*get_emotion_transform_plugin(next_config).await?,
*get_styled_components_transform_plugin(next_config).await?,
*get_styled_jsx_transform_plugin().await?,
*get_styled_jsx_transform_plugin(use_lightningcss).await?,
]
.into_iter()
.flatten()
......@@ -302,6 +304,7 @@ pub async fn get_client_module_options_context(
),
],
custom_rules,
use_lightningcss,
..module_options_context
}
.cell();
......
......@@ -3,10 +3,14 @@ use turbo_tasks::Vc;
use turbopack_binding::turbopack::{
core::{
asset::{Asset, AssetContent},
chunk::ChunkingContext,
ident::AssetIdent,
module::Module,
},
turbopack::css::{chunk::CssChunkPlaceable, ParseCss, ParseCssResult},
turbopack::css::{
chunk::CssChunkPlaceable, CssWithPlaceholderResult, FinalCssResult, ParseCss,
ParseCssResult, ProcessCss,
},
};
/// A [`CssClientReferenceModule`] is a marker module used to indicate which
......@@ -63,3 +67,29 @@ impl ParseCss for CssClientReferenceModule {
Ok(parse_css.parse_css())
}
}
#[turbo_tasks::value_impl]
impl ProcessCss for CssClientReferenceModule {
#[turbo_tasks::function]
async fn get_css_with_placeholder(&self) -> Result<Vc<CssWithPlaceholderResult>> {
let Some(imp) = Vc::try_resolve_sidecast::<Box<dyn ProcessCss>>(self.client_module).await?
else {
bail!("CSS client reference client module must be CSS processable");
};
Ok(imp.get_css_with_placeholder())
}
#[turbo_tasks::function]
async fn finalize_css(
&self,
chunking_context: Vc<Box<dyn ChunkingContext>>,
) -> Result<Vc<FinalCssResult>> {
let Some(imp) = Vc::try_resolve_sidecast::<Box<dyn ProcessCss>>(self.client_module).await?
else {
bail!("CSS client reference client module must be CSS processable");
};
Ok(imp.finalize_css(chunking_context))
}
}
......@@ -503,6 +503,8 @@ pub struct ExperimentalConfig {
/// (doesn't apply to Turbopack).
webpack_build_worker: Option<bool>,
worker_threads: Option<bool>,
use_lightningcss: Option<bool>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TraceRawVcs)]
......@@ -765,6 +767,13 @@ impl NextConfig {
pub async fn enable_taint(self: Vc<Self>) -> Result<Vc<bool>> {
Ok(Vc::cell(self.await?.experimental.taint.unwrap_or(false)))
}
#[turbo_tasks::function]
pub async fn use_lightningcss(self: Vc<Self>) -> Result<Vc<bool>> {
Ok(Vc::cell(
self.await?.experimental.use_lightningcss.unwrap_or(false),
))
}
}
fn next_configs() -> Vc<Vec<String>> {
......
......@@ -2,5 +2,4 @@ pub(crate) mod content_source;
pub(crate) mod module;
pub(crate) mod source_asset;
pub use content_source::NextImageContentSource;
pub use module::StructuredImageModuleType;
......@@ -291,10 +291,12 @@ pub async fn get_server_module_options_context(
.cell()
});
let use_lightningcss = *next_config.use_lightningcss().await?;
// EcmascriptTransformPlugins for custom transforms
let styled_components_transform_plugin =
*get_styled_components_transform_plugin(next_config).await?;
let styled_jsx_transform_plugin = *get_styled_jsx_transform_plugin().await?;
let styled_jsx_transform_plugin = *get_styled_jsx_transform_plugin(use_lightningcss).await?;
// ModuleOptionsContext related options
let tsconfig = get_typescript_transform_options(project_path);
......@@ -363,6 +365,7 @@ pub async fn get_server_module_options_context(
let module_options_context = ModuleOptionsContext {
execution_context: Some(execution_context),
esm_url_rewrite_behavior: url_rewrite_behavior,
use_lightningcss,
..Default::default()
};
......@@ -431,6 +434,7 @@ pub async fn get_server_module_options_context(
let module_options_context = ModuleOptionsContext {
custom_ecma_transform_plugins: base_ecma_transform_plugins,
execution_context: Some(execution_context),
use_lightningcss,
..Default::default()
};
let foreign_code_module_options_context = ModuleOptionsContext {
......@@ -515,6 +519,7 @@ pub async fn get_server_module_options_context(
let module_options_context = ModuleOptionsContext {
custom_ecma_transform_plugins: base_ecma_transform_plugins,
execution_context: Some(execution_context),
use_lightningcss,
..Default::default()
};
let foreign_code_module_options_context = ModuleOptionsContext {
......
......@@ -7,8 +7,10 @@ use turbopack_binding::turbopack::{
/// Returns a transform plugin for the relay graphql transform.
#[turbo_tasks::function]
pub async fn get_styled_jsx_transform_plugin() -> Result<Vc<OptionTransformPlugin>> {
pub async fn get_styled_jsx_transform_plugin(
use_lightningcss: bool,
) -> Result<Vc<OptionTransformPlugin>> {
Ok(Vc::cell(Some(Vc::cell(
Box::new(StyledJsxTransformer::new()) as _,
Box::new(StyledJsxTransformer::new(use_lightningcss)) as _,
))))
}
......@@ -2,7 +2,7 @@ use anyhow::{bail, Context, Result};
use indexmap::{IndexMap, IndexSet};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use serde_json::Value as JsonValue;
use swc_core::ecma::ast::Program;
use swc_core::ecma::ast::{Expr, Lit, Program};
use turbo_tasks::{trace::TraceRawVcs, TaskInput, ValueDefault, ValueToString, Vc};
use turbo_tasks_fs::{rope::Rope, util::join_path, File};
use turbopack_binding::{
......@@ -224,9 +224,11 @@ pub async fn parse_config_from_source(module: Vc<Box<dyn Module>>) -> Result<Vc<
.and_then(|export_decl| export_decl.decl.as_var())
{
for decl in &decl.decls {
if decl
.name
.as_ident()
let decl_ident = decl.name.as_ident();
// Check if there is exported config object `export const config = {...}`
// https://nextjs.org/docs/app/building-your-application/routing/middleware#matcher
if decl_ident
.map(|ident| &*ident.sym == "config")
.unwrap_or_default()
{
......@@ -246,6 +248,56 @@ pub async fn parse_config_from_source(module: Vc<Box<dyn Module>>) -> Result<Vc<
.emit()
}
}
// Or, check if there is segment runtime option
// https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes#segment-runtime-Option
else if decl_ident
.map(|ident| &*ident.sym == "runtime")
.unwrap_or_default()
{
let runtime_value_issue = NextSourceConfigParsingIssue {
ident: module.ident(),
detail: Vc::cell(
"The runtime property must be either \"nodejs\" or \"edge\"."
.to_string(),
),
}
.cell();
if let Some(init) = decl.init.as_ref() {
// skipping eval and directly read the expr's value, as we know it
// should be a const string
if let Expr::Lit(Lit::Str(str_value)) = &**init {
let mut config = NextSourceConfig::default();
let runtime = str_value.value.to_string();
match runtime.as_str() {
"edge" | "experimental-edge" => {
config.runtime = NextRuntime::Edge;
}
"nodejs" => {
config.runtime = NextRuntime::NodeJs;
}
_ => {
runtime_value_issue.emit();
}
}
return Ok(config.cell());
} else {
runtime_value_issue.emit();
}
} else {
NextSourceConfigParsingIssue {
ident: module.ident(),
detail: Vc::cell(
"The exported segment runtime option must contain an \
variable initializer."
.to_string(),
),
}
.cell()
.emit()
}
}
}
}
}
......
......@@ -9,6 +9,9 @@ autobenches = false
[lib]
bench = false
[lints]
workspace = true
[dependencies]
pathdiff = { workspace = true }
......
......@@ -8,6 +8,9 @@ edition = "2021"
[lib]
bench = false
[lints]
workspace = true
[dependencies]
rustc-hash = { workspace = true }
serde = { workspace = true }
......
......@@ -87,7 +87,7 @@ impl<'a> FontImportsGenerator<'a> {
}
fn check_var_decl(&mut self, var_decl: &VarDecl) -> Option<Ident> {
if let Some(decl) = var_decl.decls.get(0) {
if let Some(decl) = var_decl.decls.first() {
let ident = match &decl.name {
Pat::Ident(ident) => Ok(ident.id.clone()),
pattern => Err(pattern),
......
......@@ -9,6 +9,9 @@ autobenches = false
[lib]
bench = false
[lints]
workspace = true
[dependencies]
rustc-hash = { workspace = true }
tracing = { workspace = true }
......
......@@ -13,6 +13,9 @@ swc_v1 = []
plugin = ["getrandom/js", "turbopack-binding/__swc_core_binding_wasm_plugin"]
[lints]
workspace = true
[dependencies]
anyhow = "1.0.66"
console_error_panic_hook = "0.1.6"
......
{
"name": "@next/swc",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
......
{
"name": "next",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
......@@ -92,7 +92,7 @@
]
},
"dependencies": {
"@next/env": "14.0.4-canary.1",
"@next/env": "14.0.4-canary.6",
"@swc/helpers": "0.5.2",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001406",
......@@ -146,11 +146,11 @@
"@mswjs/interceptors": "0.23.0",
"@napi-rs/cli": "2.16.2",
"@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "14.0.4-canary.1",
"@next/polyfill-nomodule": "14.0.4-canary.1",
"@next/react-dev-overlay": "14.0.4-canary.1",
"@next/react-refresh-utils": "14.0.4-canary.1",
"@next/swc": "14.0.4-canary.1",
"@next/polyfill-module": "14.0.4-canary.6",
"@next/polyfill-nomodule": "14.0.4-canary.6",
"@next/react-dev-overlay": "14.0.4-canary.6",
"@next/react-refresh-utils": "14.0.4-canary.6",
"@next/swc": "14.0.4-canary.6",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "^1.35.1",
"@taskr/clear": "1.1.0",
......@@ -193,7 +193,7 @@
"@types/ws": "8.2.0",
"@vercel/ncc": "0.34.0",
"@vercel/nft": "0.22.6",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231113.3",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231120.2",
"acorn": "8.5.0",
"amphtml-validator": "1.0.35",
"anser": "1.4.9",
......
......@@ -55,10 +55,28 @@ async function extractBinary(
return body.pipeTo(
new WritableStream({
write(chunk) {
cacheWriteStream.write(chunk)
return new Promise<void>((resolve, reject) =>
cacheWriteStream.write(chunk, (error) => {
if (error) {
reject(error)
return
}
resolve()
})
)
},
close() {
cacheWriteStream.close()
return new Promise<void>((resolve, reject) =>
cacheWriteStream.close((error) => {
if (error) {
reject(error)
return
}
resolve()
})
)
},
})
)
......
......@@ -66,6 +66,7 @@ const supportedTurbopackNextConfigOptions = [
'experimental.useDeploymentId',
'experimental.useDeploymentIdServerActions',
'experimental.deploymentId',
'experimental.useLightningcss',
// Experimental options that don't affect compilation
'experimental.ppr',
......
......@@ -346,7 +346,7 @@ function createServerComponentsRenderer(
appUsingSizeAdjustment: appUsingSizeAdjustment,
})
const { Component: ComponentTree, styles } = await createComponentTree({
const { seedData, styles } = await createComponentTree({
ctx,
createSegmentPath: (child) => child,
loaderTree: loaderTreeToRender,
......@@ -359,7 +359,7 @@ function createServerComponentsRenderer(
asNotFound: props.asNotFound,
metadataOutlet: <MetadataOutlet />,
})
const componentTree = seedData[2]
return (
<>
{styles}
......@@ -367,7 +367,15 @@ function createServerComponentsRenderer(
buildId={ctx.renderOpts.buildId}
assetPrefix={ctx.assetPrefix}
initialCanonicalUrl={urlPathname}
// This is the router state tree.
initialTree={initialTree}
// This is the tree of React nodes that are seeded into the cache
// TODO: This will be passed as a prop in a later PR. Then we will use
// this prop to populate the cache nodes as soon as the app router
// receives the response. This will replace the `initialChildNode`
// that's currently passed to Layout Router.
//
// cacheNodeSeedData={seedData}
initialHead={
<>
{ctx.res.statusCode > 400 && (
......@@ -379,7 +387,7 @@ function createServerComponentsRenderer(
}
globalErrorComponent={GlobalError}
>
<ComponentTree />
{componentTree}
</AppRouter>
</>
)
......
import type { FlightSegmentPath } from './types'
import type { FlightSegmentPath, CacheNodeSeedData } from './types'
import React from 'react'
import { isClientReference } from '../../lib/client-reference'
import { getLayoutOrPageModule } from '../lib/app-dir-module'
......@@ -41,7 +41,7 @@ export async function createComponentTree({
metadataOutlet?: React.ReactNode
ctx: AppRenderContext
}): Promise<{
Component: React.ComponentType
seedData: CacheNodeSeedData
styles: React.ReactNode
}> {
const {
......@@ -286,9 +286,17 @@ export async function createComponentTree({
const actualSegment = segmentParam ? segmentParam.treeSegment : segment
// This happens outside of rendering in order to eagerly kick off data fetching for layouts / the page further down
// TODO: Once we're done refactoring the Flight response type so that all the
// tree nodes are passed at the root of the response, we'll no longer need to
// do anything extra to preload the nested layouts; all of the child nodes will
// automatically be rendered in parallel by React. Then, to simplify the code,
// we should combine this `map` traversal with the loop below that turns
// the array into an object.
const parallelRouteMap = await Promise.all(
Object.keys(parallelRoutes).map(
async (parallelRouteKey): Promise<[string, React.ReactNode]> => {
async (
parallelRouteKey
): Promise<[string, React.ReactNode, CacheNodeSeedData | null]> => {
const isChildrenRouteKey = parallelRouteKey === 'children'
const currentSegmentPath: FlightSegmentPath = firstItem
? [parallelRouteKey]
......@@ -306,6 +314,7 @@ export async function createComponentTree({
// We also want to bail out if there's no Loading component in the tree.
let currentStyles = undefined
let initialChildNode = null
let childCacheNodeSeedData = null
const childPropSegment = addSearchParamsIfPageSegment(
childSegmentParam ? childSegmentParam.treeSegment : childSegment,
query
......@@ -317,7 +326,7 @@ export async function createComponentTree({
)
) {
// Create the child component
const { Component: ChildComponent, styles: childComponentStyles } =
const { seedData, styles: childComponentStyles } =
await createComponentTree({
createSegmentPath: (child) => {
return createSegmentPath([...currentSegmentPath, ...child])
......@@ -334,7 +343,8 @@ export async function createComponentTree({
})
currentStyles = childComponentStyles
initialChildNode = <ChildComponent />
initialChildNode = seedData[2]
childCacheNodeSeedData = seedData
}
// This is turned back into an object below.
......@@ -367,24 +377,32 @@ export async function createComponentTree({
childPropSegment={childPropSegment}
styles={currentStyles}
/>,
childCacheNodeSeedData,
]
}
)
)
// Convert the parallel route map into an object after all promises have been resolved.
const parallelRouteComponents = parallelRouteMap.reduce(
(list, [parallelRouteKey, Comp]) => {
list[parallelRouteKey] = Comp
return list
},
{} as { [key: string]: React.ReactNode }
)
let parallelRouteProps: { [key: string]: React.ReactNode } = {}
let parallelRouteCacheNodeSeedData: {
[key: string]: CacheNodeSeedData | null
} = {}
for (const parallelRoute of parallelRouteMap) {
const [parallelRouteKey, parallelRouteProp, flightData] = parallelRoute
parallelRouteProps[parallelRouteKey] = parallelRouteProp
parallelRouteCacheNodeSeedData[parallelRouteKey] = flightData
}
// When the segment does not have a layout or page we still have to add the layout router to ensure the path holds the loading component
if (!Component) {
return {
Component: () => <>{parallelRouteComponents.children}</>,
// TODO: I don't think the extra fragment is necessary. React treats top
// level fragments as transparent, i.e. the runtime behavior should be
// identical even without it. But maybe there's some findDOMNode-related
// reason that I'm not aware of, so I'm leaving it as-is out of extreme
// caution, for now.
seedData: [actualSegment, null, <>{parallelRouteProps.children}</>],
styles: layerAssets,
}
}
......@@ -416,7 +434,7 @@ export async function createComponentTree({
}
const props = {
...parallelRouteComponents,
...parallelRouteProps,
...notFoundComponent,
// TODO-APP: params and query have to be blocked parallel route names. Might have to add a reserved name list.
// Params are always the current params that apply to the layout
......@@ -435,6 +453,9 @@ export async function createComponentTree({
}
// Eagerly execute layout/page component to trigger fetches early.
// TODO: We can delete this once we start passing the nested layouts at the
// top-level of the Flight response, because React will render them in
// parallel automatically.
if (!isClientComponent) {
Component = await Promise.resolve().then(() =>
preloadComponent(Component, props)
......@@ -442,21 +463,22 @@ export async function createComponentTree({
}
return {
Component: () => {
return (
<>
{isPage ? metadataOutlet : null}
{/* <Component /> needs to be the first element because we use `findDOMNode` in layout router to locate it. */}
{isPage && isClientComponent ? (
<StaticGenerationSearchParamsBailoutProvider
propsForComponent={props}
Component={Component}
isStaticGeneration={staticGenerationStore.isStaticGeneration}
/>
) : (
<Component {...props} />
)}
{/* This null is currently critical. The wrapped Component can render null and if there was not fragment
seedData: [
actualSegment,
parallelRouteCacheNodeSeedData,
<>
{isPage ? metadataOutlet : null}
{/* <Component /> needs to be the first element because we use `findDOMNode` in layout router to locate it. */}
{isPage && isClientComponent ? (
<StaticGenerationSearchParamsBailoutProvider
propsForComponent={props}
Component={Component}
isStaticGeneration={staticGenerationStore.isStaticGeneration}
/>
) : (
<Component {...props} />
)}
{/* This null is currently critical. The wrapped Component can render null and if there was not fragment
surrounding it this would look like a pending tree data state on the client which will cause an errror
and break the app. Long-term we need to move away from using null as a partial tree identifier since it
is a valid return type for the components we wrap. Once we make this change we can safely remove the
......@@ -464,10 +486,9 @@ export async function createComponentTree({
If the Component above renders null the actual treedata will look like `[null, null]`. If we remove the extra
null it will look like `null` (the array is elided) and this is what confuses the client router.
TODO-APP update router to use a Symbol for partial tree detection */}
{null}
</>
)
},
{null}
</>,
],
styles: layerAssets,
}
}
......@@ -62,6 +62,21 @@ export type FlightSegmentPath =
parallelRouterKey: string
]
/**
* Represents a tree of segments and the Flight data (i.e. React nodes) that
* correspond to each one. The tree is isomorphic to the FlightRouterState;
* however in the future we want to be able to fetch arbitrary partial segments
* without having to fetch all its children. So this response format will
* likely change.
*/
export type CacheNodeSeedData = [
segment: Segment,
parallelRoutes: {
[parallelRouterKey: string]: CacheNodeSeedData | null
} | null,
node: React.ReactNode | null
]
export type FlightDataPath =
// Uses `any` as repeating pattern can't be typed.
| any[]
......
......@@ -136,9 +136,12 @@ export async function walkTreeWithFlightRouterState({
shouldSkipComponentTree
? null
: // Create component tree using the slice of the loaderTree
// TODO: Not sure why this ts error started happening, after a
// seemingly innocuous change. But I'm also not sure why this extra
// wrapper element exists. We should just remove it.
// @ts-expect-error: Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method.
React.createElement(async () => {
const { Component } = await createComponentTree(
const { seedData } = await createComponentTree(
// This ensures flightRouterPath is valid and filters down the tree
{
ctx,
......@@ -155,8 +158,8 @@ export async function walkTreeWithFlightRouterState({
metadataOutlet,
}
)
return <Component />
const componentNode = seedData[2]
return componentNode
}),
shouldSkipComponentTree
? null
......
......@@ -368,6 +368,7 @@ export const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>
bundlePagesExternals: z.boolean().optional(),
staticWorkerRequestDeduping: z.boolean().optional(),
useWasmBinary: z.boolean().optional(),
useLightningcss: z.boolean().optional(),
})
.optional(),
exportPathMap: z
......
......@@ -342,6 +342,11 @@ export interface ExperimentalConfig {
staticWorkerRequestDeduping?: boolean
useWasmBinary?: boolean
/**
* Use lightningcss instead of swc_css
*/
useLightningcss?: boolean
}
export type ExportPathMap = {
......
import type { NextConfigComplete } from '../config-shared'
import type { IncomingMessage, ServerResponse } from 'http'
import type { RenderServer } from './router-server'
import '../require-hook'
import url from 'url'
import path from 'path'
import { findPageFile } from './find-page-file'
import { getRequestMeta } from '../request-meta'
import setupDebug from 'next/dist/compiled/debug'
import { getCloneableBody } from '../body-streams'
import { findPagesDir } from '../../lib/find-pages-dir'
import { setupFsCheck } from './router-utils/filesystem'
import { proxyRequest } from './router-utils/proxy-request'
import { getResolveRoutes } from './router-utils/resolve-routes'
import { PERMANENT_REDIRECT_STATUS } from '../../shared/lib/constants'
import { formatHostname } from './format-hostname'
import { signalFromNodeResponse } from '../web/spec-extension/adapters/next-request'
import { getMiddlewareRouteMatcher } from '../../shared/lib/router/utils/middleware-route-matcher'
import { pipeToNodeResponse } from '../pipe-readable'
type RouteResult =
| {
type: 'rewrite'
url: string
statusCode: number
headers: Record<string, undefined | number | string | string[]>
}
| {
type: 'error'
error: {
name: string
message: string
stack: any[]
}
}
| {
type: 'none'
}
type MiddlewareConfig = {
matcher: string[] | null
files: string[]
}
type ServerAddress = {
hostname?: string
port?: number
}
const debug = setupDebug('next:router-server')
export async function makeResolver(
dir: string,
nextConfig: NextConfigComplete,
middleware: MiddlewareConfig,
{ hostname = 'localhost', port = 3000 }: Partial<ServerAddress>
) {
const fsChecker = await setupFsCheck({
dir,
dev: true,
minimalMode: false,
config: nextConfig,
})
const { appDir, pagesDir } = findPagesDir(dir)
// we format the hostname so that it can be fetched
const fetchHostname = formatHostname(hostname)
fsChecker.ensureCallback(async (item) => {
let result: string | null = null
if (item.type === 'appFile') {
if (!appDir) {
throw new Error('no app dir present')
}
result = await findPageFile(
appDir,
item.itemPath,
nextConfig.pageExtensions,
true
)
} else if (item.type === 'pageFile') {
if (!pagesDir) {
throw new Error('no pages dir present')
}
result = await findPageFile(
pagesDir,
item.itemPath,
nextConfig.pageExtensions,
false
)
}
if (!result) {
throw new Error(`failed to find page file ${item.type} ${item.itemPath}`)
}
})
const distDir = path.join(dir, nextConfig.distDir)
const middlewareInfo = middleware
? {
name: 'middleware',
paths: middleware.files.map((file) => path.join(process.cwd(), file)),
wasm: [],
assets: [],
}
: {}
if (middleware?.files.length) {
fsChecker.middlewareMatcher = getMiddlewareRouteMatcher(
middleware.matcher?.map((item) => ({
regexp: item,
originalSource: item,
})) || [{ regexp: '.*', originalSource: '/:path*' }]
)
}
const resolveRoutes = getResolveRoutes(
fsChecker,
nextConfig,
{
dir,
port,
hostname,
isNodeDebugging: false,
dev: true,
},
{
async initialize() {
return {
async requestHandler(req, res) {
if (!req.headers['x-middleware-invoke']) {
throw new Error(`Invariant unexpected request handler call`)
}
const cloneableBody = getCloneableBody(req)
const { run } =
require('../web/sandbox') as typeof import('../web/sandbox')
const result = await run({
distDir,
name: middlewareInfo.name || '/',
paths: middlewareInfo.paths || [],
edgeFunctionEntry: middlewareInfo,
request: {
headers: req.headers,
method: req.method || 'GET',
nextConfig: {
i18n: nextConfig.i18n,
basePath: nextConfig.basePath,
trailingSlash: nextConfig.trailingSlash,
},
url: `http://${fetchHostname}:${port}${req.url}`,
body: cloneableBody,
signal: signalFromNodeResponse(res),
},
useCache: true,
onWarning: console.warn,
})
const err = new Error()
;(err as any).result = result
throw err
},
async upgradeHandler() {
throw new Error(`Invariant: unexpected upgrade handler call`)
},
}
},
deleteAppClientCache() {},
async deleteCache() {},
async clearModuleContext() {},
async propagateServerField() {},
} as Partial<RenderServer> as any,
{} as any
)
return async function resolveRoute(
req: IncomingMessage,
res: ServerResponse
): Promise<RouteResult | void> {
const routeResult = await resolveRoutes({
req,
res,
isUpgradeReq: false,
signal: signalFromNodeResponse(res),
})
const {
matchedOutput,
bodyStream,
statusCode,
parsedUrl,
resHeaders,
finished,
} = routeResult
debug('requestHandler!', req.url, {
matchedOutput,
statusCode,
resHeaders,
bodyStream: !!bodyStream,
parsedUrl: {
pathname: parsedUrl.pathname,
query: parsedUrl.query,
},
finished,
})
for (const key of Object.keys(resHeaders || {})) {
res.setHeader(key, resHeaders[key])
}
if (!bodyStream && statusCode && statusCode > 300 && statusCode < 400) {
const destination = url.format(parsedUrl)
res.statusCode = statusCode
res.setHeader('location', destination)
if (statusCode === PERMANENT_REDIRECT_STATUS) {
res.setHeader('Refresh', `0;url=${destination}`)
}
res.end(destination)
return
}
// handle middleware body response
if (bodyStream) {
res.statusCode = statusCode || 200
return await pipeToNodeResponse(bodyStream, res)
}
if (finished && parsedUrl.protocol) {
await proxyRequest(
req,
res,
parsedUrl,
undefined,
getRequestMeta(req, 'clonableBody')?.cloneBodyStream(),
nextConfig.experimental.proxyTimeout
)
return
}
res.setHeader('x-nextjs-route-result', '1')
res.end()
return {
type: 'rewrite',
statusCode: 200,
headers: resHeaders,
url: url.format(parsedUrl),
}
}
}
{
"name": "@next/react-dev-overlay",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"description": "A development-only overlay for developing React applications.",
"repository": {
"url": "vercel/next.js",
......
{
"name": "@next/react-refresh-utils",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
......
{
"name": "@next/third-parties",
"version": "14.0.4-canary.1",
"version": "14.0.4-canary.6",
"repository": {
"url": "vercel/next.js",
"directory": "packages/third-parties"
......@@ -23,7 +23,7 @@
"third-party-capital": "1.0.20"
},
"devDependencies": {
"next": "14.0.4-canary.1",
"next": "14.0.4-canary.6",
"outdent": "0.8.0",
"prettier": "2.5.1"
},
......
......@@ -735,7 +735,7 @@ importers:
packages/eslint-config-next:
dependencies:
'@next/eslint-plugin-next':
specifier: 14.0.4-canary.1
specifier: 14.0.4-canary.6
version: link:../eslint-plugin-next
'@rushstack/eslint-patch':
specifier: ^1.3.3
......@@ -800,7 +800,7 @@ importers:
packages/next:
dependencies:
'@next/env':
specifier: 14.0.4-canary.1
specifier: 14.0.4-canary.6
version: link:../next-env
'@swc/helpers':
specifier: 0.5.2
......@@ -924,19 +924,19 @@ importers:
specifier: 1.1.0
version: 1.1.0
'@next/polyfill-module':
specifier: 14.0.4-canary.1
specifier: 14.0.4-canary.6
version: link:../next-polyfill-module
'@next/polyfill-nomodule':
specifier: 14.0.4-canary.1
specifier: 14.0.4-canary.6
version: link:../next-polyfill-nomodule
'@next/react-dev-overlay':
specifier: 14.0.4-canary.1
specifier: 14.0.4-canary.6
version: link:../react-dev-overlay
'@next/react-refresh-utils':
specifier: 14.0.4-canary.1
specifier: 14.0.4-canary.6
version: link:../react-refresh-utils
'@next/swc':
specifier: 14.0.4-canary.1
specifier: 14.0.4-canary.6
version: link:../next-swc
'@opentelemetry/api':
specifier: 1.6.0
......@@ -1065,8 +1065,8 @@ importers:
specifier: 0.22.6
version: 0.22.6
'@vercel/turbopack-ecmascript-runtime':
specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231113.3
version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231113.3(react-refresh@0.12.0)(webpack@5.86.0)'
specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231120.2
version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231120.2(react-refresh@0.12.0)(webpack@5.86.0)'
acorn:
specifier: 8.5.0
version: 8.5.0
......@@ -1587,7 +1587,7 @@ importers:
version: 1.0.20
devDependencies:
next:
specifier: 14.0.4-canary.1
specifier: 14.0.4-canary.6
version: link:../next
outdent:
specifier: 0.8.0
......@@ -24646,9 +24646,9 @@ packages:
/zwitch@2.0.4:
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
'@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231113.3(react-refresh@0.12.0)(webpack@5.86.0)':
resolution: {registry: https://registry.npmjs.org/, tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231113.3}
id: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231113.3'
'@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231120.2(react-refresh@0.12.0)(webpack@5.86.0)':
resolution: {registry: https://registry.npmjs.org/, tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231120.2}
id: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231120.2'
name: '@vercel/turbopack-ecmascript-runtime'
version: 0.0.0
dependencies:
......
nightly-2023-10-06
nightly-2023-11-16
......@@ -6,6 +6,9 @@ publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lints]
workspace = true
[dependencies]
serde_json = "1.0.59"
reqwest = { version = "0.11.6", features = ["blocking"] }
\ No newline at end of file
export default function Root({ children }: { children: React.ReactNode }) {
return (
<html>
<body>{children}</body>
</html>
)
}
import styles from './style.module.css'
export default function Page() {
return <p className={styles.blue}>hello world</p>
}
import { nextTestSetup } from 'e2e-utils'
import { describeVariants as describe } from 'next-test-utils'
describe.each(['turbo'])('experimental-lightningcss', () => {
const { next } = nextTestSetup({
files: __dirname,
})
it('should support css modules', async () => {
// Recommended for tests that check HTML. Cheerio is a HTML parser that has a jQuery like API.
const $ = await next.render$('/')
expect($('p').text()).toBe('hello world')
// swc_css does not include `-module` in the class name, while lightningcss does.
expect($('p').attr('class')).toBe('style-module__hlQ3RG__blue')
})
})
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
experimental: {
useLightningcss: true,
},
}
module.exports = nextConfig
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
......@@ -2454,6 +2454,7 @@
"test/e2e/app-dir/app-middleware/app-middleware.test.ts": {
"passed": [
"app dir - middleware without pages dir Updates headers",
"app dir - middleware with middleware in src dir works without crashing when using requestAsyncStorage",
"app-dir with middleware Mutate request headers for Edge Functions Supports draft mode",
"app-dir with middleware Mutate request headers for Serverless Functions Adds new headers",
"app-dir with middleware Mutate request headers for Serverless Functions Deletes headers",
......@@ -2463,14 +2464,12 @@
"app-dir with middleware Mutate request headers for next/headers Deletes headers",
"app-dir with middleware Mutate request headers for next/headers Supports draft mode",
"app-dir with middleware Mutate request headers for next/headers Updates headers",
"app-dir with middleware should filter correctly after middleware rewrite"
],
"failed": [
"app dir - middleware with middleware in src dir works without crashing when using requestAsyncStorage",
"app-dir with middleware Mutate request headers for Edge Functions Adds new headers",
"app-dir with middleware Mutate request headers for Edge Functions Deletes headers",
"app-dir with middleware Mutate request headers for Edge Functions Updates headers"
"app-dir with middleware Mutate request headers for Edge Functions Updates headers",
"app-dir with middleware should filter correctly after middleware rewrite"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -3356,7 +3355,6 @@
"app dir - metadata dynamic routes should use localhost for local prod and fallback to deployment url when metadataBase is falsy",
"app dir - metadata dynamic routes social image routes should fill params into dynamic routes url of metadata images",
"app dir - metadata dynamic routes social image routes should fill params into routes groups url of static images",
"app dir - metadata dynamic routes social image routes should handle custom fonts in both edge and nodejs runtime",
"app dir - metadata dynamic routes social image routes should handle manifest.[ext] dynamic routes",
"app dir - metadata dynamic routes social image routes should render og image with opengraph-image dynamic routes",
"app dir - metadata dynamic routes social image routes should render og image with twitter-image dynamic routes",
......@@ -3368,7 +3366,8 @@
"app dir - metadata dynamic routes text routes should not throw if client components are imported but not used"
],
"failed": [
"app dir - metadata dynamic routes should error if the default export of dynamic image is missing"
"app dir - metadata dynamic routes should error if the default export of dynamic image is missing",
"app dir - metadata dynamic routes social image routes should handle custom fonts in both edge and nodejs runtime"
],
"pending": [],
"flakey": [],
......@@ -14882,16 +14881,16 @@
},
"test/integration/url/test/index.test.js": {
"passed": [
"Handle new URL asset references in next dev should client-render the /ssg page",
"Handle new URL asset references in next dev should client-render the /ssr page",
"Handle new URL asset references in next dev should client-render the /static page",
"Handle new URL asset references in next dev should render the /ssg page",
"Handle new URL asset references in next dev should render the /ssr page",
"Handle new URL asset references in next dev should render the /static page",
"Handle new URL asset references in next dev should respond on basename api"
"Handle new URL asset references in next dev should respond on basename api",
"Handle new URL asset references in next dev should respond on size api"
],
"failed": [
"Handle new URL asset references in next dev should respond on size api"
"Handle new URL asset references in next dev should client-render the /ssg page",
"Handle new URL asset references in next dev should client-render the /ssr page"
],
"pending": [
"Handle new URL asset references in next build should client-render the /ssg page",
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