Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import type { Dispatcher } from '../../app/hot-reloader-client'

import React from 'react'

import { ShadowPortal } from '../internal/components/ShadowPortal'
import { BuildError } from '../internal/container/BuildError'
import { Errors } from '../internal/container/Errors'
import { Base } from '../internal/styles/Base'
import { ComponentStyles } from '../internal/styles/ComponentStyles'
import { CssReset } from '../internal/styles/CssReset'
import { RootLayoutMissingTagsError } from '../internal/container/RootLayoutMissingTagsError'
import { ShadowPortal } from '../internal/components/shadow-portal'
import { BuildError } from '../internal/container/build-error'
import { Errors } from '../internal/container/errors'
import { Base } from '../internal/styles/base'
import { ComponentStyles } from '../internal/styles/component-styles'
import { CssReset } from '../internal/styles/css-reset'
import { RootLayoutMissingTagsError } from '../internal/container/root-layout-missing-tags-error'
import { RuntimeErrorHandler } from '../internal/helpers/runtime-error-handler'
import { Colors } from '../internal/styles/colors'

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react'
import { CodeFrame } from './CodeFrame'
import { CodeFrame } from './code-frame'
import { withShadowPortal } from '../../storybook/with-shadow-portal'

const meta: Meta<typeof CodeFrame> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export { Dialog } from './dialog'
export { DialogBody } from './dialog-body'
export { DialogContent } from './dialog-content'
export { DialogHeader } from './dialog-header'
export { DialogFooter } from './dialog-footer'
export { styles } from './styles'
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { VersionInfo } from '../../../../../../../../server/dev/parse-version-info'
import type { ReadyRuntimeError } from '../../../helpers/get-error-by-type'
import { Toast } from '../../Toast'
import { Toast } from '../../toast'
import React, { useState, useEffect, useRef } from 'react'
import { NextLogo } from './internal/next-logo'
import { useIsDevBuilding } from '../../../../../../../dev/dev-build-indicator/internal/initialize-for-new-overlay'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { noop as css } from '../../../helpers/noop-template'
import { DialogBody } from '../../Dialog'
import { DialogBody } from '../../dialog'

type ErrorOverlayDialogBodyProps = {
children?: React.ReactNode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Dialog } from '../../Dialog/Dialog'
import { Dialog } from '../../dialog/dialog'
import { noop as css } from '../../../helpers/noop-template'

type ErrorOverlayDialogProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DialogHeader } from '../../Dialog/DialogHeader'
import { DialogHeader } from '../../dialog/dialog-header'
import { noop as css } from '../../../helpers/noop-template'

type ErrorOverlayDialogHeaderProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ReadyRuntimeError } from '../../../helpers/get-error-by-type'
import type { VersionInfo } from '../../../../../../../../server/dev/parse-version-info'

import { ErrorOverlayPagination } from '../error-overlay-pagination/error-overlay-pagination'
import { VersionStalenessInfo } from '../../VersionStalenessInfo/VersionStalenessInfo'
import { VersionStalenessInfo } from '../../version-staleness-info/version-staleness-info'
import { noop as css } from '../../../helpers/noop-template'

type ErrorOverlayFloatingHeaderProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ErrorOverlayLayout } from './error-overlay-layout'
import '@testing-library/jest-dom'

// Mock maintain--tab-focus module
jest.mock('../../../components/Overlay/maintain--tab-focus', () => ({
jest.mock('../../../components/overlay/maintain--tab-focus', () => ({
__esModule: true,
default: jest.fn(() => ({
disengage: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { VersionInfo } from '../../../../../../../../server/dev/parse-versi
import type { ErrorMessageType } from '../error-message/error-message'
import type { ErrorType } from '../error-type-label/error-type-label'

import { DialogContent, DialogFooter } from '../../Dialog'
import { DialogContent, DialogFooter } from '../../dialog'
import {
ErrorOverlayToolbar,
styles as toolbarStyles,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { ReadyRuntimeError } from '../../../helpers/get-error-by-type'

import { useCallback, useEffect, useRef, useState } from 'react'
import { noop as css } from '../../../helpers/noop-template'
import { LeftArrow } from '../../../icons/LeftArrow'
import { RightArrow } from '../../../icons/RightArrow'
import { LeftArrow } from '../../../icons/left-arrow'
import { RightArrow } from '../../../icons/right-arrow'

type ErrorPaginationProps = {
readyErrors: ReadyRuntimeError[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { noop as css } from '../../../helpers/noop-template'
import { Overlay, type OverlayProps } from '../../Overlay/Overlay'
import { Overlay, type OverlayProps } from '../../overlay/overlay'

export function ErrorOverlayOverlay({ children, ...props }: OverlayProps) {
return <Overlay {...props}>{children}</Overlay>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Overlay } from './overlay'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Terminal } from './terminal'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react'
import { Terminal } from './Terminal'
import { Terminal } from './terminal'
import { withShadowPortal } from '../../storybook/with-shadow-portal'

const meta: Meta<typeof Terminal> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Anser from 'next/dist/compiled/anser'
import * as React from 'react'
import { HotlinkedText } from '../hot-linked-text'
import { EditorLink } from './EditorLink'
import { EditorLink } from './editor-link'
import { ExternalIcon } from '../../icons/external'
import { noop as css } from '../../helpers/noop-template'
import { getFrameSource } from '../../helpers/stack-frame'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { styles } from './styles'
export { Toast } from './Toast'
export { Toast } from './toast'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react'
import { VersionStalenessInfo } from './VersionStalenessInfo'
import { VersionStalenessInfo } from './version-staleness-info'
import { withShadowPortal } from '../../storybook/with-shadow-portal'

const meta: Meta<typeof VersionStalenessInfo> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react'
import { BuildError } from './BuildError'
import { BuildError } from './build-error'
import { withShadowPortal } from '../storybook/with-shadow-portal'

const meta: Meta<typeof BuildError> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react'
import type { VersionInfo } from '../../../../../../server/dev/parse-version-info'
import { Terminal } from '../components/Terminal'
import { Terminal } from '../components/terminal'
import { noop as css } from '../helpers/noop-template'
import { ErrorOverlayLayout } from '../components/Errors/error-overlay-layout/error-overlay-layout'
import { ErrorOverlayLayout } from '../components/errors/error-overlay-layout/error-overlay-layout'

export type BuildErrorProps = {
message: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react'
import { Errors } from './Errors'
import { Errors } from './errors'
import { withShadowPortal } from '../storybook/with-shadow-portal'
import { ACTION_UNHANDLED_ERROR } from '../../../shared'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import {
type UnhandledRejectionAction,
} from '../../../shared'
import type { DebugInfo } from '../../../types'
import { Overlay } from '../components/Overlay'
import { Overlay } from '../components/overlay'
import { getErrorByType } from '../helpers/get-error-by-type'
import type { ReadyRuntimeError } from '../helpers/get-error-by-type'
import { noop as css } from '../helpers/noop-template'
import { RuntimeError } from './RuntimeError'
import { RuntimeError } from './runtime-error'
import type { VersionInfo } from '../../../../../../server/dev/parse-version-info'
import { getErrorSource } from '../../../../../../shared/lib/error-source'
import { HotlinkedText } from '../components/hot-linked-text'
import { PseudoHtmlDiff } from './RuntimeError/component-stack-pseudo-html'
import { PseudoHtmlDiff } from './runtime-error/component-stack-pseudo-html'
import {
type HydrationErrorState,
getHydrationWarningType,
Expand All @@ -24,8 +24,8 @@ import {
isUnhandledConsoleOrRejection,
} from '../../../../errors/console-error'
import { extractNextErrorCode } from '../../../../../../lib/error-telemetry-utils'
import { DevToolsIndicator } from '../components/Errors/dev-tools-indicator/dev-tools-indicator'
import { ErrorOverlayLayout } from '../components/Errors/error-overlay-layout/error-overlay-layout'
import { DevToolsIndicator } from '../components/errors/dev-tools-indicator/dev-tools-indicator'
import { ErrorOverlayLayout } from '../components/errors/error-overlay-layout/error-overlay-layout'
import { useKeyboardShortcut } from '../hooks/use-keyboard-shortcut'
import { MODIFIERS } from '../hooks/use-keyboard-shortcut'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react'
import { RootLayoutMissingTagsError } from './RootLayoutMissingTagsError'
import { RootLayoutMissingTagsError } from './root-layout-missing-tags-error'
import { withShadowPortal } from '../storybook/with-shadow-portal'

const meta: Meta<typeof RootLayoutMissingTagsError> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { VersionInfo } from '../../../../../../server/dev/parse-version-info'
import { useCallback } from 'react'
import { HotlinkedText } from '../components/hot-linked-text'
import { ErrorOverlayLayout } from '../components/Errors/error-overlay-layout/error-overlay-layout'
import { ErrorOverlayLayout } from '../components/errors/error-overlay-layout/error-overlay-layout'

type RootLayoutMissingTagsErrorProps = {
missingTags: string[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo, Fragment, useState } from 'react'
import type { ComponentStackFrame } from '../../helpers/parse-component-stack'
import { CollapseIcon } from '../../icons/CollapseIcon'
import { CollapseIcon } from '../../icons/collapse-icon'
import { noop as css } from '../../helpers/noop-template'

function getAdjacentProps(isAdj: boolean) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { ReadyRuntimeError } from '../../helpers/get-error-by-type'

import { useMemo } from 'react'
import { CodeFrame } from '../../components/CodeFrame/CodeFrame'
import { CallStack } from '../../components/Errors/call-stack/call-stack'
import { CodeFrame } from '../../components/code-frame/code-frame'
import { CallStack } from '../../components/errors/call-stack/call-stack'
import { noop as css } from '../../helpers/noop-template'
import { PSEUDO_HTML_DIFF_STYLES } from './component-stack-pseudo-html'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ACTION_UNHANDLED_ERROR,
ACTION_UNHANDLED_REJECTION,
} from '../../../shared'
import type { SupportedErrorEvent } from '../container/Errors'
import type { SupportedErrorEvent } from '../container/errors'
import { getOriginalStackFrames } from './stack-frame'
import type { OriginalStackFrame } from './stack-frame'
import type { ComponentStackFrame } from './parse-component-stack'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Base } from '../styles/Base'
import { Base } from '../styles/base'
import { Colors } from '../styles/colors'
import { CssReset } from '../styles/CssReset'
import { ComponentStyles } from '../styles/ComponentStyles'
import { ShadowPortal } from '../components/ShadowPortal'
import { CssReset } from '../styles/css-reset'
import { ComponentStyles } from '../styles/component-styles'
import { ShadowPortal } from '../components/shadow-portal'

export const withShadowPortal = (Story: any) => (
<ShadowPortal>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { CODE_FRAME_STYLES } from '../components/CodeFrame/CodeFrame'
import { styles as dialog } from '../components/Dialog'
import { styles as errorLayout } from '../components/Errors/error-overlay-layout/error-overlay-layout'
import { styles as bottomStacks } from '../components/Errors/error-overlay-bottom-stacks/error-overlay-bottom-stacks'
import { styles as pagination } from '../components/Errors/error-overlay-pagination/error-overlay-pagination'
import { styles as overlay } from '../components/Overlay/styles'
import { styles as footer } from '../components/Errors/error-overlay-footer/error-overlay-footer'
import { TERMINAL_STYLES } from '../components/Terminal/Terminal'
import { styles as toast } from '../components/Toast'
import { styles as versionStaleness } from '../components/VersionStalenessInfo/VersionStalenessInfo'
import { styles as buildErrorStyles } from '../container/BuildError'
import { styles as containerErrorStyles } from '../container/Errors'
import { styles as containerRuntimeErrorStyles } from '../container/RuntimeError'
import { CODE_FRAME_STYLES } from '../components/code-frame/code-frame'
import { styles as dialog } from '../components/dialog'
import { styles as errorLayout } from '../components/errors/error-overlay-layout/error-overlay-layout'
import { styles as bottomStacks } from '../components/errors/error-overlay-bottom-stacks/error-overlay-bottom-stacks'
import { styles as pagination } from '../components/errors/error-overlay-pagination/error-overlay-pagination'
import { styles as overlay } from '../components/overlay/styles'
import { styles as footer } from '../components/errors/error-overlay-footer/error-overlay-footer'
import { TERMINAL_STYLES } from '../components/terminal/terminal'
import { styles as toast } from '../components/toast'
import { styles as versionStaleness } from '../components/version-staleness-info/version-staleness-info'
import { styles as buildErrorStyles } from '../container/build-error'
import { styles as containerErrorStyles } from '../container/errors'
import { styles as containerRuntimeErrorStyles } from '../container/runtime-error'
import { COPY_BUTTON_STYLES } from '../components/copy-button'
import { CALL_STACK_FRAME_STYLES } from '../components/call-stack-frame/call-stack-frame'
import { styles as devToolsIndicator } from '../components/Errors/dev-tools-indicator/styles'
import { styles as devToolsIndicator } from '../components/errors/dev-tools-indicator/styles'
import { noop as css } from '../helpers/noop-template'
import { EDITOR_LINK_STYLES } from '../components/Terminal/EditorLink'
import { EDITOR_LINK_STYLES } from '../components/terminal/editor-link'

export function ComponentStyles() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from 'react'

import { ShadowPortal } from '../internal/components/ShadowPortal'
import { BuildError } from '../internal/container/BuildError'
import { Errors } from '../internal/container/Errors'
import { Base } from '../internal/styles/Base'
import { ComponentStyles } from '../internal/styles/ComponentStyles'
import { CssReset } from '../internal/styles/CssReset'
import { ShadowPortal } from '../internal/components/shadow-portal'
import { BuildError } from '../internal/container/build-error'
import { Errors } from '../internal/container/errors'
import { Base } from '../internal/styles/base'
import { ComponentStyles } from '../internal/styles/component-styles'
import { CssReset } from '../internal/styles/css-reset'

import { ErrorBoundary } from '../../pages/ErrorBoundary'
import { ErrorBoundary } from '../../pages/error-boundary'
import { usePagesReactDevOverlay } from '../../pages/hooks'
import { Colors } from '../internal/styles/colors'

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import ReactDevOverlay from './ReactDevOverlay'
import ReactDevOverlay from './react-dev-overlay'
import { getSocketUrl } from '../internal/helpers/get-socket-url'
import { INITIAL_OVERLAY_STATE } from '../shared'
import { HMR_ACTIONS_SENT_TO_BROWSER } from '../../../../server/dev/hot-reloader-types'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
useErrorOverlayReducer,
} from '../shared'
import { parseStack } from '../internal/helpers/parse-stack'
import ReactDevOverlay from './ReactDevOverlay'
import ReactDevOverlay from './react-dev-overlay'
import { useErrorHandler } from '../../errors/use-error-handler'
import { RuntimeErrorHandler } from '../../errors/runtime-error-handler'
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import OldReactDevOverlay from './old-react-dev-overlay'
import NewReactDevOverlay from '../_experimental/app/react-dev-overlay'

export default Boolean(process.env.__NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY)
? NewReactDevOverlay
: OldReactDevOverlay
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ export function onVersionInfo(versionInfo: VersionInfo) {

export { getErrorByType } from '../internal/helpers/get-error-by-type'
export { getServerError } from '../internal/helpers/node-stack-frames'
export { default as ReactDevOverlay } from './ReactDevOverlay'
export { default as ReactDevOverlay } from './react-dev-overlay'
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react'
import { ShadowPortal } from '../internal/components/ShadowPortal'
import { BuildError } from '../internal/container/BuildError'
import { Errors } from '../internal/container/Errors'
import { ErrorBoundary } from './ErrorBoundary'
import { ErrorBoundary } from './error-boundary'
import { Base } from '../internal/styles/Base'
import { ComponentStyles } from '../internal/styles/ComponentStyles'
import { CssReset } from '../internal/styles/CssReset'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import OldReactDevOverlay from './OldReactDevOverlay'
import NewReactDevOverlay from '../_experimental/pages/ReactDevOverlay'
import OldReactDevOverlay from './old-react-dev-overlay'
import NewReactDevOverlay from '../_experimental/pages/react-dev-overlay'

const ReactDevOverlay = Boolean(process.env.__NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY)
? NewReactDevOverlay
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/client/components/use-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
ReducerActions,
ReducerState,
} from './router-reducer/router-reducer-types'
import { useSyncDevRenderIndicator } from './react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/use-sync-dev-render-indicator'
import { useSyncDevRenderIndicator } from './react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/use-sync-dev-render-indicator'

export function useUnwrapState(state: ReducerState): AppRouterState {
// reducer actions can be async, so sometimes we need to suspend until the state is resolved
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/dev/next-dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import type { ServerOnInstrumentationRequestError } from '../app-render/types'
import type { ServerComponentsHmrCache } from '../response-cache'
import { logRequests } from './log-requests'
import { FallbackMode } from '../../lib/fallback'
import type { ReactDevOverlayType } from '../../client/components/react-dev-overlay/pages/ReactDevOverlay'
import type { ReactDevOverlayType } from '../../client/components/react-dev-overlay/pages/react-dev-overlay'

// Load ReactDevOverlay only when needed
let ReactDevOverlayImpl: ReactDevOverlayType
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ import { ReflectAdapter } from './web/spec-extension/adapters/reflect'
import { formatRevalidate } from './lib/revalidate'
import { getErrorSource } from '../shared/lib/error-source'
import type { DeepReadonly } from '../shared/lib/deep-readonly'
import type { ReactDevOverlayType } from '../client/components/react-dev-overlay/pages/ReactDevOverlay'
import type { ReactDevOverlayType } from '../client/components/react-dev-overlay/pages/react-dev-overlay'

let tryGetPreviewData: typeof import('./api-utils/node/try-get-preview-data').tryGetPreviewData
let warn: typeof import('../build/output/log').warn
Expand Down