Commit fbfbb400 authored by Tim Neutkens's avatar Tim Neutkens

Update

parent 79e01a39
...@@ -44,6 +44,7 @@ The root `conductor.json` defines: ...@@ -44,6 +44,7 @@ The root `conductor.json` defines:
### Creating a New Workspace ### Creating a New Workspace
In the Conductor app: In the Conductor app:
1. Add this repository 1. Add this repository
2. Create a new workspace with a descriptive name 2. Create a new workspace with a descriptive name
3. The setup script will automatically install dependencies and build 3. The setup script will automatically install dependencies and build
...@@ -70,6 +71,7 @@ cd ../next.js-worktrees/my-feature ...@@ -70,6 +71,7 @@ cd ../next.js-worktrees/my-feature
## Managing Worktrees ## Managing Worktrees
View all worktrees: View all worktrees:
```bash ```bash
git worktree list git worktree list
``` ```
...@@ -77,16 +79,19 @@ git worktree list ...@@ -77,16 +79,19 @@ git worktree list
## Best Practices ## Best Practices
### Disk Space Management ### Disk Space Management
- Each worktree uses ~500MB-1GB after build - Each worktree uses ~500MB-1GB after build
- Run `pnpm sweep` periodically to clean Rust build artifacts - Run `pnpm sweep` periodically to clean Rust build artifacts
- Remove unused worktrees with `git worktree remove <path>` - Remove unused worktrees with `git worktree remove <path>`
### Development Workflow ### Development Workflow
1. **Never run `pnpm build` while `pnpm dev` is active** (causes build corruption) 1. **Never run `pnpm build` while `pnpm dev` is active** (causes build corruption)
2. Use `pnpm test-dev-turbo` for fastest test iteration 2. Use `pnpm test-dev-turbo` for fastest test iteration
3. Use `NEXT_SKIP_ISOLATE=1` for faster test runs during development 3. Use `NEXT_SKIP_ISOLATE=1` for faster test runs during development
### Parallel Agent Recommendations ### Parallel Agent Recommendations
- Limit to 3-4 concurrent agents to avoid: - Limit to 3-4 concurrent agents to avoid:
- GitHub API rate limits - GitHub API rate limits
- Disk space exhaustion - Disk space exhaustion
...@@ -95,7 +100,9 @@ git worktree list ...@@ -95,7 +100,9 @@ git worktree list
## Troubleshooting ## Troubleshooting
### Build Corruption ### Build Corruption
If builds become corrupted: If builds become corrupted:
```bash ```bash
# Kill any running dev processes # Kill any running dev processes
pkill -f "pnpm dev" pkill -f "pnpm dev"
...@@ -107,6 +114,7 @@ pnpm build ...@@ -107,6 +114,7 @@ pnpm build
``` ```
### Worktree Issues ### Worktree Issues
```bash ```bash
# List worktrees with status # List worktrees with status
git worktree list git worktree list
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"oxc.fmt.configPath": ".prettierrc.json", "oxc.fmt.configPath": ".prettierrc.json",
"oxc.requireConfig": true, "oxc.requireConfig": true,
// Formatting using oxfmt by default for all languages // Formatting using oxfmt by default for all languages
"editor.defaultFormatter": "oxc.oxc-vscode", "editor.defaultFormatter": "oxc.oxc-vscode",
// Formatting using oxfmt for JavaScript, overrides VSCode default. // Formatting using oxfmt for JavaScript, overrides VSCode default.
"[javascript]": { "[javascript]": {
"editor.defaultFormatter": "oxc.oxc-vscode" "editor.defaultFormatter": "oxc.oxc-vscode"
......
...@@ -4,7 +4,6 @@ A Next.js application for visualizing bundle sizes and analyzing dependencies us ...@@ -4,7 +4,6 @@ A Next.js application for visualizing bundle sizes and analyzing dependencies us
This package is not published to npm. Instead it's built and vendored into the main `next` package during its build process. This package is not published to npm. Instead it's built and vendored into the main `next` package during its build process.
## Features ## Features
- 📊 **Interactive Treemap**: Visualize bundle sizes with an interactive treemap interface - 📊 **Interactive Treemap**: Visualize bundle sizes with an interactive treemap interface
...@@ -16,5 +15,6 @@ This package is not published to npm. Instead it's built and vendored into the m ...@@ -16,5 +15,6 @@ This package is not published to npm. Instead it's built and vendored into the m
## Updating ## Updating
When landing non-trivial changes, consider updating the demo site: When landing non-trivial changes, consider updating the demo site:
* Site: https://turbopack-bundle-analyzer-demo.vercel.sh/
* Repo: https://github.com/vercel/turbopack-bundle-analyzer-demo - Site: https://turbopack-bundle-analyzer-demo.vercel.sh/
\ No newline at end of file - Repo: https://github.com/vercel/turbopack-bundle-analyzer-demo
...@@ -30,7 +30,8 @@ const badgeVariants = cva( ...@@ -30,7 +30,8 @@ const badgeVariants = cva(
) )
export interface BadgeProps export interface BadgeProps
extends React.HTMLAttributes<HTMLSpanElement>, extends
React.HTMLAttributes<HTMLSpanElement>,
VariantProps<typeof badgeVariants> {} VariantProps<typeof badgeVariants> {}
function Badge({ className, variant, ...props }: BadgeProps) { function Badge({ className, variant, ...props }: BadgeProps) {
......
...@@ -37,7 +37,8 @@ const buttonVariants = cva( ...@@ -37,7 +37,8 @@ const buttonVariants = cva(
) )
export interface ButtonProps export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>, extends
React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> { VariantProps<typeof buttonVariants> {
asChild?: boolean asChild?: boolean
} }
......
...@@ -2,8 +2,7 @@ import * as React from 'react' ...@@ -2,8 +2,7 @@ import * as React from 'react'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
export interface InputProps export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}
extends React.InputHTMLAttributes<HTMLInputElement> {}
const Input = React.forwardRef<HTMLInputElement, InputProps>( const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => { ({ className, type, ...props }, ref) => {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// inserted by rust code // inserted by rust code
declare const PAGE_PATH: string declare const PAGE_PATH: string
// Adapted from https://github.com/vercel/next.js/blob/b7f9f1f98fc8ab602e84825105b5727272b72e7d/packages/next/src/build/webpack/loaders/next-client-pages-loader.ts // Adapted from https://github.com/vercel/next.js/blob/b7f9f1f98fc8ab602e84825105b5727272b72e7d/packages/next/src/build/webpack/loaders/next-client-pages-loader.ts
;(window.__NEXT_P = window.__NEXT_P || []).push([ ;(window.__NEXT_P = window.__NEXT_P || []).push([
PAGE_PATH, PAGE_PATH,
() => { () => {
......
...@@ -18,7 +18,6 @@ This plugin transforms Next.js source code by: ...@@ -18,7 +18,6 @@ This plugin transforms Next.js source code by:
## Build Process Details ## Build Process Details
- **Two-Pass Build:** - **Two-Pass Build:**
1. **First Pass:** 1. **First Pass:**
- Extracts new errors and temporarily stores them in `packages/next/.errors/*.json`. - Extracts new errors and temporarily stores them in `packages/next/.errors/*.json`.
- In CI, a build with new errors will fail. - In CI, a build with new errors will fail.
...@@ -31,7 +30,6 @@ This plugin transforms Next.js source code by: ...@@ -31,7 +30,6 @@ This plugin transforms Next.js source code by:
## Modifying the Plugin ## Modifying the Plugin
- **WASM Rebuild Required:** - **WASM Rebuild Required:**
- After modifying the plugin, rebuild the WASM file via `pnpm build-error-code-plugin` and commit it to the repository. - After modifying the plugin, rebuild the WASM file via `pnpm build-error-code-plugin` and commit it to the repository.
- **Reason:** Pre-built artifacts simplify the build process (`pnpm build` runs without requiring `cargo`). - **Reason:** Pre-built artifacts simplify the build process (`pnpm build` runs without requiring `cargo`).
......
// Return attributes and values of a node in a convenient way: // Return attributes and values of a node in a convenient way:
/* example: /* example:
<ExampleElement attr1="15" attr2> <ExampleElement attr1="15" attr2>
{ attr1: { { attr1: {
hasValue: true, hasValue: true,
......
...@@ -31,9 +31,8 @@ async function webpackFinal(config) { ...@@ -31,9 +31,8 @@ async function webpackFinal(config) {
// we need to resolve next-babel-loader since it's not available // we need to resolve next-babel-loader since it's not available
// relative with storybook's config // relative with storybook's config
if (rule.use && rule.use.loader === 'next-babel-loader') { if (rule.use && rule.use.loader === 'next-babel-loader') {
rule.use.loader = require.resolve( rule.use.loader =
'next/dist/build/webpack/loaders/next-babel-loader' require.resolve('next/dist/build/webpack/loaders/next-babel-loader')
)
} }
return rule return rule
}), }),
......
...@@ -68,6 +68,7 @@ Each route can have: ...@@ -68,6 +68,7 @@ Each route can have:
### Redirects ### Redirects
When a route has: When a route has:
- A redirect status code (300-399) - A redirect status code (300-399)
- Headers containing `Location` or `Refresh` - Headers containing `Location` or `Refresh`
......
...@@ -42,6 +42,7 @@ Contributions to Next.js are welcome and highly appreciated. However, before you ...@@ -42,6 +42,7 @@ Contributions to Next.js are welcome and highly appreciated. However, before you
We have a list of **[good first issues](https://github.com/vercel/next.js/labels/good%20first%20issue)** that contain bugs that have a relatively limited scope. This is a great place for newcomers and beginners alike to get started, gain experience, and get familiar with our contribution process. We have a list of **[good first issues](https://github.com/vercel/next.js/labels/good%20first%20issue)** that contain bugs that have a relatively limited scope. This is a great place for newcomers and beginners alike to get started, gain experience, and get familiar with our contribution process.
--- ---
## Security ## Security
If you believe you have found a security vulnerability in Next.js, we encourage you to **_responsibly disclose this and NOT open a public issue_**. If you believe you have found a security vulnerability in Next.js, we encourage you to **_responsibly disclose this and NOT open a public issue_**.
......
...@@ -120,9 +120,8 @@ module.exports = ({ dev, ...rest }) => { ...@@ -120,9 +120,8 @@ module.exports = ({ dev, ...rest }) => {
// We've experienced `singletonStyleTag` that the later updated styles not being applied. // We've experienced `singletonStyleTag` that the later updated styles not being applied.
// Keep using `styleTag` to ensure when new styles injected the style can also be updated. // Keep using `styleTag` to ensure when new styles injected the style can also be updated.
injectType: 'styleTag', injectType: 'styleTag',
insert: require.resolve( insert:
'./src/build/webpack/loaders/devtool/devtool-style-inject.js' require.resolve('./src/build/webpack/loaders/devtool/devtool-style-inject.js'),
),
}, },
}, },
{ loader: 'css-loader', options: { sourceMap: false } }, { loader: 'css-loader', options: { sourceMap: false } },
......
...@@ -510,27 +510,20 @@ export function createVendoredReactAliases( ...@@ -510,27 +510,20 @@ export function createVendoredReactAliases(
export function getOptimizedModuleAliases(): CompilerAliases { export function getOptimizedModuleAliases(): CompilerAliases {
return { return {
unfetch: require.resolve('next/dist/build/polyfills/fetch/index.js'), unfetch: require.resolve('next/dist/build/polyfills/fetch/index.js'),
'isomorphic-unfetch': require.resolve( 'isomorphic-unfetch':
'next/dist/build/polyfills/fetch/index.js' require.resolve('next/dist/build/polyfills/fetch/index.js'),
), 'whatwg-fetch':
'whatwg-fetch': require.resolve( require.resolve('next/dist/build/polyfills/fetch/whatwg-fetch.js'),
'next/dist/build/polyfills/fetch/whatwg-fetch.js' 'object-assign':
), require.resolve('next/dist/build/polyfills/object-assign.js'),
'object-assign': require.resolve( 'object.assign/auto':
'next/dist/build/polyfills/object-assign.js' require.resolve('next/dist/build/polyfills/object.assign/auto.js'),
), 'object.assign/implementation':
'object.assign/auto': require.resolve( require.resolve('next/dist/build/polyfills/object.assign/implementation.js'),
'next/dist/build/polyfills/object.assign/auto.js' 'object.assign/polyfill':
), require.resolve('next/dist/build/polyfills/object.assign/polyfill.js'),
'object.assign/implementation': require.resolve( 'object.assign/shim':
'next/dist/build/polyfills/object.assign/implementation.js' require.resolve('next/dist/build/polyfills/object.assign/shim.js'),
),
'object.assign/polyfill': require.resolve(
'next/dist/build/polyfills/object.assign/polyfill.js'
),
'object.assign/shim': require.resolve(
'next/dist/build/polyfills/object.assign/shim.js'
),
url: require.resolve('next/dist/compiled/native-url'), url: require.resolve('next/dist/compiled/native-url'),
} }
} }
......
...@@ -533,14 +533,12 @@ export async function createPagesMapping({ ...@@ -533,14 +533,12 @@ export async function createPagesMapping({
// If there's any app pages existed, add a default /_not-found route as 404. // If there's any app pages existed, add a default /_not-found route as 404.
// If there's any custom /_not-found page, it will override the default one. // If there's any custom /_not-found page, it will override the default one.
...(hasAppPages && { ...(hasAppPages && {
[UNDERSCORE_NOT_FOUND_ROUTE_ENTRY]: require.resolve( [UNDERSCORE_NOT_FOUND_ROUTE_ENTRY]:
'next/dist/client/components/builtin/global-not-found' require.resolve('next/dist/client/components/builtin/global-not-found'),
),
}), }),
...(hasAppGlobalError && { ...(hasAppGlobalError && {
[UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY]: require.resolve( [UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY]:
'next/dist/client/components/builtin/app-error' require.resolve('next/dist/client/components/builtin/app-error'),
),
}), }),
...pages, ...pages,
} }
......
...@@ -3221,8 +3221,11 @@ export default async function build( ...@@ -3221,8 +3221,11 @@ export default async function build(
for (const route of staticPrerenderedRoutes) { for (const route of staticPrerenderedRoutes) {
if (isDynamicRoute(page) && route.pathname === page) continue if (isDynamicRoute(page) && route.pathname === page) continue
const { metadata = {}, hasEmptyStaticShell, hasPostponed } = const {
exportResult.byPath.get(route.pathname) ?? {} metadata = {},
hasEmptyStaticShell,
hasPostponed,
} = exportResult.byPath.get(route.pathname) ?? {}
const cacheControl = getCacheControl( const cacheControl = getCacheControl(
route.pathname, route.pathname,
......
...@@ -18,9 +18,8 @@ const nextDistPath = new RegExp( ...@@ -18,9 +18,8 @@ const nextDistPath = new RegExp(
const nodeModulesPath = /[\\/]node_modules[\\/]/ const nodeModulesPath = /[\\/]node_modules[\\/]/
const regeneratorRuntimePath = require.resolve( const regeneratorRuntimePath =
'next/dist/compiled/regenerator-runtime' require.resolve('next/dist/compiled/regenerator-runtime')
)
function isTypeScriptFile(filename: string) { function isTypeScriptFile(filename: string) {
return filename.endsWith('.ts') || filename.endsWith('.tsx') return filename.endsWith('.ts') || filename.endsWith('.tsx')
......
...@@ -369,8 +369,10 @@ export type WrittenEndpoint = ...@@ -369,8 +369,10 @@ export type WrittenEndpoint =
config: EndpointConfig config: EndpointConfig
} }
export interface ProjectOptions export interface ProjectOptions extends Omit<
extends Omit<NapiProjectOptions, 'nextConfig' | 'env'> { NapiProjectOptions,
'nextConfig' | 'env'
> {
/** /**
* The next.config.js contents. * The next.config.js contents.
*/ */
...@@ -382,8 +384,10 @@ export interface ProjectOptions ...@@ -382,8 +384,10 @@ export interface ProjectOptions
env: Record<string, string> env: Record<string, string>
} }
export interface PartialProjectOptions export interface PartialProjectOptions extends Omit<
extends Omit<NapiPartialProjectOptions, 'nextConfig' | 'env'> { NapiPartialProjectOptions,
'nextConfig' | 'env'
> {
rootPath: NapiProjectOptions['rootPath'] rootPath: NapiProjectOptions['rootPath']
projectPath: NapiProjectOptions['projectPath'] projectPath: NapiProjectOptions['projectPath']
/** /**
......
...@@ -4,9 +4,13 @@ import type { IncomingMessage, ServerResponse } from 'node:http' ...@@ -4,9 +4,13 @@ import type { IncomingMessage, ServerResponse } from 'node:http'
import { import {
AppPageRouteModule, AppPageRouteModule,
type AppPageRouteHandlerContext, type AppPageRouteHandlerContext,
} from '../../server/route-modules/app-page/module.compiled' with { 'turbopack-transition': 'next-ssr' } } from '../../server/route-modules/app-page/module.compiled' with {
'turbopack-transition': 'next-ssr',
}
import { RouteKind } from '../../server/route-kind' with { 'turbopack-transition': 'next-server-utility' } import { RouteKind } from '../../server/route-kind' with {
'turbopack-transition': 'next-server-utility',
}
import { getRevalidateReason } from '../../server/instrumentation/utils' import { getRevalidateReason } from '../../server/instrumentation/utils'
import { getTracer, SpanKind, type Span } from '../../server/lib/trace/tracer' import { getTracer, SpanKind, type Span } from '../../server/lib/trace/tracer'
...@@ -70,7 +74,9 @@ declare const tree: LoaderTree ...@@ -70,7 +74,9 @@ declare const tree: LoaderTree
// module. // module.
// INJECT:tree // INJECT:tree
import GlobalError from 'VAR_MODULE_GLOBAL_ERROR' with { 'turbopack-transition': 'next-server-utility' } import GlobalError from 'VAR_MODULE_GLOBAL_ERROR' with {
'turbopack-transition': 'next-server-utility',
}
export { GlobalError } export { GlobalError }
...@@ -86,13 +92,17 @@ export const __next_app__ = { ...@@ -86,13 +92,17 @@ export const __next_app__ = {
loadChunk: __next_app_load_chunk__, loadChunk: __next_app_load_chunk__,
} }
import * as entryBase from '../../server/app-render/entry-base' with { 'turbopack-transition': 'next-server-utility' } import * as entryBase from '../../server/app-render/entry-base' with {
'turbopack-transition': 'next-server-utility',
}
import { RedirectStatusCode } from '../../client/components/redirect-status-code' import { RedirectStatusCode } from '../../client/components/redirect-status-code'
import { InvariantError } from '../../shared/lib/invariant-error' import { InvariantError } from '../../shared/lib/invariant-error'
import { scheduleOnNextTick } from '../../lib/scheduler' import { scheduleOnNextTick } from '../../lib/scheduler'
import { isInterceptionRouteAppPath } from '../../shared/lib/router/utils/interception-routes' import { isInterceptionRouteAppPath } from '../../shared/lib/router/utils/interception-routes'
export * from '../../server/app-render/entry-base' with { 'turbopack-transition': 'next-server-utility' } export * from '../../server/app-render/entry-base' with {
'turbopack-transition': 'next-server-utility',
}
// Create and export the route module that will be consumed. // Create and export the route module that will be consumed.
export const routeModule = new AppPageRouteModule({ export const routeModule = new AppPageRouteModule({
...@@ -317,9 +327,9 @@ export async function handler( ...@@ -317,9 +327,9 @@ export async function handler(
(prerenderInfo || (prerenderInfo ||
isPrerendered || isPrerendered ||
prerenderManifest.routes[normalizedSrcPage]) && prerenderManifest.routes[normalizedSrcPage]) &&
// If this is a html bot request and PPR is enabled, then we don't want // If this is a html bot request and PPR is enabled, then we don't want
// to serve a static response. // to serve a static response.
!(isHtmlBot && isRoutePPREnabled) !(isHtmlBot && isRoutePPREnabled)
) )
// When a page supports cacheComponents, we can support RDC for Navigations // When a page supports cacheComponents, we can support RDC for Navigations
......
...@@ -132,7 +132,7 @@ export async function handler( ...@@ -132,7 +132,7 @@ export async function handler(
let isIsr = Boolean( let isIsr = Boolean(
prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.dynamicRoutes[normalizedSrcPage] ||
prerenderManifest.routes[resolvedPathname] prerenderManifest.routes[resolvedPathname]
) )
const render404 = async () => { const render404 = async () => {
......
...@@ -545,9 +545,8 @@ export default async function getBaseWebpackConfig( ...@@ -545,9 +545,8 @@ export default async function getBaseWebpackConfig(
emitDecoratorMetadata: Boolean( emitDecoratorMetadata: Boolean(
jsConfig?.compilerOptions?.emitDecoratorMetadata jsConfig?.compilerOptions?.emitDecoratorMetadata
), ),
regeneratorRuntimePath: require.resolve( regeneratorRuntimePath:
'next/dist/compiled/regenerator-runtime' require.resolve('next/dist/compiled/regenerator-runtime'),
),
...extraOptions, ...extraOptions,
}, },
...@@ -936,9 +935,9 @@ export default async function getBaseWebpackConfig( ...@@ -936,9 +935,9 @@ export default async function getBaseWebpackConfig(
const telemetryPlugin = const telemetryPlugin =
!dev && !dev &&
isClient && isClient &&
new (( new (
require('./webpack/plugins/telemetry-plugin/telemetry-plugin') as typeof import('./webpack/plugins/telemetry-plugin/telemetry-plugin') require('./webpack/plugins/telemetry-plugin/telemetry-plugin') as typeof import('./webpack/plugins/telemetry-plugin/telemetry-plugin')
).TelemetryPlugin)( ).TelemetryPlugin(
new Map( new Map(
[ [
['swcLoader', useSWCLoader], ['swcLoader', useSWCLoader],
...@@ -1838,69 +1837,44 @@ export default async function getBaseWebpackConfig( ...@@ -1838,69 +1837,44 @@ export default async function getBaseWebpackConfig(
setImmediate: false, setImmediate: false,
} }
: { : {
assert: require.resolve( assert:
'next/dist/compiled/assert' require.resolve('next/dist/compiled/assert'),
), buffer:
buffer: require.resolve( require.resolve('next/dist/compiled/buffer'),
'next/dist/compiled/buffer' constants:
), require.resolve('next/dist/compiled/constants-browserify'),
constants: require.resolve( crypto:
'next/dist/compiled/constants-browserify' require.resolve('next/dist/compiled/crypto-browserify'),
), domain:
crypto: require.resolve( require.resolve('next/dist/compiled/domain-browser'),
'next/dist/compiled/crypto-browserify' http: require.resolve('next/dist/compiled/stream-http'),
), https:
domain: require.resolve( require.resolve('next/dist/compiled/https-browserify'),
'next/dist/compiled/domain-browser' os: require.resolve('next/dist/compiled/os-browserify'),
), path: require.resolve('next/dist/compiled/path-browserify'),
http: require.resolve( punycode:
'next/dist/compiled/stream-http' require.resolve('next/dist/compiled/punycode'),
),
https: require.resolve(
'next/dist/compiled/https-browserify'
),
os: require.resolve(
'next/dist/compiled/os-browserify'
),
path: require.resolve(
'next/dist/compiled/path-browserify'
),
punycode: require.resolve(
'next/dist/compiled/punycode'
),
process: require.resolve('./polyfills/process'), process: require.resolve('./polyfills/process'),
// Handled in separate alias // Handled in separate alias
querystring: require.resolve( querystring:
'next/dist/compiled/querystring-es3' require.resolve('next/dist/compiled/querystring-es3'),
), stream:
stream: require.resolve( require.resolve('next/dist/compiled/stream-browserify'),
'next/dist/compiled/stream-browserify' string_decoder:
), require.resolve('next/dist/compiled/string_decoder'),
string_decoder: require.resolve(
'next/dist/compiled/string_decoder'
),
sys: require.resolve('next/dist/compiled/util'), sys: require.resolve('next/dist/compiled/util'),
timers: require.resolve( timers:
'next/dist/compiled/timers-browserify' require.resolve('next/dist/compiled/timers-browserify'),
), tty: require.resolve('next/dist/compiled/tty-browserify'),
tty: require.resolve(
'next/dist/compiled/tty-browserify'
),
// Handled in separate alias // Handled in separate alias
// url: require.resolve('url'), // url: require.resolve('url'),
util: require.resolve('next/dist/compiled/util'), util: require.resolve('next/dist/compiled/util'),
vm: require.resolve( vm: require.resolve('next/dist/compiled/vm-browserify'),
'next/dist/compiled/vm-browserify' zlib: require.resolve('next/dist/compiled/browserify-zlib'),
), events:
zlib: require.resolve( require.resolve('next/dist/compiled/events'),
'next/dist/compiled/browserify-zlib' setImmediate:
), require.resolve('next/dist/compiled/setimmediate'),
events: require.resolve(
'next/dist/compiled/events'
),
setImmediate: require.resolve(
'next/dist/compiled/setimmediate'
),
}, },
}, },
}, },
...@@ -2041,21 +2015,21 @@ export default async function getBaseWebpackConfig( ...@@ -2041,21 +2015,21 @@ export default async function getBaseWebpackConfig(
}), }),
isNodeServer && isNodeServer &&
!dev && !dev &&
new ( new ((
( require('./webpack/plugins/next-trace-entrypoints-plugin') as typeof import('./webpack/plugins/next-trace-entrypoints-plugin')
require('./webpack/plugins/next-trace-entrypoints-plugin') as typeof import('./webpack/plugins/next-trace-entrypoints-plugin') )
) .TraceEntryPointsPlugin as typeof import('./webpack/plugins/next-trace-entrypoints-plugin').TraceEntryPointsPlugin)(
.TraceEntryPointsPlugin as typeof import('./webpack/plugins/next-trace-entrypoints-plugin').TraceEntryPointsPlugin {
)({ rootDir: dir,
rootDir: dir, appDir: appDir,
appDir: appDir, pagesDir: pagesDir,
pagesDir: pagesDir, esmExternals: config.experimental.esmExternals,
esmExternals: config.experimental.esmExternals, outputFileTracingRoot: config.outputFileTracingRoot,
outputFileTracingRoot: config.outputFileTracingRoot, appDirEnabled: hasAppDir,
appDirEnabled: hasAppDir, traceIgnores: [],
traceIgnores: [], compilerType,
compilerType, }
}), ),
// Moment.js is an extremely popular library that bundles large locale files // Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical // by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales. // solution that requires the user to opt into importing specific locales.
...@@ -2184,13 +2158,13 @@ export default async function getBaseWebpackConfig( ...@@ -2184,13 +2158,13 @@ export default async function getBaseWebpackConfig(
telemetryPlugin, telemetryPlugin,
!dev && !dev &&
isNodeServer && isNodeServer &&
new (( new (
require('./webpack/plugins/telemetry-plugin/telemetry-plugin') as typeof import('./webpack/plugins/telemetry-plugin/telemetry-plugin') require('./webpack/plugins/telemetry-plugin/telemetry-plugin') as typeof import('./webpack/plugins/telemetry-plugin/telemetry-plugin')
).TelemetryPlugin)(new Map()), ).TelemetryPlugin(new Map()),
shouldEnableSlowModuleDetection && shouldEnableSlowModuleDetection &&
new (( new (
require('./webpack/plugins/slow-module-detection-plugin') as typeof import('./webpack/plugins/slow-module-detection-plugin') require('./webpack/plugins/slow-module-detection-plugin') as typeof import('./webpack/plugins/slow-module-detection-plugin')
).default)({ ).default({
compilerType, compilerType,
...config.experimental.slowModuleDetection!, ...config.experimental.slowModuleDetection!,
}), }),
......
...@@ -196,12 +196,10 @@ export const css = curry(async function css( ...@@ -196,12 +196,10 @@ export const css = curry(async function css(
const fns: ConfigurationFn[] = [] const fns: ConfigurationFn[] = []
const googleLoader = require.resolve( const googleLoader =
'next/dist/compiled/@next/font/google/loader' require.resolve('next/dist/compiled/@next/font/google/loader')
) const localLoader =
const localLoader = require.resolve( require.resolve('next/dist/compiled/@next/font/local/loader')
'next/dist/compiled/@next/font/local/loader'
)
const nextFontLoaders: Array<[string | RegExp, string, any?]> = [ const nextFontLoaders: Array<[string | RegExp, string, any?]> = [
[require.resolve('next/font/google/target.css'), googleLoader], [require.resolve('next/font/google/target.css'), googleLoader],
[require.resolve('next/font/local/target.css'), localLoader], [require.resolve('next/font/local/target.css'), localLoader],
...@@ -262,9 +260,8 @@ export const css = curry(async function css( ...@@ -262,9 +260,8 @@ export const css = curry(async function css(
issuerLayer: APP_LAYER_RULE, issuerLayer: APP_LAYER_RULE,
use: [ use: [
{ {
loader: require.resolve( loader:
'../../../loaders/next-flight-css-loader' require.resolve('../../../loaders/next-flight-css-loader'),
),
options: { options: {
cssModules: true, cssModules: true,
}, },
...@@ -302,9 +299,8 @@ export const css = curry(async function css( ...@@ -302,9 +299,8 @@ export const css = curry(async function css(
issuerLayer: APP_LAYER_RULE, issuerLayer: APP_LAYER_RULE,
use: [ use: [
{ {
loader: require.resolve( loader:
'../../../loaders/next-flight-css-loader' require.resolve('../../../loaders/next-flight-css-loader'),
),
options: { options: {
cssModules: true, cssModules: true,
}, },
...@@ -356,9 +352,8 @@ export const css = curry(async function css( ...@@ -356,9 +352,8 @@ export const css = curry(async function css(
test: [regexCssGlobal, regexSassGlobal], test: [regexCssGlobal, regexSassGlobal],
issuerLayer: APP_LAYER_RULE, issuerLayer: APP_LAYER_RULE,
use: { use: {
loader: require.resolve( loader:
'../../../loaders/next-flight-css-loader' require.resolve('../../../loaders/next-flight-css-loader'),
),
options: { options: {
cssModules: false, cssModules: false,
}, },
...@@ -414,9 +409,8 @@ export const css = curry(async function css( ...@@ -414,9 +409,8 @@ export const css = curry(async function css(
issuerLayer: APP_LAYER_RULE, issuerLayer: APP_LAYER_RULE,
use: [ use: [
{ {
loader: require.resolve( loader:
'../../../loaders/next-flight-css-loader' require.resolve('../../../loaders/next-flight-css-loader'),
),
options: { options: {
cssModules: false, cssModules: false,
}, },
...@@ -433,9 +427,8 @@ export const css = curry(async function css( ...@@ -433,9 +427,8 @@ export const css = curry(async function css(
issuerLayer: APP_LAYER_RULE, issuerLayer: APP_LAYER_RULE,
use: [ use: [
{ {
loader: require.resolve( loader:
'../../../loaders/next-flight-css-loader' require.resolve('../../../loaders/next-flight-css-loader'),
),
options: { options: {
cssModules: false, cssModules: false,
}, },
......
...@@ -34,9 +34,8 @@ const EdgeAppRouteLoader: webpack.LoaderDefinitionFunction<EdgeAppRouteLoaderQue ...@@ -34,9 +34,8 @@ const EdgeAppRouteLoader: webpack.LoaderDefinitionFunction<EdgeAppRouteLoaderQue
const cacheHandlers = JSON.parse(cacheHandlersStringified || '{}') const cacheHandlers = JSON.parse(cacheHandlersStringified || '{}')
if (!cacheHandlers.default) { if (!cacheHandlers.default) {
cacheHandlers.default = require.resolve( cacheHandlers.default =
'../../../../server/lib/cache-handlers/default.external' require.resolve('../../../../server/lib/cache-handlers/default.external')
)
} }
// Ensure we only run this loader for as a module. // Ensure we only run this loader for as a module.
......
...@@ -83,9 +83,8 @@ const edgeSSRLoader: webpack.LoaderDefinitionFunction<EdgeSSRLoaderQuery> = ...@@ -83,9 +83,8 @@ const edgeSSRLoader: webpack.LoaderDefinitionFunction<EdgeSSRLoaderQuery> =
const cacheHandlers = JSON.parse(cacheHandlersStringified || '{}') const cacheHandlers = JSON.parse(cacheHandlersStringified || '{}')
if (!cacheHandlers.default) { if (!cacheHandlers.default) {
cacheHandlers.default = require.resolve( cacheHandlers.default =
'../../../../server/lib/cache-handlers/default.external' require.resolve('../../../../server/lib/cache-handlers/default.external')
)
} }
const middlewareConfig: ProxyConfig = JSON.parse( const middlewareConfig: ProxyConfig = JSON.parse(
......
...@@ -34,8 +34,7 @@ interface SourceMap extends RawSourceMap { ...@@ -34,8 +34,7 @@ interface SourceMap extends RawSourceMap {
version: number version: number
} }
export interface EvalSourceMapDevToolPluginOptions export interface EvalSourceMapDevToolPluginOptions extends SourceMapDevToolPluginOptions {
extends SourceMapDevToolPluginOptions {
// Fork // Fork
shouldIgnorePath?: (modulePath: string) => boolean shouldIgnorePath?: (modulePath: string) => boolean
} }
......
...@@ -375,8 +375,8 @@ export class ClientReferenceManifestPlugin { ...@@ -375,8 +375,8 @@ export class ClientReferenceManifestPlugin {
function addClientReference() { function addClientReference() {
const isAsync = Boolean( const isAsync = Boolean(
compilation.moduleGraph.isAsync(mod) || compilation.moduleGraph.isAsync(mod) ||
pluginState.ssrModules[ssrNamedModuleId]?.async || pluginState.ssrModules[ssrNamedModuleId]?.async ||
pluginState.edgeSsrModules[ssrNamedModuleId]?.async pluginState.edgeSsrModules[ssrNamedModuleId]?.async
) )
const exportName = resource const exportName = resource
......
...@@ -31,8 +31,7 @@ interface HTTPAccessFallbackBoundaryProps { ...@@ -31,8 +31,7 @@ interface HTTPAccessFallbackBoundaryProps {
missingSlots?: Set<string> missingSlots?: Set<string>
} }
interface HTTPAccessFallbackErrorBoundaryProps interface HTTPAccessFallbackErrorBoundaryProps extends HTTPAccessFallbackBoundaryProps {
extends HTTPAccessFallbackBoundaryProps {
pathname: string | null pathname: string | null
missingSlots?: Set<string> missingSlots?: Set<string>
} }
......
...@@ -46,9 +46,8 @@ export function getFlightDataPartsFromPath( ...@@ -46,9 +46,8 @@ export function getFlightDataPartsFromPath(
// Pick the last 4 items from the `FlightDataPath` to get the [tree, seedData, viewport, isHeadPartial]. // Pick the last 4 items from the `FlightDataPath` to get the [tree, seedData, viewport, isHeadPartial].
const flightDataPathLength = 4 const flightDataPathLength = 4
// tree, seedData, and head are *always* the last three items in the `FlightDataPath`. // tree, seedData, and head are *always* the last three items in the `FlightDataPath`.
const [tree, seedData, head, isHeadPartial] = flightDataPath.slice( const [tree, seedData, head, isHeadPartial] =
-flightDataPathLength flightDataPath.slice(-flightDataPathLength)
)
// The `FlightSegmentPath` is everything except the last three items. For a root render, it won't be present. // The `FlightSegmentPath` is everything except the last three items. For a root render, it won't be present.
const segmentPath = flightDataPath.slice(0, -flightDataPathLength) const segmentPath = flightDataPath.slice(0, -flightDataPathLength)
......
...@@ -30,9 +30,9 @@ export function IconsMetadata({ icons }: { icons: ResolvedMetadata['icons'] }) { ...@@ -30,9 +30,9 @@ export function IconsMetadata({ icons }: { icons: ResolvedMetadata['icons'] }) {
const hasIcon = Boolean( const hasIcon = Boolean(
shortcutList?.length || shortcutList?.length ||
iconList?.length || iconList?.length ||
appleList?.length || appleList?.length ||
otherList?.length otherList?.length
) )
if (!hasIcon) return null if (!hasIcon) return null
......
...@@ -46,7 +46,7 @@ export const CALL_STACK_STYLES = css` ...@@ -46,7 +46,7 @@ export const CALL_STACK_STYLES = css`
position: relative; position: relative;
margin-top: 8px; margin-top: 8px;
} }
[data-nextjs-call-stack-header] { [data-nextjs-call-stack-header] {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -55,39 +55,39 @@ export const CALL_STACK_STYLES = css` ...@@ -55,39 +55,39 @@ export const CALL_STACK_STYLES = css`
padding: 8px 8px 12px 4px; padding: 8px 8px 12px 4px;
width: 100%; width: 100%;
} }
[data-nextjs-call-stack-title] { [data-nextjs-call-stack-title] {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
margin: 0; margin: 0;
color: var(--color-gray-1000); color: var(--color-gray-1000);
font-size: var(--size-16); font-size: var(--size-16);
font-weight: 500; font-weight: 500;
} }
[data-nextjs-call-stack-count] { [data-nextjs-call-stack-count] {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: var(--size-20); width: var(--size-20);
height: var(--size-20); height: var(--size-20);
gap: 4px; gap: 4px;
color: var(--color-gray-1000); color: var(--color-gray-1000);
text-align: center; text-align: center;
font-size: var(--size-11); font-size: var(--size-11);
font-weight: 500; font-weight: 500;
line-height: var(--size-16); line-height: var(--size-16);
border-radius: var(--rounded-full); border-radius: var(--rounded-full);
background: var(--color-gray-300); background: var(--color-gray-300);
} }
[data-nextjs-call-stack-ignored-list-toggle-button] { [data-nextjs-call-stack-ignored-list-toggle-button] {
all: unset; all: unset;
display: flex; display: flex;
...@@ -100,15 +100,15 @@ export const CALL_STACK_STYLES = css` ...@@ -100,15 +100,15 @@ export const CALL_STACK_STYLES = css`
padding: 4px 6px; padding: 4px 6px;
margin-right: -6px; margin-right: -6px;
transition: background 150ms ease; transition: background 150ms ease;
&:hover { &:hover {
background: var(--color-gray-100); background: var(--color-gray-100);
} }
&:focus { &:focus {
outline: var(--focus-ring); outline: var(--focus-ring);
} }
svg { svg {
width: var(--size-16); width: var(--size-16);
height: var(--size-16); height: var(--size-16);
......
...@@ -103,22 +103,22 @@ export function NextLogo({ ...@@ -103,22 +103,22 @@ export function NextLogo({
--color-hover-alpha-error: hsla(0, 0%, 100%, 0.2); --color-hover-alpha-error: hsla(0, 0%, 100%, 0.2);
--color-hover-alpha-error-2: hsla(0, 0%, 100%, 0.25); --color-hover-alpha-error-2: hsla(0, 0%, 100%, 0.25);
--mark-size: calc(var(--size) - var(--size-2) * 2); --mark-size: calc(var(--size) - var(--size-2) * 2);
--focus-color: var(--color-blue-800); --focus-color: var(--color-blue-800);
--focus-ring: 2px solid var(--focus-color); --focus-ring: 2px solid var(--focus-color);
&:has([data-next-badge][data-error='true']) { &:has([data-next-badge][data-error='true']) {
--focus-color: #fff; --focus-color: #fff;
} }
} }
[data-disabled-icon] { [data-disabled-icon] {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding-right: 4px; padding-right: 4px;
} }
[data-next-badge] { [data-next-badge] {
width: var(--size); width: var(--size);
height: var(--size); height: var(--size);
...@@ -142,66 +142,66 @@ export function NextLogo({ ...@@ -142,66 +142,66 @@ export function NextLogo({
width var(--duration-long) var(--timing), width var(--duration-long) var(--timing),
box-shadow var(--duration-long) var(--timing), box-shadow var(--duration-long) var(--timing),
background var(--duration-short) ease; background var(--duration-short) ease;
&:active[data-error='false'] { &:active[data-error='false'] {
scale: 0.95; scale: 0.95;
} }
&[data-animate='true']:not(:hover) { &[data-animate='true']:not(:hover) {
scale: 1.02; scale: 1.02;
} }
&[data-error='false']:has([data-next-mark]:focus-visible) { &[data-error='false']:has([data-next-mark]:focus-visible) {
outline: var(--focus-ring); outline: var(--focus-ring);
outline-offset: 3px; outline-offset: 3px;
} }
&[data-error='true'] { &[data-error='true'] {
background: #ca2a30; background: #ca2a30;
--color-inner-border: #e5484d; --color-inner-border: #e5484d;
[data-next-mark] { [data-next-mark] {
background: var(--color-hover-alpha-error); background: var(--color-hover-alpha-error);
outline-offset: 0px; outline-offset: 0px;
&:focus-visible { &:focus-visible {
outline: var(--focus-ring); outline: var(--focus-ring);
outline-offset: -1px; outline-offset: -1px;
} }
&:hover { &:hover {
background: var(--color-hover-alpha-error-2); background: var(--color-hover-alpha-error-2);
} }
} }
} }
&[data-cache-bypassing='true']:not([data-error='true']) { &[data-cache-bypassing='true']:not([data-error='true']) {
background: rgba(217, 119, 6, 0.95); background: rgba(217, 119, 6, 0.95);
--color-inner-border: rgba(245, 158, 11, 0.9); --color-inner-border: rgba(245, 158, 11, 0.9);
[data-issues-open] { [data-issues-open] {
color: white; color: white;
} }
} }
&[data-error-expanded='false'][data-error='true'] ~ [data-dot] { &[data-error-expanded='false'][data-error='true'] ~ [data-dot] {
scale: 1; scale: 1;
} }
> div { > div {
display: flex; display: flex;
} }
} }
[data-issues-collapse]:focus-visible { [data-issues-collapse]:focus-visible {
outline: var(--focus-ring); outline: var(--focus-ring);
} }
[data-issues]:has([data-issues-open]:focus-visible) { [data-issues]:has([data-issues-open]:focus-visible) {
outline: var(--focus-ring); outline: var(--focus-ring);
outline-offset: -1px; outline-offset: -1px;
} }
[data-dot] { [data-dot] {
content: ''; content: '';
width: var(--size-8); width: var(--size-8);
...@@ -217,7 +217,7 @@ export function NextLogo({ ...@@ -217,7 +217,7 @@ export function NextLogo({
transition: scale 200ms var(--timing); transition: scale 200ms var(--timing);
transition-delay: var(--duration-short); transition-delay: var(--duration-short);
} }
[data-issues] { [data-issues] {
--padding-left: 8px; --padding-left: 8px;
display: flex; display: flex;
...@@ -229,20 +229,20 @@ export function NextLogo({ ...@@ -229,20 +229,20 @@ export function NextLogo({
margin-right: 2px; margin-right: 2px;
border-radius: var(--rounded-full); border-radius: var(--rounded-full);
transition: background var(--duration-short) ease; transition: background var(--duration-short) ease;
&:has([data-issues-open]:hover) { &:has([data-issues-open]:hover) {
background: var(--color-hover-alpha-error); background: var(--color-hover-alpha-error);
} }
&:has([data-issues-collapse]) { &:has([data-issues-collapse]) {
padding-right: calc(var(--padding-left) / 2); padding-right: calc(var(--padding-left) / 2);
} }
[data-cross] { [data-cross] {
translate: 0px -1px; translate: 0px -1px;
} }
} }
[data-issues-open] { [data-issues-open] {
font-size: var(--size-13); font-size: var(--size-13);
color: white; color: white;
...@@ -256,29 +256,29 @@ export function NextLogo({ ...@@ -256,29 +256,29 @@ export function NextLogo({
font-weight: 500; font-weight: 500;
z-index: 2; z-index: 2;
white-space: nowrap; white-space: nowrap;
&:focus-visible { &:focus-visible {
outline: 0; outline: 0;
} }
} }
[data-issues-collapse] { [data-issues-collapse] {
width: var(--size-24); width: var(--size-24);
height: var(--size-24); height: var(--size-24);
border-radius: var(--rounded-full); border-radius: var(--rounded-full);
transition: background var(--duration-short) ease; transition: background var(--duration-short) ease;
&:hover { &:hover {
background: var(--color-hover-alpha-error); background: var(--color-hover-alpha-error);
} }
} }
[data-cross] { [data-cross] {
color: #fff; color: #fff;
width: var(--size-12); width: var(--size-12);
height: var(--size-12); height: var(--size-12);
} }
[data-next-mark] { [data-next-mark] {
width: var(--mark-size); width: var(--mark-size);
height: var(--mark-size); height: var(--mark-size);
...@@ -287,58 +287,58 @@ export function NextLogo({ ...@@ -287,58 +287,58 @@ export function NextLogo({
align-items: center; align-items: center;
border-radius: var(--rounded-full); border-radius: var(--rounded-full);
transition: background var(--duration-long) var(--timing); transition: background var(--duration-long) var(--timing);
&:focus-visible { &:focus-visible {
outline: 0; outline: 0;
} }
&:hover { &:hover {
background: var(--color-hover-alpha-subtle); background: var(--color-hover-alpha-subtle);
} }
svg { svg {
flex-shrink: 0; flex-shrink: 0;
width: var(--size-40); width: var(--size-40);
height: var(--size-40); height: var(--size-40);
} }
} }
[data-issues-count-animation] { [data-issues-count-animation] {
display: grid; display: grid;
place-items: center center; place-items: center center;
font-variant-numeric: tabular-nums; font-variant-numeric: tabular-nums;
&[data-animate='false'] { &[data-animate='false'] {
[data-issues-count-exit], [data-issues-count-exit],
[data-issues-count-enter] { [data-issues-count-enter] {
animation-duration: 0ms; animation-duration: 0ms;
} }
} }
> * { > * {
grid-area: 1 / 1; grid-area: 1 / 1;
} }
[data-issues-count-exit] { [data-issues-count-exit] {
animation: fadeOut 300ms var(--timing) forwards; animation: fadeOut 300ms var(--timing) forwards;
} }
[data-issues-count-enter] { [data-issues-count-enter] {
animation: fadeIn 300ms var(--timing) forwards; animation: fadeIn 300ms var(--timing) forwards;
} }
} }
[data-issues-count-plural] { [data-issues-count-plural] {
display: inline-block; display: inline-block;
&[data-animate='true'] { &[data-animate='true'] {
animation: fadeIn 300ms var(--timing) forwards; animation: fadeIn 300ms var(--timing) forwards;
} }
} }
.paused { .paused {
stroke-dashoffset: 0; stroke-dashoffset: 0;
} }
@keyframes fadeIn { @keyframes fadeIn {
0% { 0% {
opacity: 0; opacity: 0;
...@@ -351,7 +351,7 @@ export function NextLogo({ ...@@ -351,7 +351,7 @@ export function NextLogo({
transform: translateY(0); transform: translateY(0);
} }
} }
@keyframes fadeOut { @keyframes fadeOut {
0% { 0% {
opacity: 1; opacity: 1;
...@@ -364,7 +364,7 @@ export function NextLogo({ ...@@ -364,7 +364,7 @@ export function NextLogo({
filter: blur(2px); filter: blur(2px);
} }
} }
@media (prefers-reduced-motion) { @media (prefers-reduced-motion) {
[data-issues-count-exit], [data-issues-count-exit],
[data-issues-count-enter], [data-issues-count-enter],
......
...@@ -81,55 +81,54 @@ export function StatusIndicator({ status, onClick }: StatusIndicatorProps) { ...@@ -81,55 +81,54 @@ export function StatusIndicator({ status, onClick }: StatusIndicatorProps) {
cursor: pointer; cursor: pointer;
outline: none; outline: none;
} }
[data-indicator-status]:focus-visible { [data-indicator-status]:focus-visible {
outline: 2px solid var(--color-blue-800, #3b82f6); outline: 2px solid var(--color-blue-800, #3b82f6);
outline-offset: 3px; outline-offset: 3px;
} }
[data-status-dot] { [data-status-dot] {
width: 8px; width: 8px;
height: 8px; height: 8px;
border-radius: 50%; border-radius: 50%;
flex-shrink: 0; flex-shrink: 0;
} }
[data-status-text-animation] { [data-status-text-animation] {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
height: 100%; height: 100%;
> * { > * {
white-space: nowrap; white-space: nowrap;
line-height: 1; line-height: 1;
} }
[data-status-text-enter] { [data-status-text-enter] {
animation: slotMachineEnter 150ms cubic-bezier(0, 0, 0.2, 1) animation: slotMachineEnter 150ms cubic-bezier(0, 0, 0.2, 1) forwards;
forwards;
} }
} }
[data-status-ellipsis] { [data-status-ellipsis] {
display: inline-flex; display: inline-flex;
margin-left: 2px; margin-left: 2px;
} }
[data-status-ellipsis] span { [data-status-ellipsis] span {
animation: ellipsisFade 1.2s infinite; animation: ellipsisFade 1.2s infinite;
margin: 0 1px; margin: 0 1px;
} }
[data-status-ellipsis] span:nth-child(2) { [data-status-ellipsis] span:nth-child(2) {
animation-delay: 0.2s; animation-delay: 0.2s;
} }
[data-status-ellipsis] span:nth-child(3) { [data-status-ellipsis] span:nth-child(3) {
animation-delay: 0.4s; animation-delay: 0.4s;
} }
@keyframes ellipsisFade { @keyframes ellipsisFade {
0%, 0%,
60%, 60%,
...@@ -140,7 +139,7 @@ export function StatusIndicator({ status, onClick }: StatusIndicatorProps) { ...@@ -140,7 +139,7 @@ export function StatusIndicator({ status, onClick }: StatusIndicatorProps) {
opacity: 1; opacity: 1;
} }
} }
@keyframes slotMachineEnter { @keyframes slotMachineEnter {
0% { 0% {
transform: translateY(0.8em); transform: translateY(0.8em);
......
...@@ -8,7 +8,7 @@ export const styles = css` ...@@ -8,7 +8,7 @@ export const styles = css`
--next-dialog-padding: 12px; --next-dialog-padding: 12px;
--next-dialog-notch-height: 42px; --next-dialog-notch-height: 42px;
--next-dialog-border-width: 1px; --next-dialog-border-width: 1px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
...@@ -21,12 +21,12 @@ export const styles = css` ...@@ -21,12 +21,12 @@ export const styles = css`
transition-property: scale, opacity; transition-property: scale, opacity;
transition-duration: var(--transition-duration); transition-duration: var(--transition-duration);
transition-timing-function: var(--timing-overlay); transition-timing-function: var(--timing-overlay);
&[data-rendered='true'] { &[data-rendered='true'] {
opacity: 1; opacity: 1;
scale: 1; scale: 1;
} }
[data-nextjs-scroll-fader][data-side='top'] { [data-nextjs-scroll-fader][data-side='top'] {
left: 1px; left: 1px;
top: calc( top: calc(
...@@ -36,25 +36,25 @@ export const styles = css` ...@@ -36,25 +36,25 @@ export const styles = css`
opacity: 0; opacity: 0;
} }
} }
[data-nextjs-dialog] { [data-nextjs-dialog] {
outline: 0; outline: 0;
} }
[data-nextjs-dialog-backdrop] { [data-nextjs-dialog-backdrop] {
opacity: 0; opacity: 0;
transition: opacity var(--transition-duration) var(--timing-overlay); transition: opacity var(--transition-duration) var(--timing-overlay);
} }
[data-nextjs-dialog-overlay] { [data-nextjs-dialog-overlay] {
margin: 8px; margin: 8px;
} }
[data-nextjs-dialog-overlay][data-rendered='true'] [data-nextjs-dialog-overlay][data-rendered='true']
[data-nextjs-dialog-backdrop] { [data-nextjs-dialog-backdrop] {
opacity: 1; opacity: 1;
} }
[data-nextjs-dialog-content] { [data-nextjs-dialog-content] {
border: none; border: none;
margin: 0; margin: 0;
...@@ -63,35 +63,35 @@ export const styles = css` ...@@ -63,35 +63,35 @@ export const styles = css`
position: relative; position: relative;
padding: var(--next-dialog-padding); padding: var(--next-dialog-padding);
} }
[data-nextjs-dialog-content] > [data-nextjs-dialog-header] { [data-nextjs-dialog-content] > [data-nextjs-dialog-header] {
flex-shrink: 0; flex-shrink: 0;
margin-bottom: 8px; margin-bottom: 8px;
} }
[data-nextjs-dialog-content] > [data-nextjs-dialog-body] { [data-nextjs-dialog-content] > [data-nextjs-dialog-body] {
position: relative; position: relative;
flex: 1 1 auto; flex: 1 1 auto;
} }
@media (max-height: 812px) { @media (max-height: 812px) {
[data-nextjs-dialog-overlay] { [data-nextjs-dialog-overlay] {
max-height: calc(100% - 15px); max-height: calc(100% - 15px);
} }
} }
@media (min-width: 576px) { @media (min-width: 576px) {
[data-nextjs-dialog-root] { [data-nextjs-dialog-root] {
--next-dialog-max-width: 540px; --next-dialog-max-width: 540px;
} }
} }
@media (min-width: 768px) { @media (min-width: 768px) {
[data-nextjs-dialog-root] { [data-nextjs-dialog-root] {
--next-dialog-max-width: 720px; --next-dialog-max-width: 720px;
} }
} }
@media (min-width: 992px) { @media (min-width: 992px) {
[data-nextjs-dialog-root] { [data-nextjs-dialog-root] {
--next-dialog-max-width: 960px; --next-dialog-max-width: 960px;
......
...@@ -342,7 +342,7 @@ export const SHORTCUT_RECORDER_STYLES = css` ...@@ -342,7 +342,7 @@ export const SHORTCUT_RECORDER_STYLES = css`
gap: 8px; gap: 8px;
position: relative; position: relative;
font-family: var(--font-stack-sans); font-family: var(--font-stack-sans);
.shortcut-recorder-button { .shortcut-recorder-button {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -355,33 +355,33 @@ export const SHORTCUT_RECORDER_STYLES = css` ...@@ -355,33 +355,33 @@ export const SHORTCUT_RECORDER_STYLES = css`
font-size: var(--size-14); font-size: var(--size-14);
color: var(--color-gray-1000); color: var(--color-gray-1000);
transition: border-color 150ms var(--timing-swift); transition: border-color 150ms var(--timing-swift);
&[data-has-shortcut='true'] { &[data-has-shortcut='true'] {
border: 1px solid var(--color-gray-alpha-400); border: 1px solid var(--color-gray-alpha-400);
&:hover { &:hover {
border-color: var(--color-gray-500); border-color: var(--color-gray-500);
} }
} }
&:hover { &:hover {
border-color: var(--color-gray-600); border-color: var(--color-gray-600);
} }
&::placeholder { &::placeholder {
color: var(--color-gray-900); color: var(--color-gray-900);
} }
&[data-pristine='false']::placeholder { &[data-pristine='false']::placeholder {
color: transparent; color: transparent;
} }
&:focus-visible { &:focus-visible {
outline: var(--focus-ring); outline: var(--focus-ring);
outline-offset: -1px; outline-offset: -1px;
} }
} }
kbd { kbd {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
...@@ -393,12 +393,12 @@ export const SHORTCUT_RECORDER_STYLES = css` ...@@ -393,12 +393,12 @@ export const SHORTCUT_RECORDER_STYLES = css`
font-size: 14px; font-size: 14px;
border-radius: 4px; border-radius: 4px;
color: var(--color-gray-1000); color: var(--color-gray-1000);
&[data-symbol='false'] { &[data-symbol='false'] {
padding: 0 4px; padding: 0 4px;
} }
} }
.shortcut-recorder-clear-button { .shortcut-recorder-clear-button {
cursor: pointer; cursor: pointer;
color: var(--color-gray-1000); color: var(--color-gray-1000);
...@@ -409,22 +409,22 @@ export const SHORTCUT_RECORDER_STYLES = css` ...@@ -409,22 +409,22 @@ export const SHORTCUT_RECORDER_STYLES = css`
justify-content: center; justify-content: center;
border-radius: 4px; border-radius: 4px;
transition: background 150ms var(--timing-swift); transition: background 150ms var(--timing-swift);
&:hover { &:hover {
background: var(--color-gray-300); background: var(--color-gray-300);
} }
&:focus-visible { &:focus-visible {
outline: var(--focus-ring); outline: var(--focus-ring);
} }
svg { svg {
width: 14px; width: 14px;
height: 14px; height: 14px;
} }
} }
} }
.shortcut-recorder-keys { .shortcut-recorder-keys {
pointer-events: none; pointer-events: none;
user-select: none; user-select: none;
...@@ -432,7 +432,7 @@ export const SHORTCUT_RECORDER_STYLES = css` ...@@ -432,7 +432,7 @@ export const SHORTCUT_RECORDER_STYLES = css`
align-items: center; align-items: center;
gap: 2px; gap: 2px;
} }
.shortcut-recorder-tooltip { .shortcut-recorder-tooltip {
--gap: 8px; --gap: 8px;
--background: var(--color-gray-1000); --background: var(--color-gray-1000);
...@@ -451,32 +451,32 @@ export const SHORTCUT_RECORDER_STYLES = css` ...@@ -451,32 +451,32 @@ export const SHORTCUT_RECORDER_STYLES = css`
transition: transition:
opacity 150ms var(--timing-swift), opacity 150ms var(--timing-swift),
scale 150ms var(--timing-swift); scale 150ms var(--timing-swift);
&[data-show='true'] { &[data-show='true'] {
opacity: 1; opacity: 1;
scale: 1; scale: 1;
} }
svg { svg {
position: absolute; position: absolute;
transform: translateX(-50%); transform: translateX(-50%);
bottom: -6px; bottom: -6px;
left: 50%; left: 50%;
} }
.shortcut-recorder-status { .shortcut-recorder-status {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 6px; gap: 6px;
} }
.shortcut-recorder-status-icon { .shortcut-recorder-status-icon {
width: 7px; width: 7px;
height: 7px; height: 7px;
border-radius: 50%; border-radius: 50%;
flex-shrink: 0; flex-shrink: 0;
background: var(--color-red-700); background: var(--color-red-700);
&[data-success='true'] { &[data-success='true'] {
background: var(--color-green-700); background: var(--color-green-700);
} }
......
...@@ -260,17 +260,17 @@ export const DEV_TOOLS_INFO_USER_PREFERENCES_STYLES = css` ...@@ -260,17 +260,17 @@ export const DEV_TOOLS_INFO_USER_PREFERENCES_STYLES = css`
.preferences-container { .preferences-container {
width: 100%; width: 100%;
} }
@media (min-width: 576px) { @media (min-width: 576px) {
.preferences-container { .preferences-container {
width: 480px; width: 480px;
} }
} }
.preference-section:first-child { .preference-section:first-child {
padding-top: 0; padding-top: 0;
} }
.preference-section { .preference-section {
padding: 12px 0; padding: 12px 0;
border-bottom: 1px solid var(--color-gray-400); border-bottom: 1px solid var(--color-gray-400);
...@@ -279,29 +279,29 @@ export const DEV_TOOLS_INFO_USER_PREFERENCES_STYLES = css` ...@@ -279,29 +279,29 @@ export const DEV_TOOLS_INFO_USER_PREFERENCES_STYLES = css`
align-items: center; align-items: center;
gap: 24px; gap: 24px;
} }
.preference-section:last-child { .preference-section:last-child {
border-bottom: none; border-bottom: none;
} }
.preference-header { .preference-header {
margin-bottom: 0; margin-bottom: 0;
flex: 1; flex: 1;
} }
.preference-header label { .preference-header label {
font-size: var(--size-14); font-size: var(--size-14);
font-weight: 500; font-weight: 500;
color: var(--color-gray-1000); color: var(--color-gray-1000);
margin: 0; margin: 0;
} }
.preference-description { .preference-description {
color: var(--color-gray-900); color: var(--color-gray-900);
font-size: var(--size-14); font-size: var(--size-14);
margin: 0; margin: 0;
} }
.select-button, .select-button,
.action-button { .action-button {
display: flex; display: flex;
...@@ -315,39 +315,39 @@ export const DEV_TOOLS_INFO_USER_PREFERENCES_STYLES = css` ...@@ -315,39 +315,39 @@ export const DEV_TOOLS_INFO_USER_PREFERENCES_STYLES = css`
color: var(--color-gray-1000); color: var(--color-gray-1000);
padding: 6px 8px; padding: 6px 8px;
transition: border-color 150ms var(--timing-swift); transition: border-color 150ms var(--timing-swift);
&:hover { &:hover {
border-color: var(--color-gray-500); border-color: var(--color-gray-500);
} }
svg { svg {
width: 14px; width: 14px;
height: 14px; height: 14px;
overflow: visible; overflow: visible;
} }
} }
.select-button { .select-button {
&:focus-within { &:focus-within {
outline: var(--focus-ring); outline: var(--focus-ring);
outline-offset: -1px; outline-offset: -1px;
} }
select { select {
all: unset; all: unset;
} }
option { option {
color: var(--color-gray-1000); color: var(--color-gray-1000);
background: var(--color-background-100); background: var(--color-background-100);
} }
} }
.preference-section button:disabled { .preference-section button:disabled {
opacity: 0.6; opacity: 0.6;
cursor: not-allowed; cursor: not-allowed;
} }
:global(.icon) { :global(.icon) {
width: 18px; width: 18px;
height: 18px; height: 18px;
......
...@@ -9,20 +9,20 @@ const styles = css` ...@@ -9,20 +9,20 @@ const styles = css`
left: 0; left: 0;
/* secondary z-index, -1 than toast z-index */ /* secondary z-index, -1 than toast z-index */
z-index: 2147483646; z-index: 2147483646;
display: flex; display: flex;
align-content: center; align-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
padding: 10vh 15px 0; padding: 10vh 15px 0;
} }
@media (max-height: 812px) { @media (max-height: 812px) {
[data-nextjs-dialog-overlay] { [data-nextjs-dialog-overlay] {
padding: 15px 15px 0; padding: 15px 15px 0;
} }
} }
[data-nextjs-dialog-backdrop] { [data-nextjs-dialog-backdrop] {
position: fixed; position: fixed;
top: 0; top: 0;
...@@ -34,7 +34,7 @@ const styles = css` ...@@ -34,7 +34,7 @@ const styles = css`
pointer-events: all; pointer-events: all;
z-index: -1; z-index: -1;
} }
[data-nextjs-dialog-backdrop-fixed] { [data-nextjs-dialog-backdrop-fixed] {
cursor: not-allowed; cursor: not-allowed;
-webkit-backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
......
...@@ -13,9 +13,9 @@ export const FontStyles = () => { ...@@ -13,9 +13,9 @@ export const FontStyles = () => {
font-display: swap; font-display: swap;
src: url(/__nextjs_font/geist-latin-ext.woff2) format('woff2'); src: url(/__nextjs_font/geist-latin-ext.woff2) format('woff2');
unicode-range: unicode-range:
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
} }
/* latin-ext */ /* latin-ext */
@font-face { @font-face {
...@@ -25,9 +25,9 @@ export const FontStyles = () => { ...@@ -25,9 +25,9 @@ export const FontStyles = () => {
font-display: swap; font-display: swap;
src: url(/__nextjs_font/geist-mono-latin-ext.woff2) format('woff2'); src: url(/__nextjs_font/geist-mono-latin-ext.woff2) format('woff2');
unicode-range: unicode-range:
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
} }
/* latin */ /* latin */
@font-face { @font-face {
...@@ -38,8 +38,8 @@ export const FontStyles = () => { ...@@ -38,8 +38,8 @@ export const FontStyles = () => {
src: url(/__nextjs_font/geist-latin.woff2) format('woff2'); src: url(/__nextjs_font/geist-latin.woff2) format('woff2');
unicode-range: unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
U+2212, U+2215, U+FEFF, U+FFFD; U+2215, U+FEFF, U+FFFD;
} }
/* latin */ /* latin */
@font-face { @font-face {
...@@ -50,8 +50,8 @@ export const FontStyles = () => { ...@@ -50,8 +50,8 @@ export const FontStyles = () => {
src: url(/__nextjs_font/geist-mono-latin.woff2) format('woff2'); src: url(/__nextjs_font/geist-mono-latin.woff2) format('woff2');
unicode-range: unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
U+2212, U+2215, U+FEFF, U+FFFD; U+2215, U+FEFF, U+FFFD;
} }
` `
document.head.appendChild(style) document.head.appendChild(style)
......
...@@ -274,7 +274,7 @@ export const INITIAL_OVERLAY_STATE: Omit< ...@@ -274,7 +274,7 @@ export const INITIAL_OVERLAY_STATE: Omit<
renderingIndicator: false, renderingIndicator: false,
cacheIndicator: 'disabled', cacheIndicator: 'disabled',
staticIndicator: 'disabled', staticIndicator: 'disabled',
/* /*
This is set to `true` when we can reliably know This is set to `true` when we can reliably know
whether the indicator is in disabled state or not. whether the indicator is in disabled state or not.
Otherwise the surface would flicker because the disabled flag loads from the config. Otherwise the surface would flicker because the disabled flag loads from the config.
......
...@@ -22,7 +22,7 @@ describe('css template literal tag', () => { ...@@ -22,7 +22,7 @@ describe('css template literal tag', () => {
const result = css` const result = css`
color: blue; /* this is a comment */ color: blue; /* this is a comment */
/* multi-line /* multi-line
comment */ comment */
/** jsdoc */ /** jsdoc */
margin: 10px; margin: 10px;
` `
...@@ -33,9 +33,9 @@ describe('css template literal tag', () => { ...@@ -33,9 +33,9 @@ describe('css template literal tag', () => {
const result = css` const result = css`
color: blue; color: blue;
/* /*
* This is multi-line comment. * This is multi-line comment.
* Is should be removed. * Is should be removed.
*/ */
margin: 10px; margin: 10px;
` `
expect(result).toBe('color:blue;margin:10px;') expect(result).toBe('color:blue;margin:10px;')
...@@ -56,7 +56,9 @@ describe('css template literal tag', () => { ...@@ -56,7 +56,9 @@ describe('css template literal tag', () => {
}) })
it('should handle empty strings', () => { it('should handle empty strings', () => {
const result = css`` const result = css`
`
expect(result).toBe('') expect(result).toBe('')
}) })
......
...@@ -52,8 +52,9 @@ export function ignoreListAnonymousStackFramesIfSandwiched( ...@@ -52,8 +52,9 @@ export function ignoreListAnonymousStackFramesIfSandwiched(
: '' : ''
}, },
(response) => { (response) => {
;(response as PromiseFulfilledResult<OriginalStackFrameResponse>) ;(
.value.originalStackFrame!.ignored = true response as PromiseFulfilledResult<OriginalStackFrameResponse>
).value.originalStackFrame!.ignored = true
} }
) )
} }
......
import type { AsyncLocalStorage } from 'async_hooks' import type { AsyncLocalStorage } from 'async_hooks'
// Share the instance module in the next-shared layer // Share the instance module in the next-shared layer
import { actionAsyncStorageInstance } from './action-async-storage-instance' with { 'turbopack-transition': 'next-shared' } import { actionAsyncStorageInstance } from './action-async-storage-instance' with {
'turbopack-transition': 'next-shared',
}
export interface ActionStore { export interface ActionStore {
readonly isAction?: boolean readonly isAction?: boolean
readonly isAppRoute?: boolean readonly isAppRoute?: boolean
......
import type { AsyncLocalStorage } from 'async_hooks' import type { AsyncLocalStorage } from 'async_hooks'
// Share the instance module in the next-shared layer // Share the instance module in the next-shared layer
import { afterTaskAsyncStorageInstance as afterTaskAsyncStorage } from './after-task-async-storage-instance' with { 'turbopack-transition': 'next-shared' } import { afterTaskAsyncStorageInstance as afterTaskAsyncStorage } from './after-task-async-storage-instance' with {
'turbopack-transition': 'next-shared',
}
import type { WorkUnitStore } from './work-unit-async-storage.external' import type { WorkUnitStore } from './work-unit-async-storage.external'
export interface AfterTaskStore { export interface AfterTaskStore {
......
...@@ -4,9 +4,9 @@ const sharedAsyncLocalStorageNotAvailableError = new Error( ...@@ -4,9 +4,9 @@ const sharedAsyncLocalStorageNotAvailableError = new Error(
'Invariant: AsyncLocalStorage accessed in runtime where it is not available' 'Invariant: AsyncLocalStorage accessed in runtime where it is not available'
) )
class FakeAsyncLocalStorage<Store extends {}> class FakeAsyncLocalStorage<
implements AsyncLocalStorage<Store> Store extends {},
{ > implements AsyncLocalStorage<Store> {
disable(): void { disable(): void {
throw sharedAsyncLocalStorageNotAvailableError throw sharedAsyncLocalStorageNotAvailableError
} }
......
import type { AsyncLocalStorage } from 'async_hooks' import type { AsyncLocalStorage } from 'async_hooks'
// Share the instance module in the next-shared layer // Share the instance module in the next-shared layer
import { consoleAsyncStorageInstance } from './console-async-storage-instance' with { 'turbopack-transition': 'next-shared' } import { consoleAsyncStorageInstance } from './console-async-storage-instance' with {
'turbopack-transition': 'next-shared',
}
export interface ConsoleStore { export interface ConsoleStore {
/** /**
......
import type { AsyncLocalStorage } from 'async_hooks' import type { AsyncLocalStorage } from 'async_hooks'
// Share the instance module in the next-shared layer // Share the instance module in the next-shared layer
import { dynamicAccessAsyncStorageInstance } from './dynamic-access-async-storage-instance' with { 'turbopack-transition': 'next-shared' } import { dynamicAccessAsyncStorageInstance } from './dynamic-access-async-storage-instance' with {
'turbopack-transition': 'next-shared',
}
export interface DynamicAccessAsyncStore { export interface DynamicAccessAsyncStore {
readonly abortController: AbortController readonly abortController: AbortController
......
...@@ -6,6 +6,8 @@ import { ...@@ -6,6 +6,8 @@ import {
trackPendingChunkLoad, trackPendingChunkLoad,
trackPendingImport, trackPendingImport,
trackPendingModules, trackPendingModules,
} from './track-module-loading.instance' with { 'turbopack-transition': 'next-shared' } } from './track-module-loading.instance' with {
'turbopack-transition': 'next-shared',
}
export { trackPendingChunkLoad, trackPendingImport, trackPendingModules } export { trackPendingChunkLoad, trackPendingImport, trackPendingModules }
...@@ -7,7 +7,9 @@ import type { AfterContext } from '../after/after-context' ...@@ -7,7 +7,9 @@ import type { AfterContext } from '../after/after-context'
import type { CacheLife } from '../use-cache/cache-life' import type { CacheLife } from '../use-cache/cache-life'
// Share the instance module in the next-shared layer // Share the instance module in the next-shared layer
import { workAsyncStorageInstance } from './work-async-storage-instance' with { 'turbopack-transition': 'next-shared' } import { workAsyncStorageInstance } from './work-async-storage-instance' with {
'turbopack-transition': 'next-shared',
}
import type { LazyResult } from '../lib/lazy-result' import type { LazyResult } from '../lib/lazy-result'
import type { DigestedError } from './create-error-handler' import type { DigestedError } from './create-error-handler'
import type { ActionRevalidationKind } from '../../shared/lib/action-revalidation-kind' import type { ActionRevalidationKind } from '../../shared/lib/action-revalidation-kind'
......
...@@ -8,7 +8,9 @@ import type { DynamicTrackingState } from './dynamic-rendering' ...@@ -8,7 +8,9 @@ import type { DynamicTrackingState } from './dynamic-rendering'
import type { OpaqueFallbackRouteParams } from '../request/fallback-params' import type { OpaqueFallbackRouteParams } from '../request/fallback-params'
// Share the instance module in the next-shared layer // Share the instance module in the next-shared layer
import { workUnitAsyncStorageInstance } from './work-unit-async-storage-instance' with { 'turbopack-transition': 'next-shared' } import { workUnitAsyncStorageInstance } from './work-unit-async-storage-instance' with {
'turbopack-transition': 'next-shared',
}
import type { ServerComponentsHmrCache } from '../response-cache' import type { ServerComponentsHmrCache } from '../response-cache'
import type { import type {
RenderResumeDataCache, RenderResumeDataCache,
...@@ -108,19 +110,16 @@ export type StaticPrerenderStoreModern = Exclude< ...@@ -108,19 +110,16 @@ export type StaticPrerenderStoreModern = Exclude<
> >
export interface PrerenderStoreModernClient export interface PrerenderStoreModernClient
extends PrerenderStoreModernCommon, extends PrerenderStoreModernCommon, StaticPrerenderStoreCommon {
StaticPrerenderStoreCommon {
readonly type: 'prerender-client' readonly type: 'prerender-client'
} }
export interface PrerenderStoreModernServer export interface PrerenderStoreModernServer
extends PrerenderStoreModernCommon, extends PrerenderStoreModernCommon, StaticPrerenderStoreCommon {
StaticPrerenderStoreCommon {
readonly type: 'prerender' readonly type: 'prerender'
} }
export interface PrerenderStoreModernRuntime export interface PrerenderStoreModernRuntime extends PrerenderStoreModernCommon {
extends PrerenderStoreModernCommon {
readonly type: 'prerender-runtime' readonly type: 'prerender-runtime'
/** /**
...@@ -149,8 +148,7 @@ export interface RevalidateStore { ...@@ -149,8 +148,7 @@ export interface RevalidateStore {
} }
interface PrerenderStoreModernCommon interface PrerenderStoreModernCommon
extends CommonWorkUnitStore, extends CommonWorkUnitStore, RevalidateStore {
RevalidateStore {
/** /**
* The render signal is aborted after React's `prerender` function is aborted * The render signal is aborted after React's `prerender` function is aborted
* (using a separate signal), which happens in two cases: * (using a separate signal), which happens in two cases:
...@@ -226,8 +224,7 @@ interface StaticPrerenderStoreCommon { ...@@ -226,8 +224,7 @@ interface StaticPrerenderStoreCommon {
} }
export interface PrerenderStorePPR export interface PrerenderStorePPR
extends CommonWorkUnitStore, extends CommonWorkUnitStore, RevalidateStore {
RevalidateStore {
readonly type: 'prerender-ppr' readonly type: 'prerender-ppr'
readonly rootParams: Params readonly rootParams: Params
readonly dynamicTracking: null | DynamicTrackingState readonly dynamicTracking: null | DynamicTrackingState
...@@ -245,8 +242,7 @@ export interface PrerenderStorePPR ...@@ -245,8 +242,7 @@ export interface PrerenderStorePPR
} }
export interface PrerenderStoreLegacy export interface PrerenderStoreLegacy
extends CommonWorkUnitStore, extends CommonWorkUnitStore, RevalidateStore {
RevalidateStore {
readonly type: 'prerender-legacy' readonly type: 'prerender-legacy'
readonly rootParams: Params readonly rootParams: Params
} }
...@@ -262,8 +258,10 @@ export type StaticPrerenderStore = Exclude< ...@@ -262,8 +258,10 @@ export type StaticPrerenderStore = Exclude<
PrerenderStoreModernRuntime PrerenderStoreModernRuntime
> >
export interface CommonCacheStore export interface CommonCacheStore extends Omit<
extends Omit<CommonWorkUnitStore, 'implicitTags'> { CommonWorkUnitStore,
'implicitTags'
> {
/** /**
* A cache work unit store might not always have an outer work unit store, * A cache work unit store might not always have an outer work unit store,
* from which implicit tags could be inherited. * from which implicit tags could be inherited.
......
...@@ -42,12 +42,12 @@ export class DraftModeProvider { ...@@ -42,12 +42,12 @@ export class DraftModeProvider {
this._isEnabled = Boolean( this._isEnabled = Boolean(
!isOnDemandRevalidate && !isOnDemandRevalidate &&
cookieValue && cookieValue &&
previewProps && previewProps &&
(cookieValue === previewProps.previewModeId || (cookieValue === previewProps.previewModeId ||
// In dev mode, the cookie can be actual hash value preview id but the preview props can still be `development-id`. // In dev mode, the cookie can be actual hash value preview id but the preview props can still be `development-id`.
(process.env.NODE_ENV !== 'production' && (process.env.NODE_ENV !== 'production' &&
previewProps.previewModeId === 'development-id')) previewProps.previewModeId === 'development-id'))
) )
this._previewModeId = previewProps?.previewModeId this._previewModeId = previewProps?.previewModeId
......
...@@ -264,9 +264,8 @@ type BaseRenderOpts = RenderOpts & { ...@@ -264,9 +264,8 @@ type BaseRenderOpts = RenderOpts & {
*/ */
export interface BaseRequestHandler< export interface BaseRequestHandler<
ServerRequest extends BaseNextRequest | IncomingMessage = BaseNextRequest, ServerRequest extends BaseNextRequest | IncomingMessage = BaseNextRequest,
ServerResponse extends ServerResponse extends BaseNextResponse | HTTPServerResponse =
| BaseNextResponse BaseNextResponse,
| HTTPServerResponse = BaseNextResponse,
> { > {
( (
req: ServerRequest, req: ServerRequest,
......
...@@ -480,9 +480,8 @@ export async function findPagePathData( ...@@ -480,9 +480,8 @@ export async function findPagePathData(
// If they're not presented, then fallback to global-not-found // If they're not presented, then fallback to global-not-found
return { return {
filename: require.resolve( filename:
'next/dist/client/components/builtin/global-not-found' require.resolve('next/dist/client/components/builtin/global-not-found'),
),
bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`, bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,
page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY, page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,
} }
......
...@@ -518,7 +518,7 @@ export function createPatchedFetcher( ...@@ -518,7 +518,7 @@ export function createPatchedFetcher(
let autoNoCache = Boolean( let autoNoCache = Boolean(
(hasUnCacheableHeader || isUnCacheableMethod) && (hasUnCacheableHeader || isUnCacheableMethod) &&
revalidateStore?.revalidate === 0 revalidateStore?.revalidate === 0
) )
let isImplicitBuildTimeCache = false let isImplicitBuildTimeCache = false
......
...@@ -496,15 +496,13 @@ async function startWatcher( ...@@ -496,15 +496,13 @@ async function startWatcher(
const isAppPath = Boolean( const isAppPath = Boolean(
appDir && appDir &&
normalizePathSep(fileName).startsWith( normalizePathSep(fileName).startsWith(normalizePathSep(appDir) + '/')
normalizePathSep(appDir) + '/'
)
) )
const isPagePath = Boolean( const isPagePath = Boolean(
pagesDir && pagesDir &&
normalizePathSep(fileName).startsWith( normalizePathSep(fileName).startsWith(
normalizePathSep(pagesDir) + '/' normalizePathSep(pagesDir) + '/'
) )
) )
const rootFile = absolutePathToPage(fileName, { const rootFile = absolutePathToPage(fileName, {
......
...@@ -34,8 +34,8 @@ export function getServerActionRequestMetadata( ...@@ -34,8 +34,8 @@ export function getServerActionRequestMetadata(
) )
const isFetchAction = Boolean( const isFetchAction = Boolean(
actionId !== undefined && actionId !== undefined &&
typeof actionId === 'string' && typeof actionId === 'string' &&
req.method === 'POST' req.method === 'POST'
) )
const isPossibleServerAction = Boolean( const isPossibleServerAction = Boolean(
......
import type { RouteDefinition } from './route-definition' import type { RouteDefinition } from './route-definition'
import { RouteKind } from '../route-kind' import { RouteKind } from '../route-kind'
export interface AppPageRouteDefinition export interface AppPageRouteDefinition extends RouteDefinition<RouteKind.APP_PAGE> {
extends RouteDefinition<RouteKind.APP_PAGE> {
readonly appPaths: ReadonlyArray<string> readonly appPaths: ReadonlyArray<string>
} }
......
import type { RouteKind } from '../route-kind' import type { RouteKind } from '../route-kind'
import type { RouteDefinition } from './route-definition' import type { RouteDefinition } from './route-definition'
export interface AppRouteRouteDefinition export interface AppRouteRouteDefinition extends RouteDefinition<RouteKind.APP_ROUTE> {}
extends RouteDefinition<RouteKind.APP_ROUTE> {}
import type { RouteDefinition } from './route-definition' import type { RouteDefinition } from './route-definition'
import type { RouteKind } from '../route-kind' import type { RouteKind } from '../route-kind'
export interface LocaleRouteDefinition<K extends RouteKind = RouteKind> export interface LocaleRouteDefinition<
extends RouteDefinition<K> { K extends RouteKind = RouteKind,
> extends RouteDefinition<K> {
/** /**
* When defined it means that this route is locale aware. When undefined, * When defined it means that this route is locale aware. When undefined,
* it means no special handling has to occur to process locales. * it means no special handling has to occur to process locales.
......
import type { RouteKind } from '../route-kind' import type { RouteKind } from '../route-kind'
import type { LocaleRouteDefinition } from './locale-route-definition' import type { LocaleRouteDefinition } from './locale-route-definition'
export interface PagesAPIRouteDefinition export interface PagesAPIRouteDefinition extends LocaleRouteDefinition<RouteKind.PAGES_API> {}
extends LocaleRouteDefinition<RouteKind.PAGES_API> {}
import type { LocaleRouteDefinition } from './locale-route-definition' import type { LocaleRouteDefinition } from './locale-route-definition'
import type { RouteKind } from '../route-kind' import type { RouteKind } from '../route-kind'
export interface PagesRouteDefinition export interface PagesRouteDefinition extends LocaleRouteDefinition<RouteKind.PAGES> {}
extends LocaleRouteDefinition<RouteKind.PAGES> {}
...@@ -12,8 +12,7 @@ interface LoaderComparable<D> { ...@@ -12,8 +12,7 @@ interface LoaderComparable<D> {
export abstract class CachedRouteMatcherProvider< export abstract class CachedRouteMatcherProvider<
M extends RouteMatcher = RouteMatcher, M extends RouteMatcher = RouteMatcher,
D = any, D = any,
> implements RouteMatcherProvider<M> > implements RouteMatcherProvider<M> {
{
private data?: D private data?: D
private cached: ReadonlyArray<M> = [] private cached: ReadonlyArray<M> = []
......
import type { RouteMatch } from './route-match' import type { RouteMatch } from './route-match'
import type { AppRouteRouteDefinition } from '../route-definitions/app-route-route-definition' import type { AppRouteRouteDefinition } from '../route-definitions/app-route-route-definition'
export interface AppRouteRouteMatch export interface AppRouteRouteMatch extends RouteMatch<AppRouteRouteDefinition> {}
extends RouteMatch<AppRouteRouteDefinition> {}
import type { LocaleRouteDefinition } from '../route-definitions/locale-route-definition' import type { LocaleRouteDefinition } from '../route-definitions/locale-route-definition'
import type { RouteMatch } from './route-match' import type { RouteMatch } from './route-match'
export interface LocaleRouteMatch<R extends LocaleRouteDefinition> export interface LocaleRouteMatch<
extends RouteMatch<R> { R extends LocaleRouteDefinition,
> extends RouteMatch<R> {
readonly detectedLocale?: string readonly detectedLocale?: string
} }
...@@ -3,8 +3,7 @@ import type { PagesAPIRouteDefinition } from '../route-definitions/pages-api-rou ...@@ -3,8 +3,7 @@ import type { PagesAPIRouteDefinition } from '../route-definitions/pages-api-rou
import { RouteKind } from '../route-kind' import { RouteKind } from '../route-kind'
export interface PagesAPIRouteMatch export interface PagesAPIRouteMatch extends RouteMatch<PagesAPIRouteDefinition> {}
extends RouteMatch<PagesAPIRouteDefinition> {}
/** /**
* Checks if the given match is a Pages API route match. * Checks if the given match is a Pages API route match.
......
import type { PagesRouteDefinition } from '../route-definitions/pages-route-definition' import type { PagesRouteDefinition } from '../route-definitions/pages-route-definition'
import type { LocaleRouteMatch } from './locale-route-match' import type { LocaleRouteMatch } from './locale-route-match'
export interface PagesRouteMatch export interface PagesRouteMatch extends LocaleRouteMatch<PagesRouteDefinition> {}
extends LocaleRouteMatch<PagesRouteDefinition> {}
...@@ -172,8 +172,10 @@ export type AppRouteUserlandModule = AppRouteHandlers & ...@@ -172,8 +172,10 @@ export type AppRouteUserlandModule = AppRouteHandlers &
* AppRouteRouteModuleOptions is the options that are passed to the app route * AppRouteRouteModuleOptions is the options that are passed to the app route
* module from the bundled code. * module from the bundled code.
*/ */
export interface AppRouteRouteModuleOptions export interface AppRouteRouteModuleOptions extends RouteModuleOptions<
extends RouteModuleOptions<AppRouteRouteDefinition, AppRouteUserlandModule> { AppRouteRouteDefinition,
AppRouteUserlandModule
> {
readonly resolvedPagePath: string readonly resolvedPagePath: string
readonly nextConfigOutput: NextConfig['output'] readonly nextConfigOutput: NextConfig['output']
} }
......
...@@ -81,8 +81,10 @@ type PagesComponents = { ...@@ -81,8 +81,10 @@ type PagesComponents = {
readonly Document: DocumentType readonly Document: DocumentType
} }
export interface PagesRouteModuleOptions export interface PagesRouteModuleOptions extends RouteModuleOptions<
extends RouteModuleOptions<PagesRouteDefinition, PagesUserlandModule> { PagesRouteDefinition,
PagesUserlandModule
> {
readonly components: PagesComponents readonly components: PagesComponents
} }
......
...@@ -160,9 +160,8 @@ export abstract class RouteModule< ...@@ -160,9 +160,8 @@ export abstract class RouteModule<
getRequestMeta(req, 'relativeProjectDir') || this.relativeProjectDir getRequestMeta(req, 'relativeProjectDir') || this.relativeProjectDir
) )
const { instrumentationOnRequestError } = await import( const { instrumentationOnRequestError } =
'../lib/router-utils/instrumentation-globals.external.js' await import('../lib/router-utils/instrumentation-globals.external.js')
)
return instrumentationOnRequestError( return instrumentationOnRequestError(
absoluteProjectDir, absoluteProjectDir,
...@@ -614,9 +613,8 @@ export abstract class RouteModule< ...@@ -614,9 +613,8 @@ export abstract class RouteModule<
if (absoluteDistDir) { if (absoluteDistDir) {
this.distDir = relative(absoluteProjectDir, absoluteDistDir) this.distDir = relative(absoluteProjectDir, absoluteDistDir)
} }
const { ensureInstrumentationRegistered } = await import( const { ensureInstrumentationRegistered } =
'../lib/router-utils/instrumentation-globals.external.js' await import('../lib/router-utils/instrumentation-globals.external.js')
)
// ensure instrumentation is registered and pass // ensure instrumentation is registered and pass
// onRequestError below // onRequestError below
ensureInstrumentationRegistered(absoluteProjectDir, this.distDir) ensureInstrumentationRegistered(absoluteProjectDir, this.distDir)
......
...@@ -89,8 +89,16 @@ export type NextPage<Props = {}, InitialProps = Props> = NextComponentType< ...@@ -89,8 +89,16 @@ export type NextPage<Props = {}, InitialProps = Props> = NextComponentType<
> >
export type FileSizeSuffix = `${ export type FileSizeSuffix = `${
'k' | 'K' | 'm' | 'M' | 'g' | 'G' | 't' | 'T' | 'p' | 'P' | 'k'
}${'b' | 'B'}` | 'K'
| 'm'
| 'M'
| 'g'
| 'G'
| 't'
| 'T'
| 'p'
| 'P'}${'b' | 'B'}`
export type SizeLimit = number | `${number}${FileSizeSuffix}` export type SizeLimit = number | `${number}${FileSizeSuffix}`
......
This diff is collapsed.
...@@ -10,7 +10,9 @@ describe('hmr-iframe', () => { ...@@ -10,7 +10,9 @@ describe('hmr-iframe', () => {
let browser = await next.browser('/page1') let browser = await next.browser('/page1')
expect( expect(
await (await (await browser.elementByCss('iframe')).contentFrame()) await (
await (await browser.elementByCss('iframe')).contentFrame()
)
.locator('p') .locator('p')
.innerText() .innerText()
).toEqual('content') ).toEqual('content')
...@@ -23,7 +25,9 @@ describe('hmr-iframe', () => { ...@@ -23,7 +25,9 @@ describe('hmr-iframe', () => {
await waitForNoRedbox(browser) await waitForNoRedbox(browser)
expect( expect(
await (await (await browser.elementByCss('iframe')).contentFrame()) await (
await (await browser.elementByCss('iframe')).contentFrame()
)
.locator('p') .locator('p')
.innerText() .innerText()
).toEqual('content-new') ).toEqual('content-new')
......
...@@ -10,23 +10,21 @@ export const contentType = 'image/png' ...@@ -10,23 +10,21 @@ export const contentType = 'image/png'
export default async function Image() { export default async function Image() {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ fontSize: 24,
fontSize: 24, background: 'linear-gradient(90deg, #000 0%, #111 100%)',
background: 'linear-gradient(90deg, #000 0%, #111 100%)', color: 'white',
color: 'white', width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', textAlign: 'center',
textAlign: 'center', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', }}
}} >
> OpenGraph Test Image
OpenGraph Test Image </div>,
</div>
),
{ {
...size, ...size,
} }
......
...@@ -2,22 +2,20 @@ import { ImageResponse } from 'next/og' ...@@ -2,22 +2,20 @@ import { ImageResponse } from 'next/og'
export default function OpenGraphImage() { export default function OpenGraphImage() {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: 1200,
width: 1200, height: 630,
height: 630, backgroundColor: '#000',
backgroundColor: '#000', color: '#fff',
color: '#fff', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', flexDirection: 'column',
flexDirection: 'column', fontFamily: 'sans-serif',
fontFamily: 'sans-serif', }}
}} >
> OG
OG </div>
</div>
)
) )
} }
...@@ -4,21 +4,19 @@ export default async function icon({ params, id }) { ...@@ -4,21 +4,19 @@ export default async function icon({ params, id }) {
const { size } = await params const { size } = await params
const iconId = await id const iconId = await id
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 88,
fontSize: 88, background: '#000',
background: '#000', color: '#fafafa',
color: '#fafafa', }}
}} >
> Apple {size} {iconId}
Apple {size} {iconId} </div>
</div>
)
) )
} }
...@@ -17,21 +17,19 @@ export async function generateImageMetadata({ params }) { ...@@ -17,21 +17,19 @@ export async function generateImageMetadata({ params }) {
export default function icon({ params, id }) { export default function icon({ params, id }) {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 88,
fontSize: 88, background: '#000',
background: '#000', color: '#fafafa',
color: '#fafafa', }}
}} >
> Apple {params.size} {id}
Apple {params.size} {id} </div>
</div>
)
) )
} }
...@@ -19,21 +19,19 @@ export default async function icon({ params, id }) { ...@@ -19,21 +19,19 @@ export default async function icon({ params, id }) {
const { size } = await params const { size } = await params
const iconId = await id const iconId = await id
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 88,
fontSize: 88, background: '#fff',
background: '#fff', color: '#000',
color: '#000', }}
}} >
> Icon {size} {iconId}
Icon {size} {iconId} </div>
</div>
)
) )
} }
...@@ -7,26 +7,24 @@ export default async function og({ params }) { ...@@ -7,26 +7,24 @@ export default async function og({ params }) {
const big = size === 'big' const big = size === 'big'
const background = big ? 'orange' : '#000' const background = big ? 'orange' : '#000'
return new ImageResponse( return new ImageResponse(
( <div
style={{
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: 128,
}}
>
<div <div
style={{ style={{
width: '100%', width: 200,
height: '100%', height: 200,
display: 'flex', background,
alignItems: 'center',
justifyContent: 'center',
fontSize: 128,
}} }}
> />
<div </div>,
style={{
width: 200,
height: 200,
background,
}}
/>
</div>
),
{ {
width: big === true ? 1200 : 600, width: big === true ? 1200 : 600,
height: big === true ? 630 : 315, height: big === true ? 630 : 315,
......
...@@ -2,21 +2,19 @@ import { ImageResponse } from 'next/og' ...@@ -2,21 +2,19 @@ import { ImageResponse } from 'next/og'
export default function og() { export default function og() {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 128,
fontSize: 128, color: '#fff',
color: '#fff', background: '#000',
background: '#000', }}
}} >
> group route og
group route og </div>
</div>
)
) )
} }
...@@ -5,21 +5,19 @@ export const size = { width: 1200, height: 675 } ...@@ -5,21 +5,19 @@ export const size = { width: 1200, height: 675 }
export default function twitter() { export default function twitter() {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 128,
fontSize: 128, background: 'lavender',
background: 'lavender', }}
}} >
> group route twitter
group route twitter </div>,
</div>
),
size size
) )
} }
......
...@@ -4,21 +4,19 @@ export const contentType = 'image/png' ...@@ -4,21 +4,19 @@ export const contentType = 'image/png'
export default function appleIcon() { export default function appleIcon() {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 88,
fontSize: 88, background: '#fff',
background: '#fff', color: '#000',
color: '#000', }}
}} >
> Apple Icon
Apple Icon </div>
</div>
)
) )
} }
...@@ -3,21 +3,19 @@ import { ImageResponse } from 'next/og' ...@@ -3,21 +3,19 @@ import { ImageResponse } from 'next/og'
export default function favicon() { export default function favicon() {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 88,
fontSize: 88, background: '#fff',
background: '#fff', color: '#000',
color: '#000', }}
}} >
> Favicon
Favicon </div>
</div>
)
) )
} }
...@@ -19,21 +19,19 @@ export default async function icon({ params, id }) { ...@@ -19,21 +19,19 @@ export default async function icon({ params, id }) {
const { size } = await params const { size } = await params
const iconId = await id const iconId = await id
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 88,
fontSize: 88, background: '#fff',
background: '#fff', color: '#000',
color: '#000', }}
}} >
> Icon {size} {iconId}
Icon {size} {iconId} </div>
</div>
)
) )
} }
...@@ -5,21 +5,19 @@ export const size = { width: 512, height: 512 } ...@@ -5,21 +5,19 @@ export const size = { width: 512, height: 512 }
export default function icon() { export default function icon() {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 88,
fontSize: 88, background: '#fff',
background: '#fff', color: '#000',
color: '#000', }}
}} >
> Icon
Icon </div>
</div>
)
) )
} }
...@@ -19,20 +19,18 @@ export async function generateImageMetadata() { ...@@ -19,20 +19,18 @@ export async function generateImageMetadata() {
export default function og() { export default function og() {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 128,
fontSize: 128, background: 'lavender',
background: 'lavender', }}
}} >
> Open Graph
Open Graph </div>
</div>
)
) )
} }
...@@ -5,20 +5,18 @@ export const alt = 'Open Graph' ...@@ -5,20 +5,18 @@ export const alt = 'Open Graph'
/* without generateImageMetadata */ /* without generateImageMetadata */
export default function og() { export default function og() {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 128,
fontSize: 128, background: 'lavender',
background: 'lavender', }}
}} >
> Open Graph
Open Graph </div>
</div>
)
) )
} }
...@@ -12,21 +12,19 @@ export const size = { width: 1600, height: 900 } ...@@ -12,21 +12,19 @@ export const size = { width: 1600, height: 900 }
export default function twitter() { export default function twitter() {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 128,
fontSize: 128, background: 'lavender',
background: 'lavender', }}
}} >
> Twitter Image
Twitter Image </div>,
</div>
),
size size
) )
} }
...@@ -13,21 +13,19 @@ export const size = { width: 1600, height: 900 } ...@@ -13,21 +13,19 @@ export const size = { width: 1600, height: 900 }
export default function twitter() { export default function twitter() {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 128,
fontSize: 128, background: 'lavender',
background: 'lavender', }}
}} >
> Twitter Image
Twitter Image </div>,
</div>
),
size size
) )
} }
......
...@@ -7,22 +7,20 @@ export default async function og() { ...@@ -7,22 +7,20 @@ export default async function og() {
new URL('../../assets/typewr__.ttf', import.meta.url) new URL('../../assets/typewr__.ttf', import.meta.url)
).then((res) => res.arrayBuffer()) ).then((res) => res.arrayBuffer())
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 88,
fontSize: 88, background: '#fff',
background: '#fff', color: '#000',
color: '#000', }}
}} >
> Typewriter og
Typewriter og </div>,
</div>
),
{ {
fonts: [ fonts: [
{ {
......
...@@ -9,22 +9,20 @@ export default async function og() { ...@@ -9,22 +9,20 @@ export default async function og() {
path.join(process.cwd(), 'assets/typewr__.ttf') path.join(process.cwd(), 'assets/typewr__.ttf')
) )
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 88,
fontSize: 88, background: '#fff',
background: '#fff', color: '#000',
color: '#000', }}
}} >
> Typewriter og
Typewriter og </div>,
</div>
),
{ {
fonts: [ fonts: [
{ {
......
...@@ -5,6 +5,7 @@ This fixture contains scenarios that **SHOULD throw `MissingDefaultParallelRoute ...@@ -5,6 +5,7 @@ This fixture contains scenarios that **SHOULD throw `MissingDefaultParallelRoute
## Why These Should Error ## Why These Should Error
All scenarios in this fixture have: All scenarios in this fixture have:
1. ✅ Parallel routes (slots starting with `@`) 1. ✅ Parallel routes (slots starting with `@`)
2. ❌ **NO** `default.tsx` files for those parallel routes 2. ❌ **NO** `default.tsx` files for those parallel routes
3. ✅ **Child routes** that make these **non-leaf segments** 3. ✅ **Child routes** that make these **non-leaf segments**
...@@ -32,6 +33,7 @@ app/with-children/ ...@@ -32,6 +33,7 @@ app/with-children/
``` ```
**Expected Error:** **Expected Error:**
``` ```
MissingDefaultParallelRouteError: MissingDefaultParallelRouteError:
Missing required default.js file for parallel route at /with-children/@header Missing required default.js file for parallel route at /with-children/@header
...@@ -39,6 +41,7 @@ MissingDefaultParallelRouteError: ...@@ -39,6 +41,7 @@ MissingDefaultParallelRouteError:
``` ```
**Why it errors:** **Why it errors:**
- When navigating from `/with-children` to `/with-children/child`, the routing system needs to know what to render for the `@header` and `@sidebar` slots - When navigating from `/with-children` to `/with-children/child`, the routing system needs to know what to render for the `@header` and `@sidebar` slots
- Since `/with-children/child` doesn't define these parallel routes, Next.js looks for `default.tsx` files - Since `/with-children/child` doesn't define these parallel routes, Next.js looks for `default.tsx` files
- No `default.tsx` files exist → ERROR! - No `default.tsx` files exist → ERROR!
...@@ -66,6 +69,7 @@ app/with-groups-and-children/(dashboard)/(overview)/ ...@@ -66,6 +69,7 @@ app/with-groups-and-children/(dashboard)/(overview)/
**Route Groups:** `(dashboard)` and `(overview)` don't affect the URL **Route Groups:** `(dashboard)` and `(overview)` don't affect the URL
**Expected Error:** **Expected Error:**
``` ```
MissingDefaultParallelRouteError: MissingDefaultParallelRouteError:
Missing required default.js file for parallel route at /with-groups-and-children/(dashboard)/(overview)/@analytics Missing required default.js file for parallel route at /with-groups-and-children/(dashboard)/(overview)/@analytics
...@@ -73,6 +77,7 @@ MissingDefaultParallelRouteError: ...@@ -73,6 +77,7 @@ MissingDefaultParallelRouteError:
``` ```
**Why it errors:** **Why it errors:**
- Even with route groups, the segment has a child route (`/nested`) - Even with route groups, the segment has a child route (`/nested`)
- The `hasChildRoutesForSegment()` helper correctly: - The `hasChildRoutesForSegment()` helper correctly:
1. Filters out route groups `(dashboard)` and `(overview)` 1. Filters out route groups `(dashboard)` and `(overview)`
...@@ -87,6 +92,7 @@ MissingDefaultParallelRouteError: ...@@ -87,6 +92,7 @@ MissingDefaultParallelRouteError:
To make these scenarios build successfully, add `default.tsx` files: To make these scenarios build successfully, add `default.tsx` files:
### For Scenario 1: ### For Scenario 1:
```tsx ```tsx
// app/with-children/@header/default.tsx // app/with-children/@header/default.tsx
export default function HeaderDefault() { export default function HeaderDefault() {
...@@ -100,6 +106,7 @@ export default function SidebarDefault() { ...@@ -100,6 +106,7 @@ export default function SidebarDefault() {
``` ```
### For Scenario 2: ### For Scenario 2:
```tsx ```tsx
// app/with-groups-and-children/(dashboard)/(overview)/@analytics/default.tsx // app/with-groups-and-children/(dashboard)/(overview)/@analytics/default.tsx
export default function AnalyticsDefault() { export default function AnalyticsDefault() {
...@@ -117,9 +124,11 @@ export default function MetricsDefault() { ...@@ -117,9 +124,11 @@ export default function MetricsDefault() {
## Contrast with `no-build-error` Fixture ## Contrast with `no-build-error` Fixture
The `no-build-error` fixture has similar parallel routes but: The `no-build-error` fixture has similar parallel routes but:
- ❌ **NO child routes** (leaf segments) - ❌ **NO child routes** (leaf segments)
- ✅ `default.tsx` files are **NOT required** - ✅ `default.tsx` files are **NOT required**
This fixture (build-error) has: This fixture (build-error) has:
- ✅ **Child routes exist** (non-leaf segments) - ✅ **Child routes exist** (non-leaf segments)
- ❌ `default.tsx` files **ARE required** but missing → **ERROR!** - ❌ `default.tsx` files **ARE required** but missing → **ERROR!**
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
*/ */
const nextConfig = { const nextConfig = {
cacheHandlers: { cacheHandlers: {
custom: require.resolve( custom:
'next/dist/server/lib/cache-handlers/default.external' require.resolve('next/dist/server/lib/cache-handlers/default.external'),
),
}, },
experimental: { experimental: {
useCache: true, useCache: true,
......
...@@ -38,8 +38,8 @@ describe.skip('Browserslist', () => { ...@@ -38,8 +38,8 @@ describe.skip('Browserslist', () => {
} }
return false return false
}) })
) // Filter out false values )
) ) // Filter out false values
.filter((item) => item) .filter((item) => item)
).toBeEmpty() ).toBeEmpty()
}) })
......
...@@ -16,7 +16,9 @@ export default function ProTip() { ...@@ -16,7 +16,9 @@ export default function ProTip() {
<Typography sx={{ mt: 6, mb: 3 }} color="text.secondary"> <Typography sx={{ mt: 6, mb: 3 }} color="text.secondary">
<LightBulbIcon sx={{ mr: 1, verticalAlign: 'middle' }} /> <LightBulbIcon sx={{ mr: 1, verticalAlign: 'middle' }} />
Pro tip: See more{' '} Pro tip: See more{' '}
<Link href="https://mui.com/getting-started/templates/">templates</Link>{' '} <Link href="https://mui.com/getting-started/templates/">
templates
</Link>{' '}
on the MUI documentation. on the MUI documentation.
</Typography> </Typography>
) )
......
...@@ -4,9 +4,8 @@ import { NextInstance } from 'e2e-utils' ...@@ -4,9 +4,8 @@ import { NextInstance } from 'e2e-utils'
import { renderViaHTTP } from 'next-test-utils' import { renderViaHTTP } from 'next-test-utils'
import { join } from 'path' import { join } from 'path'
const mockedGoogleFontResponses = require.resolve( const mockedGoogleFontResponses =
'./google-font-mocked-responses.js' require.resolve('./google-font-mocked-responses.js')
)
describe('next/font/google basepath', () => { describe('next/font/google basepath', () => {
let next: NextInstance let next: NextInstance
......
...@@ -3,9 +3,8 @@ import { NextInstance } from 'e2e-utils' ...@@ -3,9 +3,8 @@ import { NextInstance } from 'e2e-utils'
import { join } from 'path' import { join } from 'path'
import webdriver from 'next-webdriver' import webdriver from 'next-webdriver'
const mockedGoogleFontResponses = require.resolve( const mockedGoogleFontResponses =
'./google-font-mocked-responses.js' require.resolve('./google-font-mocked-responses.js')
)
describe('next/font/google fetch error', () => { describe('next/font/google fetch error', () => {
const isDev = (global as any).isNextDev const isDev = (global as any).isNextDev
......
...@@ -5,9 +5,8 @@ import { renderViaHTTP } from 'next-test-utils' ...@@ -5,9 +5,8 @@ import { renderViaHTTP } from 'next-test-utils'
import { join } from 'path' import { join } from 'path'
import webdriver from 'next-webdriver' import webdriver from 'next-webdriver'
const mockedGoogleFontResponses = require.resolve( const mockedGoogleFontResponses =
'./google-font-mocked-responses.js' require.resolve('./google-font-mocked-responses.js')
)
function getClassNameRegex(className: string): RegExp { function getClassNameRegex(className: string): RegExp {
return new RegExp(`${className}`) return new RegExp(`${className}`)
......
...@@ -4,9 +4,8 @@ import { NextInstance } from 'e2e-utils' ...@@ -4,9 +4,8 @@ import { NextInstance } from 'e2e-utils'
import { renderViaHTTP } from 'next-test-utils' import { renderViaHTTP } from 'next-test-utils'
import { join } from 'path' import { join } from 'path'
const mockedGoogleFontResponses = require.resolve( const mockedGoogleFontResponses =
'./google-font-mocked-responses.js' require.resolve('./google-font-mocked-responses.js')
)
const isDev = (global as any).isNextDev const isDev = (global as any).isNextDev
......
...@@ -4,9 +4,8 @@ import { NextInstance } from 'e2e-utils' ...@@ -4,9 +4,8 @@ import { NextInstance } from 'e2e-utils'
import { renderViaHTTP } from 'next-test-utils' import { renderViaHTTP } from 'next-test-utils'
import { join } from 'path' import { join } from 'path'
const mockedGoogleFontResponses = require.resolve( const mockedGoogleFontResponses =
'./google-font-mocked-responses.js' require.resolve('./google-font-mocked-responses.js')
)
describe('next/font/google without-preloaded-fonts without _app', () => { describe('next/font/google without-preloaded-fonts without _app', () => {
let next: NextInstance let next: NextInstance
......
...@@ -3,20 +3,18 @@ import { ImageResponse } from 'next/og' ...@@ -3,20 +3,18 @@ import { ImageResponse } from 'next/og'
export default function () { export default function () {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 128,
fontSize: 128, background: 'lavender',
background: 'lavender', }}
}} >
> Hello!
Hello! </div>
</div>
)
) )
} }
...@@ -7,20 +7,18 @@ export const config = { ...@@ -7,20 +7,18 @@ export const config = {
export default function () { export default function () {
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 128,
fontSize: 128, background: 'lavender',
background: 'lavender', }}
}} >
> Hello!
Hello! </div>
</div>
)
) )
} }
...@@ -8,22 +8,20 @@ export async function GET() { ...@@ -8,22 +8,20 @@ export async function GET() {
path.join(process.cwd(), 'assets/typewr__.ttf') path.join(process.cwd(), 'assets/typewr__.ttf')
) )
return new ImageResponse( return new ImageResponse(
( <div
<div style={{
style={{ width: '100%',
width: '100%', height: '100%',
height: '100%', display: 'flex',
display: 'flex', alignItems: 'center',
alignItems: 'center', justifyContent: 'center',
justifyContent: 'center', fontSize: 88,
fontSize: 88, background: '#fff',
background: '#fff', color: '#000',
color: '#000', }}
}} >
> Typewriter og
Typewriter og </div>,
</div>
),
{ {
fonts: [ fonts: [
{ {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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