Unverified Commit ee94be90 authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[dev-overlay] Use same bundle for Pages and App Router (#80019)

parent 9e9d13fb
...@@ -695,5 +695,7 @@ ...@@ -695,5 +695,7 @@
"694": "createPrerenderPathname was called inside a client component scope.", "694": "createPrerenderPathname was called inside a client component scope.",
"695": "Expected workUnitAsyncStorage to have a store.", "695": "Expected workUnitAsyncStorage to have a store.",
"696": "Next DevTools: Can't dispatch %s in this environment. This is a bug in Next.js", "696": "Next DevTools: Can't dispatch %s in this environment. This is a bug in Next.js",
"697": "Next DevTools: Can't render in this environment. This is a bug in Next.js" "697": "Next DevTools: Can't render in this environment. This is a bug in Next.js",
"698": "Next DevTools: App Dev Overlay is already mounted. This is a bug in Next.js",
"699": "Next DevTools: Pages Dev Overlay is already mounted. This is a bug in Next.js"
} }
...@@ -27,7 +27,7 @@ module.exports = ({ dev, ...rest }) => { ...@@ -27,7 +27,7 @@ module.exports = ({ dev, ...rest }) => {
return { return {
entry: path.join( entry: path.join(
__dirname, __dirname,
'src/client/components/react-dev-overlay/app/entrypoint.js' 'src/client/components/react-dev-overlay/entrypoint.js'
), ),
target, target,
mode: dev ? 'development' : 'production', mode: dev ? 'development' : 'production',
......
...@@ -93,7 +93,7 @@ const sharedExternals = [ ...@@ -93,7 +93,7 @@ const sharedExternals = [
const externalsMap = { const externalsMap = {
'./web/sandbox': 'next/dist/server/web/sandbox', './web/sandbox': 'next/dist/server/web/sandbox',
'next/dist/compiled/next-devtools': 'next/dist/compiled/next-devtools':
'commonjs next/dist/client/components/react-dev-overlay/app/app-dev-overlay.shim.js', 'commonjs next/dist/client/components/react-dev-overlay/dev-overlay.shim.js',
} }
const externalsRegexMap = { const externalsRegexMap = {
......
...@@ -17,15 +17,16 @@ import { ...@@ -17,15 +17,16 @@ import {
ACTION_BUILDING_INDICATOR_SHOW, ACTION_BUILDING_INDICATOR_SHOW,
ACTION_RENDERING_INDICATOR_HIDE, ACTION_RENDERING_INDICATOR_HIDE,
ACTION_RENDERING_INDICATOR_SHOW, ACTION_RENDERING_INDICATOR_SHOW,
} from '../shared' } from './shared'
import { startTransition, useInsertionEffect } from 'react' import { startTransition, useInsertionEffect } from 'react'
import { createRoot } from 'react-dom/client' import { createRoot } from 'react-dom/client'
import { FontStyles } from '../font/font-styles' import { FontStyles } from './font/font-styles'
import type { DebugInfo } from '../types' import type { HydrationErrorState } from './pages/hydration-error-state'
import { DevOverlay } from '../ui/dev-overlay' import type { DebugInfo } from './types'
import type { DevIndicatorServerState } from '../../../../server/dev/dev-indicator-server-state' import { DevOverlay } from './ui/dev-overlay'
import type { VersionInfo } from '../../../../server/dev/parse-version-info' import type { DevIndicatorServerState } from '../../../server/dev/dev-indicator-server-state'
import type { VersionInfo } from '../../../server/dev/parse-version-info'
export interface Dispatcher { export interface Dispatcher {
onBuildOk(): void onBuildOk(): void
...@@ -143,22 +144,21 @@ function replayQueuedEvents(dispatch: NonNullable<typeof maybeDispatch>) { ...@@ -143,22 +144,21 @@ function replayQueuedEvents(dispatch: NonNullable<typeof maybeDispatch>) {
} }
} }
function getSquashedHydrationErrorDetails() { function DevOverlayRoot({
// We don't squash hydration errors in the App Router.
return null
}
function AppDevOverlay({
getComponentStack, getComponentStack,
getOwnerStack, getOwnerStack,
getSquashedHydrationErrorDetails,
isRecoverableError, isRecoverableError,
routerType,
}: { }: {
getComponentStack: (error: Error) => string | undefined getComponentStack: (error: Error) => string | undefined
getOwnerStack: (error: Error) => string | null | undefined getOwnerStack: (error: Error) => string | null | undefined
getSquashedHydrationErrorDetails: (error: Error) => HydrationErrorState | null
isRecoverableError: (error: Error) => boolean isRecoverableError: (error: Error) => boolean
routerType: 'app' | 'pages'
}) { }) {
const [state, dispatch] = useErrorOverlayReducer( const [state, dispatch] = useErrorOverlayReducer(
'app', routerType,
getComponentStack, getComponentStack,
getOwnerStack, getOwnerStack,
isRecoverableError isRecoverableError
...@@ -193,13 +193,28 @@ function AppDevOverlay({ ...@@ -193,13 +193,28 @@ function AppDevOverlay({
) )
} }
let isMounted = false let isPagesMounted = false
let isAppMounted = false
function getSquashedHydrationErrorDetailsApp() {
// We don't squash hydration errors in the App Router.
return null
}
export function renderAppDevOverlay( export function renderAppDevOverlay(
getComponentStack: (error: Error) => string | undefined, getComponentStack: (error: Error) => string | undefined,
getOwnerStack: (error: Error) => string | null | undefined, getOwnerStack: (error: Error) => string | null | undefined,
isRecoverableError: (error: Error) => boolean isRecoverableError: (error: Error) => boolean
): void { ): void {
if (!isMounted) { if (isPagesMounted) {
// Switching between App and Pages Router is always a hard navigation
// TODO: Support soft navigation between App and Pages Router
throw new Error(
'Next DevTools: Pages Dev Overlay is already mounted. This is a bug in Next.js'
)
}
if (!isAppMounted) {
// React 19 will not throw away `<script>` elements in a container it owns. // React 19 will not throw away `<script>` elements in a container it owns.
// This ensures the actual user-space React does not unmount the Dev Overlay. // This ensures the actual user-space React does not unmount the Dev Overlay.
const script = document.createElement('script') const script = document.createElement('script')
...@@ -225,14 +240,80 @@ export function renderAppDevOverlay( ...@@ -225,14 +240,80 @@ export function renderAppDevOverlay(
// TODO: Dedicated error boundary or root error callbacks? // TODO: Dedicated error boundary or root error callbacks?
// At least it won't unmount any user code if it errors. // At least it won't unmount any user code if it errors.
root.render( root.render(
<AppDevOverlay <DevOverlayRoot
getComponentStack={getComponentStack}
getOwnerStack={getOwnerStack}
getSquashedHydrationErrorDetails={getSquashedHydrationErrorDetailsApp}
isRecoverableError={isRecoverableError}
routerType="app"
/>
)
})
isAppMounted = true
}
}
export function renderPagesDevOverlay(
getComponentStack: (error: Error) => string | undefined,
getOwnerStack: (error: Error) => string | null | undefined,
getSquashedHydrationErrorDetails: (
error: Error
) => HydrationErrorState | null,
isRecoverableError: (error: Error) => boolean
): void {
if (isAppMounted) {
// Switching between App and Pages Router is always a hard navigation
// TODO: Support soft navigation between App and Pages Router
throw new Error(
'Next DevTools: App Dev Overlay is already mounted. This is a bug in Next.js'
)
}
if (!isPagesMounted) {
const container = document.createElement('nextjs-portal')
// Although the style applied to the shadow host is isolated,
// the element that attached the shadow host (i.e. "script")
// is still affected by the parent's style (e.g. "body"). This may
// occur style conflicts like "display: flex", with other children
// elements therefore give the shadow host an absolute position.
container.style.position = 'absolute'
// Pages Router runs with React 18 or 19 so we can't use the same trick as with
// App Router. We just reconnect the container if React wipes it e.g. when
// we recover from a shell error via createRoot()
new MutationObserver((records) => {
for (const record of records) {
if (record.type === 'childList') {
for (const node of record.removedNodes) {
if (node === container) {
// Reconnect the container to the body
document.body.appendChild(container)
}
}
}
}
}).observe(document.body, {
childList: true,
})
document.body.appendChild(container)
const root = createRoot(container)
startTransition(() => {
// TODO: Dedicated error boundary or root error callbacks?
// At least it won't unmount any user code if it errors.
root.render(
<DevOverlayRoot
getComponentStack={getComponentStack} getComponentStack={getComponentStack}
getOwnerStack={getOwnerStack} getOwnerStack={getOwnerStack}
getSquashedHydrationErrorDetails={getSquashedHydrationErrorDetails}
isRecoverableError={isRecoverableError} isRecoverableError={isRecoverableError}
routerType="pages"
/> />
) )
}) })
isMounted = true isPagesMounted = true
} }
} }
...@@ -4,6 +4,12 @@ export function renderAppDevOverlay() { ...@@ -4,6 +4,12 @@ export function renderAppDevOverlay() {
) )
} }
export function renderPagesDevOverlay() {
throw new Error(
"Next DevTools: Can't render in this environment. This is a bug in Next.js"
)
}
// TODO: Extract into separate functions that are imported // TODO: Extract into separate functions that are imported
export const dispatcher = new Proxy( export const dispatcher = new Proxy(
{}, {},
......
import * as Bus from './bus' import { dispatcher } from 'next/dist/compiled/next-devtools'
import { import {
attachHydrationErrorState, attachHydrationErrorState,
storeHydrationErrorStateFromConsoleArgs, storeHydrationErrorStateFromConsoleArgs,
} from './hydration-error-state' } from './hydration-error-state'
import {
ACTION_BEFORE_REFRESH,
ACTION_BUILDING_INDICATOR_HIDE,
ACTION_BUILD_ERROR,
ACTION_BUILD_OK,
ACTION_BUILDING_INDICATOR_SHOW,
ACTION_DEV_INDICATOR,
ACTION_REFRESH,
ACTION_STATIC_INDICATOR,
ACTION_UNHANDLED_ERROR,
ACTION_UNHANDLED_REJECTION,
ACTION_VERSION_INFO,
} from '../shared'
import type { VersionInfo } from '../../../../server/dev/parse-version-info' import type { VersionInfo } from '../../../../server/dev/parse-version-info'
import type { DevIndicatorServerState } from '../../../../server/dev/dev-indicator-server-state' import type { DevIndicatorServerState } from '../../../../server/dev/dev-indicator-server-state'
...@@ -35,10 +22,7 @@ function handleError(error: unknown) { ...@@ -35,10 +22,7 @@ function handleError(error: unknown) {
error.name !== 'ModuleBuildError' && error.name !== 'ModuleBuildError' &&
error.name !== 'ModuleNotFoundError' error.name !== 'ModuleNotFoundError'
) { ) {
Bus.emit({ dispatcher.onUnhandledError(error)
type: ACTION_UNHANDLED_ERROR,
reason: error,
})
} }
} }
...@@ -68,10 +52,7 @@ function onUnhandledRejection(ev: PromiseRejectionEvent) { ...@@ -68,10 +52,7 @@ function onUnhandledRejection(ev: PromiseRejectionEvent) {
return return
} }
Bus.emit({ dispatcher.onUnhandledRejection(reason)
type: ACTION_UNHANDLED_REJECTION,
reason: reason,
})
} }
export function register() { export function register() {
...@@ -90,39 +71,39 @@ export function register() { ...@@ -90,39 +71,39 @@ export function register() {
} }
export function onBuildOk() { export function onBuildOk() {
Bus.emit({ type: ACTION_BUILD_OK }) dispatcher.onBuildOk()
} }
export function onBuildError(message: string) { export function onBuildError(message: string) {
Bus.emit({ type: ACTION_BUILD_ERROR, message }) dispatcher.onBuildError(message)
} }
export function onRefresh() { export function onRefresh() {
Bus.emit({ type: ACTION_REFRESH }) dispatcher.onRefresh()
} }
export function onBeforeRefresh() { export function onBeforeRefresh() {
Bus.emit({ type: ACTION_BEFORE_REFRESH }) dispatcher.onBeforeRefresh()
} }
export function onVersionInfo(versionInfo: VersionInfo) { export function onVersionInfo(versionInfo: VersionInfo) {
Bus.emit({ type: ACTION_VERSION_INFO, versionInfo }) dispatcher.onVersionInfo(versionInfo)
} }
export function onStaticIndicator(isStatic: boolean) { export function onStaticIndicator(isStatic: boolean) {
Bus.emit({ type: ACTION_STATIC_INDICATOR, staticIndicator: isStatic }) dispatcher.onStaticIndicator(isStatic)
} }
export function onDevIndicator(devIndicatorsState: DevIndicatorServerState) { export function onDevIndicator(devIndicatorsState: DevIndicatorServerState) {
Bus.emit({ type: ACTION_DEV_INDICATOR, devIndicator: devIndicatorsState }) dispatcher.onDevIndicator(devIndicatorsState)
} }
export function buildingIndicatorShow() { export function buildingIndicatorShow() {
Bus.emit({ type: ACTION_BUILDING_INDICATOR_SHOW }) dispatcher.buildingIndicatorShow()
} }
export function buildingIndicatorHide() { export function buildingIndicatorHide() {
Bus.emit({ type: ACTION_BUILDING_INDICATOR_HIDE }) dispatcher.buildingIndicatorHide()
} }
export { getErrorByType } from '../utils/get-error-by-type' export { getErrorByType } from '../utils/get-error-by-type'
......
import React from 'react' import React from 'react'
import * as Bus from './bus'
import { useErrorOverlayReducer } from '../shared'
import { Router } from '../../../router' import { Router } from '../../../router'
import { renderPagesDevOverlay } from 'next/dist/compiled/next-devtools'
import { getComponentStack, getOwnerStack } from '../../errors/stitched-error' import { getComponentStack, getOwnerStack } from '../../errors/stitched-error'
import { isRecoverableError } from '../../../react-client-callbacks/on-recoverable-error' import { isRecoverableError } from '../../../react-client-callbacks/on-recoverable-error'
import { getSquashedHydrationErrorDetails } from './hydration-error-state'
export const usePagesDevOverlay = () => { export const usePagesDevOverlayBridge = () => {
const [state, dispatch] = useErrorOverlayReducer( React.useInsertionEffect(() => {
'pages', // NDT uses a different React instance so it's not technically a state update
getComponentStack, // scheduled from useInsertionEffect.
getOwnerStack, renderPagesDevOverlay(
isRecoverableError getComponentStack,
) getOwnerStack,
getSquashedHydrationErrorDetails,
isRecoverableError
)
}, [])
React.useEffect(() => { React.useEffect(() => {
Bus.on(dispatch)
const { handleStaticIndicator } = const { handleStaticIndicator } =
require('./hot-reloader-client') as typeof import('./hot-reloader-client') require('./hot-reloader-client') as typeof import('./hot-reloader-client')
...@@ -23,12 +25,6 @@ export const usePagesDevOverlay = () => { ...@@ -23,12 +25,6 @@ export const usePagesDevOverlay = () => {
return function () { return function () {
Router.events.off('routeChangeComplete', handleStaticIndicator) Router.events.off('routeChangeComplete', handleStaticIndicator)
Bus.off(dispatch)
} }
}, [dispatch]) }, [])
return {
state,
dispatch,
}
} }
import { PagesDevOverlayErrorBoundary } from './pages-dev-overlay-error-boundary'
import { usePagesDevOverlayBridge } from './hooks'
export type ErrorType = 'runtime' | 'build'
export type PagesDevOverlayBridgeType = typeof PagesDevOverlayBridge
interface PagesDevOverlayBridgeProps {
children?: React.ReactNode
}
export function PagesDevOverlayBridge({
children,
}: PagesDevOverlayBridgeProps) {
usePagesDevOverlayBridge()
return <PagesDevOverlayErrorBoundary>{children}</PagesDevOverlayErrorBoundary>
}
import { useInsertionEffect } from 'react'
import { PagesDevOverlayErrorBoundary } from './pages-dev-overlay-error-boundary'
import { usePagesDevOverlay } from './hooks'
import { FontStyles } from '../font/font-styles'
import { DevOverlay } from '../ui/dev-overlay'
import { getSquashedHydrationErrorDetails } from './hydration-error-state'
export type ErrorType = 'runtime' | 'build'
export type PagesDevOverlayType = typeof PagesDevOverlay
interface PagesDevOverlayProps {
children?: React.ReactNode
}
export function PagesDevOverlay({ children }: PagesDevOverlayProps) {
const { state, dispatch } = usePagesDevOverlay()
// TODO: Remove once Root initializer creates this element
useInsertionEffect(() => {
const container = document.createElement('nextjs-portal')
document.body.appendChild(container)
}, [])
return (
<>
<PagesDevOverlayErrorBoundary>{children}</PagesDevOverlayErrorBoundary>
{/* Fonts can only be loaded outside the Shadow DOM. */}
<FontStyles />
<DevOverlay
state={state}
dispatch={dispatch}
getSquashedHydrationErrorDetails={getSquashedHydrationErrorDetails}
/>
</>
)
}
...@@ -179,9 +179,11 @@ class Container extends React.Component<{ ...@@ -179,9 +179,11 @@ class Container extends React.Component<{
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
return this.props.children return this.props.children
} else { } else {
const { PagesDevOverlay } = const { PagesDevOverlayBridge } =
require('./components/react-dev-overlay/pages/pages-dev-overlay') as typeof import('./components/react-dev-overlay/pages/pages-dev-overlay') require('./components/react-dev-overlay/pages/pages-dev-overlay-bridge') as typeof import('./components/react-dev-overlay/pages/pages-dev-overlay-bridge')
return <PagesDevOverlay>{this.props.children}</PagesDevOverlay> return (
<PagesDevOverlayBridge>{this.props.children}</PagesDevOverlayBridge>
)
} }
} }
} }
......
...@@ -21,6 +21,7 @@ import type { NodeNextResponse, NodeNextRequest } from '../base-http/node' ...@@ -21,6 +21,7 @@ import type { NodeNextResponse, NodeNextRequest } from '../base-http/node'
import type { RouteEnsurer } from '../route-matcher-managers/dev-route-matcher-manager' import type { RouteEnsurer } from '../route-matcher-managers/dev-route-matcher-manager'
import type { PagesManifest } from '../../build/webpack/plugins/pages-manifest-plugin' import type { PagesManifest } from '../../build/webpack/plugins/pages-manifest-plugin'
import * as React from 'react'
import fs from 'fs' import fs from 'fs'
import { Worker } from 'next/dist/compiled/jest-worker' import { Worker } from 'next/dist/compiled/jest-worker'
import { join as pathJoin } from 'path' import { join as pathJoin } from 'path'
...@@ -67,21 +68,21 @@ import type { ServerOnInstrumentationRequestError } from '../app-render/types' ...@@ -67,21 +68,21 @@ import type { ServerOnInstrumentationRequestError } from '../app-render/types'
import type { ServerComponentsHmrCache } from '../response-cache' import type { ServerComponentsHmrCache } from '../response-cache'
import { logRequests } from './log-requests' import { logRequests } from './log-requests'
import { FallbackMode } from '../../lib/fallback' import { FallbackMode } from '../../lib/fallback'
import type { PagesDevOverlayType } from '../../client/components/react-dev-overlay/pages/pages-dev-overlay' import type { PagesDevOverlayBridgeType } from '../../client/components/react-dev-overlay/pages/pages-dev-overlay-bridge'
import { import {
ensureInstrumentationRegistered, ensureInstrumentationRegistered,
getInstrumentationModule, getInstrumentationModule,
} from '../lib/router-utils/instrumentation-globals.external' } from '../lib/router-utils/instrumentation-globals.external'
// Load ReactDevOverlay only when needed // Load ReactDevOverlay only when needed
let ReactDevOverlayImpl: PagesDevOverlayType let PagesDevOverlayBridgeImpl: PagesDevOverlayBridgeType
const ReactDevOverlay: PagesDevOverlayType = (props) => { const ReactDevOverlay: PagesDevOverlayBridgeType = (props) => {
if (ReactDevOverlayImpl === undefined) { if (PagesDevOverlayBridgeImpl === undefined) {
ReactDevOverlayImpl = ( PagesDevOverlayBridgeImpl = (
require('../../client/components/react-dev-overlay/pages/pages-dev-overlay') as typeof import('../../client/components/react-dev-overlay/pages/pages-dev-overlay') require('../../client/components/react-dev-overlay/pages/pages-dev-overlay-bridge') as typeof import('../../client/components/react-dev-overlay/pages/pages-dev-overlay-bridge')
).PagesDevOverlay as PagesDevOverlayType ).PagesDevOverlayBridge
} }
return ReactDevOverlayImpl(props) return React.createElement(PagesDevOverlayBridgeImpl, props)
} }
export interface Options extends ServerOptions { export interface Options extends ServerOptions {
......
...@@ -103,7 +103,7 @@ import { ReflectAdapter } from './web/spec-extension/adapters/reflect' ...@@ -103,7 +103,7 @@ import { ReflectAdapter } from './web/spec-extension/adapters/reflect'
import { getCacheControlHeader } from './lib/cache-control' import { getCacheControlHeader } from './lib/cache-control'
import { getErrorSource } from '../shared/lib/error-source' import { getErrorSource } from '../shared/lib/error-source'
import type { DeepReadonly } from '../shared/lib/deep-readonly' import type { DeepReadonly } from '../shared/lib/deep-readonly'
import type { PagesDevOverlayType } from '../client/components/react-dev-overlay/pages/pages-dev-overlay' import type { PagesDevOverlayBridgeType } from '../client/components/react-dev-overlay/pages/pages-dev-overlay-bridge'
import { getScriptNonceFromHeader } from './app-render/get-script-nonce-from-header' import { getScriptNonceFromHeader } from './app-render/get-script-nonce-from-header'
let tryGetPreviewData: typeof import('./api-utils/node/try-get-preview-data').tryGetPreviewData let tryGetPreviewData: typeof import('./api-utils/node/try-get-preview-data').tryGetPreviewData
...@@ -247,7 +247,7 @@ export type RenderOptsPartial = { ...@@ -247,7 +247,7 @@ export type RenderOptsPartial = {
nextExport?: boolean nextExport?: boolean
dev?: boolean dev?: boolean
ampPath?: string ampPath?: string
ErrorDebug?: PagesDevOverlayType ErrorDebug?: PagesDevOverlayBridgeType
ampValidator?: (html: string, pathname: string) => Promise<void> ampValidator?: (html: string, pathname: string) => Promise<void>
ampSkipValidation?: boolean ampSkipValidation?: boolean
ampOptimizerConfig?: { [key: string]: any } ampOptimizerConfig?: { [key: string]: any }
...@@ -813,15 +813,7 @@ export async function renderToHTMLImpl( ...@@ -813,15 +813,7 @@ export async function renderToHTMLImpl(
<Noop /> <Noop />
<AppContainer> <AppContainer>
<> <>
{/* <ReactDevOverlay/> */} {children}
{dev ? (
<>
{children}
<Noop />
</>
) : (
children
)}
{/* <RouteAnnouncer/> */} {/* <RouteAnnouncer/> */}
<Noop /> <Noop />
</> </>
......
...@@ -7,7 +7,7 @@ import type { CloneableBody } from './body-streams' ...@@ -7,7 +7,7 @@ import type { CloneableBody } from './body-streams'
import type { RouteMatch } from './route-matches/route-match' import type { RouteMatch } from './route-matches/route-match'
import type { NEXT_RSC_UNION_QUERY } from '../client/components/app-router-headers' import type { NEXT_RSC_UNION_QUERY } from '../client/components/app-router-headers'
import type { ServerComponentsHmrCache } from './response-cache' import type { ServerComponentsHmrCache } from './response-cache'
import type { PagesDevOverlayType } from '../client/components/react-dev-overlay/pages/pages-dev-overlay' import type { PagesDevOverlayBridgeType } from '../client/components/react-dev-overlay/pages/pages-dev-overlay-bridge'
// FIXME: (wyattjoh) this is a temporary solution to allow us to pass data between bundled modules // FIXME: (wyattjoh) this is a temporary solution to allow us to pass data between bundled modules
export const NEXT_REQUEST_META = Symbol.for('NextInternalRequestMeta') export const NEXT_REQUEST_META = Symbol.for('NextInternalRequestMeta')
...@@ -224,7 +224,7 @@ export interface RequestMeta { ...@@ -224,7 +224,7 @@ export interface RequestMeta {
/** /**
* ErrorOverlay component to use in development for pages router * ErrorOverlay component to use in development for pages router
*/ */
PagesErrorDebug?: PagesDevOverlayType PagesErrorDebug?: PagesDevOverlayBridgeType
} }
/** /**
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
// TODO: Enable types by telling Turbopack to ignore this alias. // TODO: Enable types by telling Turbopack to ignore this alias.
// tsconfig#paths are for type locations not source locations. // tsconfig#paths are for type locations not source locations.
// "next/dist/compiled/next-devtools": [ // "next/dist/compiled/next-devtools": [
// "./src/client/components/react-dev-overlay/app/entrypoint.d.ts" // "./src/client/components/react-dev-overlay/entrypoint.d.ts"
// ], // ],
"next/dist/shared/lib/image-loader": ["./src/shared/lib/image-loader.ts"] "next/dist/shared/lib/image-loader": ["./src/shared/lib/image-loader.ts"]
} }
......
...@@ -16,5 +16,5 @@ ...@@ -16,5 +16,5 @@
"incremental": true "incremental": true
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"] "exclude": ["node_modules", "**/*.test.ts", "**/*.test.tsx"]
} }
...@@ -20,5 +20,5 @@ ...@@ -20,5 +20,5 @@
] ]
}, },
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"], "include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"] "exclude": ["node_modules", "**/*.test.ts", "**/*.test.tsx"]
} }
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"packages/next/src/client/components/errors/graceful-degrade-boundary.tsx" "packages/next/src/client/components/errors/graceful-degrade-boundary.tsx"
], ],
"ban-script-appendchild-calls": [ "ban-script-appendchild-calls": [
"packages/next/src/client/components/react-dev-overlay/app/app-dev-overlay.browser.tsx" "packages/next/src/client/components/react-dev-overlay/dev-overlay.browser.tsx"
], ],
"ban-script-content-assignments": ["packages/next/src/client/script.tsx"], "ban-script-content-assignments": ["packages/next/src/client/script.tsx"],
"ban-script-src-assignments": [ "ban-script-src-assignments": [
......
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