Commit fbfbb400 authored by Tim Neutkens's avatar Tim Neutkens

Update

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