Skip to content

Commit c20253d

Browse files
committed
fixup! [dev-overlay] Remove unused code
1 parent 4a1496a commit c20253d

30 files changed

+120
-177
lines changed

packages/next/src/client/app-index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// imports polyfill from `@next/polyfill-module` after build.
22
import '../build/polyfills/polyfill-module'
33

4-
import './components/globals/patch-console'
5-
import './components/globals/handle-global-errors'
4+
import './components/react-dev-overlay/app/app-dev-overlay-setup'
65

76
import ReactDOMClient from 'react-dom/client'
87
import React, { use } from 'react'

packages/next/src/client/app-next-dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { appBootstrap } from './app-bootstrap'
77
import {
88
getComponentStack,
99
getOwnerStack,
10-
} from './components/errors/stitched-error'
10+
} from './components/react-dev-overlay/app/errors/stitched-error'
1111
import { isRecoverableError } from './react-client-callbacks/on-recoverable-error'
1212

1313
// eslint-disable-next-line @next/internal/typechecked-require

packages/next/src/client/app-next-turbopack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { appBootstrap } from './app-bootstrap'
22
import {
33
getComponentStack,
44
getOwnerStack,
5-
} from './components/errors/stitched-error'
5+
} from './components/react-dev-overlay/app/errors/stitched-error'
66
import { isRecoverableError } from './react-client-callbacks/on-recoverable-error'
77

88
window.next.version += '-turbo'

packages/next/src/client/components/globals/handle-global-errors.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/next/src/client/components/globals/patch-console.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/next/src/client/components/react-dev-overlay/app/app-dev-overlay-error-boundary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { PureComponent } from 'react'
22
import { dispatcher } from 'next/dist/compiled/next-devtools'
3-
import { RuntimeErrorHandler } from '../../errors/runtime-error-handler'
3+
import { RuntimeErrorHandler } from '../runtime-error-handler'
44
import { ErrorBoundary } from '../../error-boundary'
55
import DefaultGlobalError, {
66
type GlobalErrorComponent,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { patchConsoleError } from './errors/intercept-console-error'
2+
import { handleGlobalErrors } from './errors/use-error-handler'
3+
4+
handleGlobalErrors()
5+
patchConsoleError()

packages/next/src/client/components/errors/console-error.ts renamed to packages/next/src/client/components/react-dev-overlay/app/errors/console-error.ts

File renamed without changes.

packages/next/src/client/components/globals/intercept-console-error.ts renamed to packages/next/src/client/components/react-dev-overlay/app/errors/intercept-console-error.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import isError from '../../../lib/is-error'
2-
import { isNextRouterError } from '../is-next-router-error'
3-
import { handleConsoleError } from '../errors/use-error-handler'
4-
import { parseConsoleArgs } from '../../lib/console'
1+
import isError from '../../../../../lib/is-error'
2+
import { isNextRouterError } from '../../../is-next-router-error'
3+
import { handleConsoleError } from './use-error-handler'
4+
import { parseConsoleArgs } from '../../../../lib/console'
55

66
export const originConsoleError = globalThis.console.error
77

packages/next/src/client/components/react-dev-overlay/app/replay-ssr-only-errors.tsx renamed to packages/next/src/client/components/react-dev-overlay/app/errors/replay-ssr-only-errors.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect } from 'react'
2-
import { handleClientError } from '../../errors/use-error-handler'
3-
import { isNextRouterError } from '../../is-next-router-error'
4-
import { MISSING_ROOT_TAGS_ERROR } from '../../../../shared/lib/errors/constants'
2+
import { handleClientError } from './use-error-handler'
3+
import { isNextRouterError } from '../../../is-next-router-error'
4+
import { MISSING_ROOT_TAGS_ERROR } from '../../../../../shared/lib/errors/constants'
55

66
function readSsrError(): (Error & { digest?: string }) | null {
77
if (typeof document === 'undefined') {

0 commit comments

Comments
 (0)