Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: decouple getOriginalStackFrame from endpoint #75553

Merged
merged 3 commits into from
Feb 3, 2025
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
@@ -1,9 +1,9 @@
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import type { OriginalStackFrame } from '../../helpers/stack-frame'
import type { OriginalStackFrame } from '../../../../internal/helpers/stack-frame'

import { HotlinkedText } from '../hot-linked-text'
import { ExternalIcon } from '../../icons/external'
import { getFrameSource } from '../../helpers/stack-frame'
import { getFrameSource } from '../../../../internal/helpers/stack-frame'
import { useOpenInEditor } from '../../helpers/use-open-in-editor'
import { noop as css } from '../../helpers/noop-template'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import stripAnsi from 'next/dist/compiled/strip-ansi'

import { useMemo } from 'react'
import { HotlinkedText } from '../hot-linked-text'
import { getFrameSource } from '../../helpers/stack-frame'
import { getFrameSource } from '../../../../internal/helpers/stack-frame'
import { useOpenInEditor } from '../../helpers/use-open-in-editor'
import { noop as css } from '../../helpers/noop-template'
import { ExternalIcon } from '../../icons/external'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { OriginalStackFrame } from '../../../helpers/stack-frame'
import type { OriginalStackFrame } from '../../../../../internal/helpers/stack-frame'
import { useMemo, useState } from 'react'
import { CallStackFrame } from '../../call-stack-frame/call-stack-frame'
import { noop as css } from '../../../helpers/noop-template'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
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 '../../version-staleness-info/version-staleness-info'
import { noop as css } from '../../../helpers/noop-template'
import type { ReadyRuntimeError } from '../../../../../internal/helpers/get-error-by-type'

type ErrorOverlayFloatingHeaderProps = {
readyErrors?: ReadyRuntimeError[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { ReadyRuntimeError } from '../../../helpers/get-error-by-type'
import type { DebugInfo } from '../../../../../types'
import type { VersionInfo } from '../../../../../../../../server/dev/parse-version-info'
import type { ErrorMessageType } from '../error-message/error-message'
Expand Down Expand Up @@ -33,6 +32,7 @@ import {
import { ErrorOverlayDialogBody, DIALOG_BODY_STYLES } from '../dialog/body'
import { CALL_STACK_STYLES } from '../call-stack/call-stack'
import { OVERLAY_STYLES, ErrorOverlayOverlay } from '../overlay/overlay'
import type { ReadyRuntimeError } from '../../../../../internal/helpers/get-error-by-type'

type ErrorOverlayLayoutProps = {
errorMessage: ErrorMessageType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,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/left-arrow'
import { RightArrow } from '../../../icons/right-arrow'
import type { ReadyRuntimeError } from '../../../../../internal/helpers/get-error-by-type'

type ErrorPaginationProps = {
readyErrors: ReadyRuntimeError[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { OverlayState } from '../../../../../shared'
import type { ReadyRuntimeError } from '../../../helpers/get-error-by-type'

import { BuildError } from '../../../container/build-error'
import { Errors } from '../../../container/errors'
import { RootLayoutMissingTagsError } from '../../../container/root-layout-missing-tags-error'
import type { ReadyRuntimeError } from '../../../../../internal/helpers/get-error-by-type'

export function ErrorOverlay({
state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { HotlinkedText } from '../hot-linked-text'
import { EditorLink } from './editor-link'
import { ExternalIcon } from '../../icons/external'
import { noop as css } from '../../helpers/noop-template'
import { getFrameSource } from '../../helpers/stack-frame'
import { getFrameSource } from '../../../../internal/helpers/stack-frame'
import { useOpenInEditor } from '../../helpers/use-open-in-editor'
import { FileIcon } from '../../icons/file'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Meta, StoryObj } from '@storybook/react'
import type { ReadyRuntimeError } from '../helpers/get-error-by-type'

import { Errors } from './errors'
import { withShadowPortal } from '../storybook/with-shadow-portal'
import type { ReadyRuntimeError } from '../../../internal/helpers/get-error-by-type'

const meta: Meta<typeof Errors> = {
component: Errors,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useState, useMemo, useEffect } from 'react'
import type { DebugInfo } from '../../../types'
import { Overlay } from '../components/overlay'
import type { ReadyRuntimeError } from '../helpers/get-error-by-type'
import { noop as css } from '../helpers/noop-template'
import { RuntimeError } from './runtime-error'
import type { VersionInfo } from '../../../../../../server/dev/parse-version-info'
Expand All @@ -18,6 +17,7 @@ import {
} from '../../../../errors/console-error'
import { extractNextErrorCode } from '../../../../../../lib/error-telemetry-utils'
import { ErrorOverlayLayout } from '../components/errors/error-overlay-layout/error-overlay-layout'
import type { ReadyRuntimeError } from '../../../internal/helpers/get-error-by-type'

export type ErrorsProps = {
readyErrors: ReadyRuntimeError[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { ReadyRuntimeError } from '../../helpers/get-error-by-type'

import { useMemo } from 'react'
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'

import type { ReadyRuntimeError } from '../../../../internal/helpers/get-error-by-type'
export type RuntimeErrorProps = { error: ReadyRuntimeError }

export function RuntimeError({ error }: RuntimeErrorProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import type { ReadyRuntimeError } from '../../helpers/get-error-by-type'
import type {
OverlayState,
UnhandledErrorAction,
UnhandledRejectionAction,
} from '../../../../shared'

import { useMemo, useState, useEffect } from 'react'
import { getErrorByType } from '../../helpers/get-error-by-type'
import {
ACTION_UNHANDLED_ERROR,
ACTION_UNHANDLED_REJECTION,
} from '../../../../shared'
import {
getErrorByType,
type ReadyRuntimeError,
} from '../../../../internal/helpers/get-error-by-type'

export type SupportedErrorEvent = {
id: number
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading