From 4e7709272fa8fbe162f76ec7395d4c15a50eacc1 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Sun, 21 Apr 2024 11:03:21 +0200 Subject: [PATCH] Revert "Force resolution to use vendored React" This reverts commit 98f02ec42df4fd0ea84b05c529d5b1d3fb70fd7c. Try to find out why it's not aliased in the first place --- packages/next/src/build/babel/preset.ts | 2 +- packages/next/src/build/webpack-config.ts | 2 +- .../webpack/loaders/next-flight-loader/module-proxy.ts | 2 +- .../loaders/next-flight-loader/server-reference.ts | 2 +- .../build/webpack/plugins/next-types-plugin/index.ts | 2 +- packages/next/src/client/app-index.tsx | 6 +++--- packages/next/src/client/compat/router.ts | 2 +- .../src/client/components/app-router-announcer.tsx | 4 ++-- packages/next/src/client/components/app-router.tsx | 4 ++-- packages/next/src/client/components/default-layout.tsx | 2 +- .../client/components/dev-root-not-found-boundary.tsx | 2 +- packages/next/src/client/components/error-boundary.tsx | 2 +- packages/next/src/client/components/layout-router.tsx | 4 ++-- packages/next/src/client/components/navigation.ts | 2 +- .../next/src/client/components/not-found-boundary.tsx | 2 +- .../next/src/client/components/not-found-error.tsx | 2 +- .../react-dev-overlay/app/ReactDevOverlay.tsx | 2 +- .../react-dev-overlay/app/hot-reloader-client.tsx | 4 ++-- .../internal/components/CodeFrame/CodeFrame.tsx | 2 +- .../internal/components/Dialog/Dialog.tsx | 2 +- .../internal/components/Dialog/DialogBody.tsx | 2 +- .../internal/components/Dialog/DialogContent.tsx | 2 +- .../internal/components/Dialog/DialogHeader.tsx | 2 +- .../LeftRightDialogHeader/LeftRightDialogHeader.tsx | 2 +- .../internal/components/Overlay/Overlay.tsx | 2 +- .../internal/components/ShadowPortal.tsx | 4 ++-- .../internal/components/Terminal/EditorLink.tsx | 2 +- .../internal/components/Terminal/Terminal.tsx | 2 +- .../internal/components/Toast/Toast.tsx | 2 +- .../VersionStalenessInfo/VersionStalenessInfo.tsx | 2 +- .../internal/components/hot-linked-text/index.tsx | 2 +- .../internal/container/BuildError.tsx | 2 +- .../react-dev-overlay/internal/container/Errors.tsx | 2 +- .../container/RuntimeError/ComponentStackFrameRow.tsx | 2 +- .../RuntimeError/component-stack-pseudo-html.tsx | 2 +- .../internal/container/RuntimeError/index.tsx | 2 +- .../container/root-layout-missing-tags-error.tsx | 2 +- .../internal/helpers/use-error-handler.ts | 2 +- .../internal/helpers/use-open-in-editor.ts | 2 +- .../internal/helpers/use-websocket.ts | 2 +- .../internal/hooks/use-on-click-outside.ts | 2 +- .../react-dev-overlay/internal/icons/CloseIcon.tsx | 2 +- .../react-dev-overlay/internal/styles/Base.tsx | 2 +- .../react-dev-overlay/internal/styles/CssReset.tsx | 2 +- .../react-dev-overlay/pages/ErrorBoundary.tsx | 2 +- .../react-dev-overlay/pages/ReactDevOverlay.tsx | 2 +- .../src/client/components/react-dev-overlay/shared.ts | 2 +- .../next/src/client/components/redirect-boundary.tsx | 2 +- .../client/components/render-from-template-context.tsx | 2 +- .../apply-router-state-patch-to-tree.test.tsx | 2 +- .../clear-cache-node-data-for-segment-path.test.tsx | 2 +- .../create-initial-router-state.test.tsx | 2 +- .../router-reducer/create-initial-router-state.ts | 2 +- .../components/router-reducer/fetch-server-response.ts | 2 +- .../fill-cache-with-new-subtree-data.test.tsx | 2 +- .../fill-lazy-items-till-leaf-with-head.test.tsx | 2 +- .../invalidate-cache-below-flight-segmentpath.test.tsx | 2 +- .../invalidate-cache-by-router-state.test.tsx | 2 +- .../reducers/find-head-in-cache.test.tsx | 2 +- .../router-reducer/reducers/server-action-reducer.ts | 4 ++-- .../router-reducer/should-hard-navigate.test.tsx | 2 +- .../src/client/components/use-reducer-with-devtools.ts | 6 +++--- packages/next/src/client/image-component.tsx | 4 ++-- packages/next/src/client/index.tsx | 4 ++-- packages/next/src/client/legacy/image.tsx | 2 +- packages/next/src/client/link.tsx | 2 +- packages/next/src/client/page-loader.ts | 2 +- packages/next/src/client/portal/index.tsx | 4 ++-- packages/next/src/client/route-announcer.tsx | 2 +- packages/next/src/client/route-loader.ts | 2 +- packages/next/src/client/router.ts | 2 +- packages/next/src/client/script.tsx | 6 +++--- packages/next/src/client/use-intersection.tsx | 2 +- packages/next/src/client/web-vitals.ts | 2 +- packages/next/src/client/with-router.tsx | 2 +- packages/next/src/compiled/@vercel/og/index.edge.d.ts | 2 +- packages/next/src/compiled/@vercel/og/index.node.d.ts | 2 +- .../next/src/compiled/@vercel/og/satori/index.d.ts | 2 +- packages/next/src/compiled/react-is/README.md | 10 +++++----- packages/next/src/lib/metadata/generate/alternate.tsx | 2 +- packages/next/src/lib/metadata/generate/basic.tsx | 2 +- packages/next/src/lib/metadata/generate/icons.tsx | 2 +- packages/next/src/lib/metadata/generate/meta.tsx | 2 +- packages/next/src/lib/metadata/metadata.tsx | 2 +- packages/next/src/pages/_app.tsx | 2 +- packages/next/src/pages/_document.tsx | 6 +++--- packages/next/src/pages/_error.tsx | 2 +- packages/next/src/server/app-render/app-render.tsx | 2 +- .../app-render/create-component-styles-and-scripts.tsx | 2 +- .../src/server/app-render/create-component-tree.tsx | 2 +- .../next/src/server/app-render/dynamic-rendering.ts | 2 +- packages/next/src/server/app-render/encryption.ts | 4 ++-- packages/next/src/server/app-render/entry-base.ts | 2 +- .../next/src/server/app-render/get-layer-assets.tsx | 2 +- .../app-render/make-get-server-inserted-html.tsx | 4 ++-- .../next/src/server/app-render/react-server.node.ts | 2 +- .../next/src/server/app-render/required-scripts.tsx | 2 +- packages/next/src/server/app-render/rsc/preloads.ts | 2 +- packages/next/src/server/app-render/rsc/taint.ts | 2 +- .../src/server/app-render/server-inserted-html.tsx | 2 +- .../src/server/app-render/static/static-renderer.ts | 4 ++-- .../app-render/walk-tree-with-flight-router-state.tsx | 2 +- packages/next/src/server/dev/next-dev-server.ts | 2 +- .../route-modules/app-page/vendored/rsc/entrypoints.ts | 8 ++++---- .../route-modules/app-page/vendored/ssr/entrypoints.ts | 10 +++++----- packages/next/src/server/render.tsx | 4 ++-- .../next/src/shared/lib/amp-context.shared-runtime.ts | 2 +- packages/next/src/shared/lib/amp.ts | 2 +- packages/next/src/shared/lib/app-dynamic.tsx | 2 +- .../shared/lib/app-router-context.shared-runtime.ts | 2 +- packages/next/src/shared/lib/dynamic.tsx | 2 +- .../shared/lib/head-manager-context.shared-runtime.ts | 2 +- packages/next/src/shared/lib/head.tsx | 2 +- .../shared/lib/hooks-client-context.shared-runtime.ts | 2 +- .../next/src/shared/lib/html-context.shared-runtime.ts | 2 +- .../shared/lib/image-config-context.shared-runtime.ts | 2 +- .../shared/lib/lazy-dynamic/dynamic-bailout-to-csr.tsx | 2 +- packages/next/src/shared/lib/lazy-dynamic/loadable.tsx | 2 +- .../src/shared/lib/loadable-context.shared-runtime.ts | 2 +- .../next/src/shared/lib/loadable.shared-runtime.tsx | 2 +- .../src/shared/lib/router-context.shared-runtime.ts | 2 +- packages/next/src/shared/lib/router/action-queue.ts | 2 +- packages/next/src/shared/lib/router/adapters.tsx | 2 +- packages/next/src/shared/lib/router/router.ts | 2 +- .../shared/lib/server-inserted-html.shared-runtime.tsx | 4 ++-- packages/next/src/shared/lib/side-effect.tsx | 4 ++-- packages/next/src/shared/lib/utils.ts | 2 +- packages/next/src/types.ts | 2 +- packages/next/types/$$compiled.internal.d.ts | 6 +++--- packages/next/types/react.d.ts | 2 +- 130 files changed, 166 insertions(+), 166 deletions(-) diff --git a/packages/next/src/build/babel/preset.ts b/packages/next/src/build/babel/preset.ts index becbca34f94a8..4a2f34fb825f4 100644 --- a/packages/next/src/build/babel/preset.ts +++ b/packages/next/src/build/babel/preset.ts @@ -138,7 +138,7 @@ export default ( require('./plugins/jsx-pragma'), { // This produces the following injected import for modules containing JSX: - // import React from 'next/dist/compiled/react'; + // import React from 'react'; // var __jsx = React.createElement; module: 'react', importAs: 'React', diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 829248dbe1fcc..9816b5ebb41c9 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import ReactRefreshWebpackPlugin from 'next/dist/compiled/@next/react-refresh-utils/dist/ReactRefreshWebpackPlugin' import { yellow, bold } from '../lib/picocolors' import crypto from 'crypto' diff --git a/packages/next/src/build/webpack/loaders/next-flight-loader/module-proxy.ts b/packages/next/src/build/webpack/loaders/next-flight-loader/module-proxy.ts index 1c6abd9d44d1b..17314c55282df 100644 --- a/packages/next/src/build/webpack/loaders/next-flight-loader/module-proxy.ts +++ b/packages/next/src/build/webpack/loaders/next-flight-loader/module-proxy.ts @@ -1,5 +1,5 @@ /* eslint-disable import/no-extraneous-dependencies */ -import { createClientModuleProxy } from 'next/dist/compiled/react-server-dom-webpack/server.edge' +import { createClientModuleProxy } from 'react-server-dom-webpack/server.edge' // Re-assign to make it typed. export const createProxy: (moduleId: string) => any = createClientModuleProxy diff --git a/packages/next/src/build/webpack/loaders/next-flight-loader/server-reference.ts b/packages/next/src/build/webpack/loaders/next-flight-loader/server-reference.ts index 12bb7726e8647..642d0293568bd 100644 --- a/packages/next/src/build/webpack/loaders/next-flight-loader/server-reference.ts +++ b/packages/next/src/build/webpack/loaders/next-flight-loader/server-reference.ts @@ -1,5 +1,5 @@ /* eslint-disable import/no-extraneous-dependencies */ -import { registerServerReference as flightRegisterServerReference } from 'next/dist/compiled/react-server-dom-webpack/server.edge' +import { registerServerReference as flightRegisterServerReference } from 'react-server-dom-webpack/server.edge' export function registerServerReference(id: string, action: any) { return flightRegisterServerReference(action, id, null) diff --git a/packages/next/src/build/webpack/plugins/next-types-plugin/index.ts b/packages/next/src/build/webpack/plugins/next-types-plugin/index.ts index 915d9b77330ea..de056f719699f 100644 --- a/packages/next/src/build/webpack/plugins/next-types-plugin/index.ts +++ b/packages/next/src/build/webpack/plugins/next-types-plugin/index.ts @@ -450,7 +450,7 @@ declare module 'next' { declare module 'next/link' { import type { LinkProps as OriginalLinkProps } from 'next/dist/client/link.js' - import type { AnchorHTMLAttributes, DetailedHTMLProps } from 'next/dist/compiled/react' + import type { AnchorHTMLAttributes, DetailedHTMLProps } from 'react' import type { UrlObject } from 'url' type LinkRestProps = Omit< diff --git a/packages/next/src/client/app-index.tsx b/packages/next/src/client/app-index.tsx index a6b7429620c8b..f54d9ac06ca39 100644 --- a/packages/next/src/client/app-index.tsx +++ b/packages/next/src/client/app-index.tsx @@ -1,10 +1,10 @@ import '../build/polyfills/polyfill-module' // @ts-ignore react-dom/client exists when using React 18 -import ReactDOMClient from 'next/dist/compiled/react-dom/client' -import React, { use } from 'next/dist/compiled/react' +import ReactDOMClient from 'react-dom/client' +import React, { use } from 'react' // @ts-ignore // eslint-disable-next-line import/no-extraneous-dependencies -import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-webpack/client' +import { createFromReadableStream } from 'react-server-dom-webpack/client' import { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime' import onRecoverableError from './on-recoverable-error' diff --git a/packages/next/src/client/compat/router.ts b/packages/next/src/client/compat/router.ts index d523eb6c590b6..ec5752e7627f9 100644 --- a/packages/next/src/client/compat/router.ts +++ b/packages/next/src/client/compat/router.ts @@ -1,4 +1,4 @@ -import { useContext } from 'next/dist/compiled/react' +import { useContext } from 'react' import { RouterContext } from '../../shared/lib/router-context.shared-runtime' import type { NextRouter } from '../router' diff --git a/packages/next/src/client/components/app-router-announcer.tsx b/packages/next/src/client/components/app-router-announcer.tsx index 98b09831939d4..b804e72d90add 100644 --- a/packages/next/src/client/components/app-router-announcer.tsx +++ b/packages/next/src/client/components/app-router-announcer.tsx @@ -1,5 +1,5 @@ -import { useEffect, useRef, useState } from 'next/dist/compiled/react' -import { createPortal } from 'next/dist/compiled/react-dom' +import { useEffect, useRef, useState } from 'react' +import { createPortal } from 'react-dom' import type { FlightRouterState } from '../../server/app-render/types' const ANNOUNCER_TYPE = 'next-route-announcer' diff --git a/packages/next/src/client/components/app-router.tsx b/packages/next/src/client/components/app-router.tsx index 37c007dd217d6..99b3b8660be5d 100644 --- a/packages/next/src/client/components/app-router.tsx +++ b/packages/next/src/client/components/app-router.tsx @@ -1,6 +1,6 @@ 'use client' -import type { ReactNode } from 'next/dist/compiled/react' +import type { ReactNode } from 'react' import React, { use, useEffect, @@ -9,7 +9,7 @@ import React, { startTransition, useInsertionEffect, useDeferredValue, -} from 'next/dist/compiled/react' +} from 'react' import { AppRouterContext, LayoutRouterContext, diff --git a/packages/next/src/client/components/default-layout.tsx b/packages/next/src/client/components/default-layout.tsx index c1e1a02fb981e..13dc5e8ea8189 100644 --- a/packages/next/src/client/components/default-layout.tsx +++ b/packages/next/src/client/components/default-layout.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' export default function DefaultLayout({ children, diff --git a/packages/next/src/client/components/dev-root-not-found-boundary.tsx b/packages/next/src/client/components/dev-root-not-found-boundary.tsx index 691032c0cb223..d2391062104c3 100644 --- a/packages/next/src/client/components/dev-root-not-found-boundary.tsx +++ b/packages/next/src/client/components/dev-root-not-found-boundary.tsx @@ -1,6 +1,6 @@ 'use client' -import React from 'next/dist/compiled/react' +import React from 'react' import { NotFoundBoundary } from './not-found-boundary' export function bailOnNotFound() { diff --git a/packages/next/src/client/components/error-boundary.tsx b/packages/next/src/client/components/error-boundary.tsx index 4d47426bdba6e..60384a880afc5 100644 --- a/packages/next/src/client/components/error-boundary.tsx +++ b/packages/next/src/client/components/error-boundary.tsx @@ -1,6 +1,6 @@ 'use client' -import React from 'next/dist/compiled/react' +import React from 'react' import { usePathname } from './navigation' import { isNextRouterError } from './is-next-router-error' import { staticGenerationAsyncStorage } from './static-generation-async-storage.external' diff --git a/packages/next/src/client/components/layout-router.tsx b/packages/next/src/client/components/layout-router.tsx index 5be433852fa36..1c3698c604967 100644 --- a/packages/next/src/client/components/layout-router.tsx +++ b/packages/next/src/client/components/layout-router.tsx @@ -18,8 +18,8 @@ import React, { startTransition, Suspense, useDeferredValue, -} from 'next/dist/compiled/react' -import ReactDOM from 'next/dist/compiled/react-dom' +} from 'react' +import ReactDOM from 'react-dom' import { LayoutRouterContext, GlobalLayoutRouterContext, diff --git a/packages/next/src/client/components/navigation.ts b/packages/next/src/client/components/navigation.ts index cf2ee7aa16e5b..5d99af79e9239 100644 --- a/packages/next/src/client/components/navigation.ts +++ b/packages/next/src/client/components/navigation.ts @@ -1,4 +1,4 @@ -import { useContext, useMemo } from 'next/dist/compiled/react' +import { useContext, useMemo } from 'react' import type { FlightRouterState } from '../../server/app-render/types' import { AppRouterContext, diff --git a/packages/next/src/client/components/not-found-boundary.tsx b/packages/next/src/client/components/not-found-boundary.tsx index e0a7ae7042c41..a42e4728f6402 100644 --- a/packages/next/src/client/components/not-found-boundary.tsx +++ b/packages/next/src/client/components/not-found-boundary.tsx @@ -1,6 +1,6 @@ 'use client' -import React, { useContext } from 'next/dist/compiled/react' +import React, { useContext } from 'react' import { usePathname } from './navigation' import { isNotFoundError } from './not-found' import { warnOnce } from '../../shared/lib/utils/warn-once' diff --git a/packages/next/src/client/components/not-found-error.tsx b/packages/next/src/client/components/not-found-error.tsx index e44d890703cf8..2e558c4bbdf13 100644 --- a/packages/next/src/client/components/not-found-error.tsx +++ b/packages/next/src/client/components/not-found-error.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' const styles: Record = { error: { diff --git a/packages/next/src/client/components/react-dev-overlay/app/ReactDevOverlay.tsx b/packages/next/src/client/components/react-dev-overlay/app/ReactDevOverlay.tsx index 0e268e41da492..032b0bc079707 100644 --- a/packages/next/src/client/components/react-dev-overlay/app/ReactDevOverlay.tsx +++ b/packages/next/src/client/components/react-dev-overlay/app/ReactDevOverlay.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' import { ACTION_UNHANDLED_ERROR, type OverlayState } from '../shared' import { ShadowPortal } from '../internal/components/ShadowPortal' diff --git a/packages/next/src/client/components/react-dev-overlay/app/hot-reloader-client.tsx b/packages/next/src/client/components/react-dev-overlay/app/hot-reloader-client.tsx index d132114cd8f96..895f4c2054b13 100644 --- a/packages/next/src/client/components/react-dev-overlay/app/hot-reloader-client.tsx +++ b/packages/next/src/client/components/react-dev-overlay/app/hot-reloader-client.tsx @@ -1,5 +1,5 @@ -import type { ReactNode } from 'next/dist/compiled/react' -import { useCallback, useEffect, startTransition, useMemo } from 'next/dist/compiled/react' +import type { ReactNode } from 'react' +import { useCallback, useEffect, startTransition, useMemo } from 'react' import stripAnsi from 'next/dist/compiled/strip-ansi' import formatWebpackMessages from '../internal/helpers/format-webpack-messages' import { useRouter } from '../../navigation' diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/CodeFrame/CodeFrame.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/CodeFrame/CodeFrame.tsx index 55f4aab4c51f3..ae511a1cb73cd 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/CodeFrame/CodeFrame.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/CodeFrame/CodeFrame.tsx @@ -1,5 +1,5 @@ import Anser from 'next/dist/compiled/anser' -import * as React from 'next/dist/compiled/react' +import * as React from 'react' import type { StackFrame } from 'next/dist/compiled/stacktrace-parser' import stripAnsi from 'next/dist/compiled/strip-ansi' import { getFrameSource } from '../../helpers/stack-frame' diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/Dialog.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/Dialog.tsx index 27d48dfe88760..39c8005d16622 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/Dialog.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/Dialog.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' import { useOnClickOutside } from '../../hooks/use-on-click-outside' export type DialogProps = { diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/DialogBody.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/DialogBody.tsx index 8b1c5cf91db69..f46fb9957f4e5 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/DialogBody.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/DialogBody.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' export type DialogBodyProps = { children?: React.ReactNode diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/DialogContent.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/DialogContent.tsx index b87e209162902..85fcc83b2983e 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/DialogContent.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/DialogContent.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' export type DialogContentProps = { children?: React.ReactNode diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/DialogHeader.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/DialogHeader.tsx index 1a14de55e610f..c53a613cf9ebd 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/DialogHeader.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/Dialog/DialogHeader.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' export type DialogHeaderProps = { children?: React.ReactNode diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/LeftRightDialogHeader/LeftRightDialogHeader.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/LeftRightDialogHeader/LeftRightDialogHeader.tsx index 08095319d7904..3db38e9967a2d 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/LeftRightDialogHeader/LeftRightDialogHeader.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/LeftRightDialogHeader/LeftRightDialogHeader.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' import { CloseIcon } from '../../icons/CloseIcon' export type LeftRightDialogHeaderProps = { diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/Overlay/Overlay.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/Overlay/Overlay.tsx index bbf0cfd592f7a..70a670b6ff90b 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/Overlay/Overlay.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/Overlay/Overlay.tsx @@ -1,5 +1,5 @@ import allyTrap from './maintain--tab-focus' -import * as React from 'next/dist/compiled/react' +import * as React from 'react' import { lock, unlock } from './body-locker' export type OverlayProps = { diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/ShadowPortal.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/ShadowPortal.tsx index f3c3458c52a15..b36d37ba6b5fb 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/ShadowPortal.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/ShadowPortal.tsx @@ -1,5 +1,5 @@ -import * as React from 'next/dist/compiled/react' -import { createPortal } from 'next/dist/compiled/react-dom' +import * as React from 'react' +import { createPortal } from 'react-dom' export function ShadowPortal({ children }: { children: React.ReactNode }) { let portalNode = React.useRef(null) diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/Terminal/EditorLink.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/Terminal/EditorLink.tsx index 4bfeb1a7963d7..518c29e4c7023 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/Terminal/EditorLink.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/Terminal/EditorLink.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import { useOpenInEditor } from '../../helpers/use-open-in-editor' type EditorLinkProps = { diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/Terminal/Terminal.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/Terminal/Terminal.tsx index 5845d7f119ced..e3d56b97adf7a 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/Terminal/Terminal.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/Terminal/Terminal.tsx @@ -1,5 +1,5 @@ import Anser from 'next/dist/compiled/anser' -import * as React from 'next/dist/compiled/react' +import * as React from 'react' import { HotlinkedText } from '../hot-linked-text' import { EditorLink } from './EditorLink' diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/Toast/Toast.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/Toast/Toast.tsx index 200d97b2ebc18..b29664842acff 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/Toast/Toast.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/Toast/Toast.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' export type ToastProps = { children?: React.ReactNode diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/VersionStalenessInfo/VersionStalenessInfo.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/VersionStalenessInfo/VersionStalenessInfo.tsx index e14be394723de..9cdcf6838c86e 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/VersionStalenessInfo/VersionStalenessInfo.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/VersionStalenessInfo/VersionStalenessInfo.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import type { VersionInfo } from '../../../../../../server/dev/parse-version-info' export function VersionStalenessInfo(props: VersionInfo) { diff --git a/packages/next/src/client/components/react-dev-overlay/internal/components/hot-linked-text/index.tsx b/packages/next/src/client/components/react-dev-overlay/internal/components/hot-linked-text/index.tsx index 773efe05b1609..1b92c31ff671e 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/components/hot-linked-text/index.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/components/hot-linked-text/index.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import { decodeMagicIdentifier, MAGIC_IDENTIFIER_REGEX, diff --git a/packages/next/src/client/components/react-dev-overlay/internal/container/BuildError.tsx b/packages/next/src/client/components/react-dev-overlay/internal/container/BuildError.tsx index e8c71ec825898..3e653b699410a 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/container/BuildError.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/container/BuildError.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' import type { VersionInfo } from '../../../../../server/dev/parse-version-info' import { Dialog, diff --git a/packages/next/src/client/components/react-dev-overlay/internal/container/Errors.tsx b/packages/next/src/client/components/react-dev-overlay/internal/container/Errors.tsx index cb159c90c5b9d..674828bead911 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/container/Errors.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/container/Errors.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, useMemo, useCallback } from 'next/dist/compiled/react' +import { useState, useEffect, useMemo, useCallback } from 'react' import { ACTION_UNHANDLED_ERROR, ACTION_UNHANDLED_REJECTION, diff --git a/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/ComponentStackFrameRow.tsx b/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/ComponentStackFrameRow.tsx index 77a624691828d..774d39d1c1d0d 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/ComponentStackFrameRow.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/ComponentStackFrameRow.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import type { ComponentStackFrame } from '../../helpers/parse-component-stack' import { useOpenInEditor } from '../../helpers/use-open-in-editor' import { HotlinkedText } from '../../components/hot-linked-text' diff --git a/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.tsx b/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.tsx index 1b1b67e61f63d..58f3156b22256 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.tsx @@ -1,4 +1,4 @@ -import { useMemo, Fragment, useState } from 'next/dist/compiled/react' +import { useMemo, Fragment, useState } from 'react' import type { ComponentStackFrame } from '../../helpers/parse-component-stack' import { CollapseIcon } from '../../icons/CollapseIcon' diff --git a/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/index.tsx b/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/index.tsx index 8d38771d3b71b..8e9ec07791633 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/index.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' import { CodeFrame } from '../../components/CodeFrame' import type { ReadyRuntimeError } from '../../helpers/getErrorByType' import { noop as css } from '../../helpers/noop-template' diff --git a/packages/next/src/client/components/react-dev-overlay/internal/container/root-layout-missing-tags-error.tsx b/packages/next/src/client/components/react-dev-overlay/internal/container/root-layout-missing-tags-error.tsx index d4ece839c0d30..517c061a6c610 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/container/root-layout-missing-tags-error.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/container/root-layout-missing-tags-error.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' import type { VersionInfo } from '../../../../../server/dev/parse-version-info' import { Dialog, DialogContent, DialogHeader } from '../components/Dialog' import { Overlay } from '../components/Overlay' diff --git a/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-error-handler.ts b/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-error-handler.ts index 34dacf2106868..be00a7ccd94e5 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-error-handler.ts +++ b/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-error-handler.ts @@ -1,4 +1,4 @@ -import { useEffect } from 'next/dist/compiled/react' +import { useEffect } from 'react' import { hydrationErrorState } from './hydration-error-info' import { isNextRouterError } from '../../../is-next-router-error' import { isHydrationError } from '../../../is-hydration-error' diff --git a/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-open-in-editor.ts b/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-open-in-editor.ts index a51fd45691e30..8e2e9e43f4b95 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-open-in-editor.ts +++ b/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-open-in-editor.ts @@ -1,4 +1,4 @@ -import { useCallback } from 'next/dist/compiled/react' +import { useCallback } from 'react' export function useOpenInEditor({ file, diff --git a/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-websocket.ts b/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-websocket.ts index 1973ee80bac6e..fd75210eaf682 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-websocket.ts +++ b/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-websocket.ts @@ -1,4 +1,4 @@ -import { useCallback, useContext, useEffect, useRef } from 'next/dist/compiled/react' +import { useCallback, useContext, useEffect, useRef } from 'react' import { GlobalLayoutRouterContext } from '../../../../../shared/lib/app-router-context.shared-runtime' import { getSocketUrl } from './get-socket-url' import type { TurbopackMsgToBrowser } from '../../../../../server/dev/hot-reloader-types' diff --git a/packages/next/src/client/components/react-dev-overlay/internal/hooks/use-on-click-outside.ts b/packages/next/src/client/components/react-dev-overlay/internal/hooks/use-on-click-outside.ts index ecb668b09199c..fb2add61d53c1 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/hooks/use-on-click-outside.ts +++ b/packages/next/src/client/components/react-dev-overlay/internal/hooks/use-on-click-outside.ts @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' export function useOnClickOutside( el: Node | null, diff --git a/packages/next/src/client/components/react-dev-overlay/internal/icons/CloseIcon.tsx b/packages/next/src/client/components/react-dev-overlay/internal/icons/CloseIcon.tsx index 1d2452d334d8b..e5a51a44a3eb5 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/icons/CloseIcon.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/icons/CloseIcon.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' const CloseIcon = () => { return ( diff --git a/packages/next/src/client/components/react-dev-overlay/internal/styles/Base.tsx b/packages/next/src/client/components/react-dev-overlay/internal/styles/Base.tsx index 174b4a7e17142..b5d05ea3598c9 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/styles/Base.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/styles/Base.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' import { noop as css } from '../helpers/noop-template' export function Base() { diff --git a/packages/next/src/client/components/react-dev-overlay/internal/styles/CssReset.tsx b/packages/next/src/client/components/react-dev-overlay/internal/styles/CssReset.tsx index 11f7e29819ef5..eb3e2ca7a6453 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/styles/CssReset.tsx +++ b/packages/next/src/client/components/react-dev-overlay/internal/styles/CssReset.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' import { noop as css } from '../helpers/noop-template' export function CssReset() { diff --git a/packages/next/src/client/components/react-dev-overlay/pages/ErrorBoundary.tsx b/packages/next/src/client/components/react-dev-overlay/pages/ErrorBoundary.tsx index 270cae8769607..3b8e9ef393680 100644 --- a/packages/next/src/client/components/react-dev-overlay/pages/ErrorBoundary.tsx +++ b/packages/next/src/client/components/react-dev-overlay/pages/ErrorBoundary.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' type ErrorBoundaryProps = { children?: React.ReactNode diff --git a/packages/next/src/client/components/react-dev-overlay/pages/ReactDevOverlay.tsx b/packages/next/src/client/components/react-dev-overlay/pages/ReactDevOverlay.tsx index c9fc23139d445..61233b98a3563 100644 --- a/packages/next/src/client/components/react-dev-overlay/pages/ReactDevOverlay.tsx +++ b/packages/next/src/client/components/react-dev-overlay/pages/ReactDevOverlay.tsx @@ -1,4 +1,4 @@ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' import * as Bus from './bus' import { ShadowPortal } from '../internal/components/ShadowPortal' diff --git a/packages/next/src/client/components/react-dev-overlay/shared.ts b/packages/next/src/client/components/react-dev-overlay/shared.ts index 5374b81099bd6..3151721c09ca6 100644 --- a/packages/next/src/client/components/react-dev-overlay/shared.ts +++ b/packages/next/src/client/components/react-dev-overlay/shared.ts @@ -1,4 +1,4 @@ -import { useReducer } from 'next/dist/compiled/react' +import { useReducer } from 'react' import type { StackFrame } from 'next/dist/compiled/stacktrace-parser' import type { VersionInfo } from '../../../server/dev/parse-version-info' diff --git a/packages/next/src/client/components/redirect-boundary.tsx b/packages/next/src/client/components/redirect-boundary.tsx index 1c3f48a80cb53..c4530614895ac 100644 --- a/packages/next/src/client/components/redirect-boundary.tsx +++ b/packages/next/src/client/components/redirect-boundary.tsx @@ -1,5 +1,5 @@ 'use client' -import React, { useEffect } from 'next/dist/compiled/react' +import React, { useEffect } from 'react' import type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime' import { useRouter } from './navigation' import { diff --git a/packages/next/src/client/components/render-from-template-context.tsx b/packages/next/src/client/components/render-from-template-context.tsx index 6a995019c0acf..c1755cc5056bf 100644 --- a/packages/next/src/client/components/render-from-template-context.tsx +++ b/packages/next/src/client/components/render-from-template-context.tsx @@ -1,6 +1,6 @@ 'use client' -import React, { useContext } from 'next/dist/compiled/react' +import React, { useContext } from 'react' import { TemplateContext } from '../../shared/lib/app-router-context.shared-runtime' export default function RenderFromTemplateContext(): JSX.Element { diff --git a/packages/next/src/client/components/router-reducer/apply-router-state-patch-to-tree.test.tsx b/packages/next/src/client/components/router-reducer/apply-router-state-patch-to-tree.test.tsx index f37a4fd6200b5..86c16eac07e8b 100644 --- a/packages/next/src/client/components/router-reducer/apply-router-state-patch-to-tree.test.tsx +++ b/packages/next/src/client/components/router-reducer/apply-router-state-patch-to-tree.test.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import type { FlightData, FlightRouterState, diff --git a/packages/next/src/client/components/router-reducer/clear-cache-node-data-for-segment-path.test.tsx b/packages/next/src/client/components/router-reducer/clear-cache-node-data-for-segment-path.test.tsx index 25b1b3ad6b9a7..abb2df3d6beab 100644 --- a/packages/next/src/client/components/router-reducer/clear-cache-node-data-for-segment-path.test.tsx +++ b/packages/next/src/client/components/router-reducer/clear-cache-node-data-for-segment-path.test.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import { clearCacheNodeDataForSegmentPath } from './clear-cache-node-data-for-segment-path' import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime' diff --git a/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx b/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx index 7b717329d6cf9..46e99b41c7a95 100644 --- a/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx +++ b/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import type { FlightRouterState } from '../../../server/app-render/types' import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime' import { createInitialRouterState } from './create-initial-router-state' diff --git a/packages/next/src/client/components/router-reducer/create-initial-router-state.ts b/packages/next/src/client/components/router-reducer/create-initial-router-state.ts index 6411389e908aa..9a8b5bc901dc6 100644 --- a/packages/next/src/client/components/router-reducer/create-initial-router-state.ts +++ b/packages/next/src/client/components/router-reducer/create-initial-router-state.ts @@ -1,4 +1,4 @@ -import type { ReactNode } from 'next/dist/compiled/react' +import type { ReactNode } from 'react' import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightRouterState, diff --git a/packages/next/src/client/components/router-reducer/fetch-server-response.ts b/packages/next/src/client/components/router-reducer/fetch-server-response.ts index 4ec9104cc26cb..2af83aa8a203c 100644 --- a/packages/next/src/client/components/router-reducer/fetch-server-response.ts +++ b/packages/next/src/client/components/router-reducer/fetch-server-response.ts @@ -2,7 +2,7 @@ // @ts-ignore // eslint-disable-next-line import/no-extraneous-dependencies -// import { createFromFetch } from 'next/dist/compiled/react-server-dom-webpack/client' +// import { createFromFetch } from 'react-server-dom-webpack/client' const { createFromFetch } = ( !!process.env.NEXT_RUNTIME ? // eslint-disable-next-line import/no-extraneous-dependencies diff --git a/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.test.tsx b/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.test.tsx index e199771c8330a..691def08dee51 100644 --- a/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.test.tsx +++ b/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.test.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data' import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightData } from '../../../server/app-render/types' diff --git a/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.test.tsx b/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.test.tsx index ef1587a816f5d..226fb3bd0af2c 100644 --- a/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.test.tsx +++ b/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.test.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head' import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightData } from '../../../server/app-render/types' diff --git a/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.test.tsx b/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.test.tsx index 583de3e48dce2..afc5bce7b1af7 100644 --- a/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.test.tsx +++ b/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.test.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import type { FlightData } from '../../../server/app-render/types' import { invalidateCacheBelowFlightSegmentPath } from './invalidate-cache-below-flight-segmentpath' import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime' diff --git a/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.test.tsx b/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.test.tsx index d3913c7db039f..ab9804d0e62df 100644 --- a/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.test.tsx +++ b/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.test.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import { invalidateCacheByRouterState } from './invalidate-cache-by-router-state' import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightRouterState } from '../../../server/app-render/types' diff --git a/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.test.tsx b/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.test.tsx index 103c12f0fb7ed..ce4f5f6ac0fc5 100644 --- a/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.test.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import type { FlightRouterState } from '../../../../server/app-render/types' import type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime' import { findHeadInCache } from './find-head-in-cache' diff --git a/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts b/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts index d537f448b9eec..4784cfbdee5f7 100644 --- a/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts +++ b/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts @@ -11,9 +11,9 @@ import { RSC_CONTENT_TYPE_HEADER, } from '../../app-router-headers' // // eslint-disable-next-line import/no-extraneous-dependencies -// import { createFromFetch } from 'next/dist/compiled/react-server-dom-webpack/client' +// import { createFromFetch } from 'react-server-dom-webpack/client' // // eslint-disable-next-line import/no-extraneous-dependencies -// import { encodeReply } from 'next/dist/compiled/react-server-dom-webpack/client' +// import { encodeReply } from 'react-server-dom-webpack/client' const { createFromFetch, encodeReply } = ( !!process.env.NEXT_RUNTIME ? // eslint-disable-next-line import/no-extraneous-dependencies diff --git a/packages/next/src/client/components/router-reducer/should-hard-navigate.test.tsx b/packages/next/src/client/components/router-reducer/should-hard-navigate.test.tsx index 7989271b99e31..2c5075dc8d5a3 100644 --- a/packages/next/src/client/components/router-reducer/should-hard-navigate.test.tsx +++ b/packages/next/src/client/components/router-reducer/should-hard-navigate.test.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import type { FlightData, FlightRouterState, diff --git a/packages/next/src/client/components/use-reducer-with-devtools.ts b/packages/next/src/client/components/use-reducer-with-devtools.ts index 6eaf9b7a68cc3..dd75194c63a3b 100644 --- a/packages/next/src/client/components/use-reducer-with-devtools.ts +++ b/packages/next/src/client/components/use-reducer-with-devtools.ts @@ -1,6 +1,6 @@ -import type { Dispatch } from 'next/dist/compiled/react' -import React, { use, useContext } from 'next/dist/compiled/react' -import { useRef, useEffect, useCallback } from 'next/dist/compiled/react' +import type { Dispatch } from 'react' +import React, { use, useContext } from 'react' +import { useRef, useEffect, useCallback } from 'react' import { isThenable, type AppRouterState, diff --git a/packages/next/src/client/image-component.tsx b/packages/next/src/client/image-component.tsx index 5937e4d212c53..80e8aea263e86 100644 --- a/packages/next/src/client/image-component.tsx +++ b/packages/next/src/client/image-component.tsx @@ -9,8 +9,8 @@ import React, { useState, forwardRef, version, -} from 'next/dist/compiled/react' -import ReactDOM from 'next/dist/compiled/react-dom' +} from 'react' +import ReactDOM from 'react-dom' import Head from '../shared/lib/head' import { getImgProps } from '../shared/lib/get-img-props' import type { diff --git a/packages/next/src/client/index.tsx b/packages/next/src/client/index.tsx index 143e1196c6891..2af72e60a5bfc 100644 --- a/packages/next/src/client/index.tsx +++ b/packages/next/src/client/index.tsx @@ -8,8 +8,8 @@ import type { PrivateRouteInfo, } from '../shared/lib/router/router' -import React from 'next/dist/compiled/react' -import ReactDOM from 'next/dist/compiled/react-dom/client' +import React from 'react' +import ReactDOM from 'react-dom/client' import { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime' import mitt from '../shared/lib/mitt' import type { MittEmitter } from '../shared/lib/mitt' diff --git a/packages/next/src/client/legacy/image.tsx b/packages/next/src/client/legacy/image.tsx index 2601cefe86f12..d982e9fa8a330 100644 --- a/packages/next/src/client/legacy/image.tsx +++ b/packages/next/src/client/legacy/image.tsx @@ -7,7 +7,7 @@ import React, { useContext, useMemo, useState, -} from 'next/dist/compiled/react' +} from 'react' import Head from '../../shared/lib/head' import { imageConfigDefault, diff --git a/packages/next/src/client/link.tsx b/packages/next/src/client/link.tsx index f8813b4c743d9..71f69a4780145 100644 --- a/packages/next/src/client/link.tsx +++ b/packages/next/src/client/link.tsx @@ -5,7 +5,7 @@ import type { PrefetchOptions as RouterPrefetchOptions, } from '../shared/lib/router/router' -import React from 'next/dist/compiled/react' +import React from 'react' import type { UrlObject } from 'url' import { resolveHref } from './resolve-href' import { isLocalURL } from '../shared/lib/router/utils/is-local-url' diff --git a/packages/next/src/client/page-loader.ts b/packages/next/src/client/page-loader.ts index 11be2f286b246..61d0071b10fcf 100644 --- a/packages/next/src/client/page-loader.ts +++ b/packages/next/src/client/page-loader.ts @@ -1,4 +1,4 @@ -import type { ComponentType } from 'next/dist/compiled/react' +import type { ComponentType } from 'react' import type { RouteLoader } from './route-loader' import type { MiddlewareMatcher } from '../build/analysis/get-page-static-info' import { addBasePath } from './add-base-path' diff --git a/packages/next/src/client/portal/index.tsx b/packages/next/src/client/portal/index.tsx index a6729db5c569f..681bcab7bc79f 100644 --- a/packages/next/src/client/portal/index.tsx +++ b/packages/next/src/client/portal/index.tsx @@ -1,5 +1,5 @@ -import { useEffect, useState } from 'next/dist/compiled/react' -import { createPortal } from 'next/dist/compiled/react-dom' +import { useEffect, useState } from 'react' +import { createPortal } from 'react-dom' type PortalProps = { children: React.ReactNode diff --git a/packages/next/src/client/route-announcer.tsx b/packages/next/src/client/route-announcer.tsx index 3ac1ea601fc2e..d5a78b433959a 100644 --- a/packages/next/src/client/route-announcer.tsx +++ b/packages/next/src/client/route-announcer.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import { useRouter } from './router' const nextjsRouteAnnouncerStyles: React.CSSProperties = { diff --git a/packages/next/src/client/route-loader.ts b/packages/next/src/client/route-loader.ts index ff5bb5042c59a..ab0337eff033f 100644 --- a/packages/next/src/client/route-loader.ts +++ b/packages/next/src/client/route-loader.ts @@ -1,4 +1,4 @@ -import type { ComponentType } from 'next/dist/compiled/react' +import type { ComponentType } from 'react' import type { MiddlewareMatcher } from '../build/analysis/get-page-static-info' import getAssetPathFromRoute from '../shared/lib/router/utils/get-asset-path-from-route' import { __unsafeCreateTrustedScriptURL } from './trusted-types' diff --git a/packages/next/src/client/router.ts b/packages/next/src/client/router.ts index 04b6db8d011fd..a40fdcdcedbf6 100644 --- a/packages/next/src/client/router.ts +++ b/packages/next/src/client/router.ts @@ -1,5 +1,5 @@ /* global window */ -import React from 'next/dist/compiled/react' +import React from 'react' import Router from '../shared/lib/router/router' import type { NextRouter } from '../shared/lib/router/router' import { RouterContext } from '../shared/lib/router-context.shared-runtime' diff --git a/packages/next/src/client/script.tsx b/packages/next/src/client/script.tsx index e5fef6bb1eff3..834dc83e804a2 100644 --- a/packages/next/src/client/script.tsx +++ b/packages/next/src/client/script.tsx @@ -1,8 +1,8 @@ 'use client' -import ReactDOM from 'next/dist/compiled/react-dom' -import React, { useEffect, useContext, useRef } from 'next/dist/compiled/react' -import type { ScriptHTMLAttributes } from 'next/dist/compiled/react' +import ReactDOM from 'react-dom' +import React, { useEffect, useContext, useRef } from 'react' +import type { ScriptHTMLAttributes } from 'react' import { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime' import { setAttributesFromProps } from './set-attributes-from-props' import { requestIdleCallback } from './request-idle-callback' diff --git a/packages/next/src/client/use-intersection.tsx b/packages/next/src/client/use-intersection.tsx index 1bca1b7ddf823..27562ad966bbc 100644 --- a/packages/next/src/client/use-intersection.tsx +++ b/packages/next/src/client/use-intersection.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useRef, useState } from 'next/dist/compiled/react' +import { useCallback, useEffect, useRef, useState } from 'react' import { requestIdleCallback, cancelIdleCallback, diff --git a/packages/next/src/client/web-vitals.ts b/packages/next/src/client/web-vitals.ts index a04948944e8bf..36c532553bcf2 100644 --- a/packages/next/src/client/web-vitals.ts +++ b/packages/next/src/client/web-vitals.ts @@ -1,4 +1,4 @@ -import { useEffect } from 'next/dist/compiled/react' +import { useEffect } from 'react' import { onLCP, onFID, diff --git a/packages/next/src/client/with-router.tsx b/packages/next/src/client/with-router.tsx index 76994d80121df..7dd0217ef4d03 100644 --- a/packages/next/src/client/with-router.tsx +++ b/packages/next/src/client/with-router.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import type { BaseContext, NextComponentType, diff --git a/packages/next/src/compiled/@vercel/og/index.edge.d.ts b/packages/next/src/compiled/@vercel/og/index.edge.d.ts index 52dc10aeafa8d..6d0ad0c1d514d 100644 --- a/packages/next/src/compiled/@vercel/og/index.edge.d.ts +++ b/packages/next/src/compiled/@vercel/og/index.edge.d.ts @@ -1,4 +1,4 @@ -import type { ReactElement } from 'next/dist/compiled/react'; +import type { ReactElement } from 'react'; import type { ImageResponseOptions, FigmaImageResponseProps } from './types'; export declare class ImageResponse extends Response { constructor(element: ReactElement, options?: ImageResponseOptions); diff --git a/packages/next/src/compiled/@vercel/og/index.node.d.ts b/packages/next/src/compiled/@vercel/og/index.node.d.ts index 9b0365bc725c3..a8162af59169c 100644 --- a/packages/next/src/compiled/@vercel/og/index.node.d.ts +++ b/packages/next/src/compiled/@vercel/og/index.node.d.ts @@ -1,5 +1,5 @@ /// -import type { ReactElement } from 'next/dist/compiled/react'; +import type { ReactElement } from 'react'; import type { ImageResponseNodeOptions, ImageResponseOptions, FigmaImageResponseProps } from './types'; import { Readable } from 'stream'; export declare class ImageResponse extends Response { diff --git a/packages/next/src/compiled/@vercel/og/satori/index.d.ts b/packages/next/src/compiled/@vercel/og/satori/index.d.ts index 5ba49d885b007..1ab2661c462a1 100644 --- a/packages/next/src/compiled/@vercel/og/satori/index.d.ts +++ b/packages/next/src/compiled/@vercel/og/satori/index.d.ts @@ -1,4 +1,4 @@ -import { ReactNode } from 'next/dist/compiled/react'; +import { ReactNode } from 'react'; type Yoga = any; declare const code: { diff --git a/packages/next/src/compiled/react-is/README.md b/packages/next/src/compiled/react-is/README.md index 68224df0c8bff..d255977618178 100644 --- a/packages/next/src/compiled/react-is/README.md +++ b/packages/next/src/compiled/react-is/README.md @@ -49,7 +49,7 @@ ReactIs.isValidElementType(React.createFactory("div")); // true ```js import React from "react"; -import * as ReactIs from 'next/dist/compiled/react-is'; +import * as ReactIs from 'react-is'; const ThemeContext = React.createContext("blue"); @@ -63,7 +63,7 @@ ReactIs.typeOf() === ReactIs.ContextConsumer; // true ```js import React from "react"; -import * as ReactIs from 'next/dist/compiled/react-is'; +import * as ReactIs from 'react-is'; ReactIs.isElement(
); // true ReactIs.typeOf(
) === ReactIs.Element; // true @@ -73,7 +73,7 @@ ReactIs.typeOf(
) === ReactIs.Element; // true ```js import React from "react"; -import * as ReactIs from 'next/dist/compiled/react-is'; +import * as ReactIs from 'react-is'; ReactIs.isFragment(<>); // true ReactIs.typeOf(<>) === ReactIs.Fragment; // true @@ -84,7 +84,7 @@ ReactIs.typeOf(<>) === ReactIs.Fragment; // true ```js import React from "react"; import ReactDOM from "react-dom"; -import * as ReactIs from 'next/dist/compiled/react-is'; +import * as ReactIs from 'react-is'; const div = document.createElement("div"); const portal = ReactDOM.createPortal(
, div); @@ -97,7 +97,7 @@ ReactIs.typeOf(portal) === ReactIs.Portal; // true ```js import React from "react"; -import * as ReactIs from 'next/dist/compiled/react-is'; +import * as ReactIs from 'react-is'; ReactIs.isStrictMode(); // true ReactIs.typeOf() === ReactIs.StrictMode; // true diff --git a/packages/next/src/lib/metadata/generate/alternate.tsx b/packages/next/src/lib/metadata/generate/alternate.tsx index 4c80c47ea33b3..cb4377b591036 100644 --- a/packages/next/src/lib/metadata/generate/alternate.tsx +++ b/packages/next/src/lib/metadata/generate/alternate.tsx @@ -1,7 +1,7 @@ import type { ResolvedMetadata } from '../types/metadata-interface' import type { AlternateLinkDescriptor } from '../types/alternative-urls-types' -import React from 'next/dist/compiled/react' +import React from 'react' import { MetaFilter } from './meta' function AlternateLink({ diff --git a/packages/next/src/lib/metadata/generate/basic.tsx b/packages/next/src/lib/metadata/generate/basic.tsx index 53d32797937fa..c2f5460d62e0a 100644 --- a/packages/next/src/lib/metadata/generate/basic.tsx +++ b/packages/next/src/lib/metadata/generate/basic.tsx @@ -5,7 +5,7 @@ import type { } from '../types/metadata-interface' import type { ViewportLayout } from '../types/extra-types' -import React from 'next/dist/compiled/react' +import React from 'react' import { Meta, MetaFilter, MultiMeta } from './meta' import { ViewportMetaKeys } from '../constants' diff --git a/packages/next/src/lib/metadata/generate/icons.tsx b/packages/next/src/lib/metadata/generate/icons.tsx index 5f1208cc9d6ea..788698ebca8fa 100644 --- a/packages/next/src/lib/metadata/generate/icons.tsx +++ b/packages/next/src/lib/metadata/generate/icons.tsx @@ -1,7 +1,7 @@ import type { ResolvedMetadata } from '../types/metadata-interface' import type { Icon, IconDescriptor } from '../types/metadata-types' -import React from 'next/dist/compiled/react' +import React from 'react' import { MetaFilter } from './meta' function IconDescriptorLink({ icon }: { icon: IconDescriptor }) { diff --git a/packages/next/src/lib/metadata/generate/meta.tsx b/packages/next/src/lib/metadata/generate/meta.tsx index a3e980bae24bc..96394bc7b008a 100644 --- a/packages/next/src/lib/metadata/generate/meta.tsx +++ b/packages/next/src/lib/metadata/generate/meta.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import { nonNullable } from '../../non-nullable' export function Meta({ diff --git a/packages/next/src/lib/metadata/metadata.tsx b/packages/next/src/lib/metadata/metadata.tsx index 217f99b20823c..1be2eb2e20717 100644 --- a/packages/next/src/lib/metadata/metadata.tsx +++ b/packages/next/src/lib/metadata/metadata.tsx @@ -2,7 +2,7 @@ import type { ParsedUrlQuery } from 'querystring' import type { GetDynamicParamFromSegment } from '../../server/app-render/app-render' import type { LoaderTree } from '../../server/lib/app-dir-module' -import React from 'next/dist/compiled/react' +import React from 'react' import { AppleWebAppMeta, FormatDetectionMeta, diff --git a/packages/next/src/pages/_app.tsx b/packages/next/src/pages/_app.tsx index c6abe866d6e91..7573e00cdd239 100644 --- a/packages/next/src/pages/_app.tsx +++ b/packages/next/src/pages/_app.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import type { AppContextType, diff --git a/packages/next/src/pages/_document.tsx b/packages/next/src/pages/_document.tsx index 4e6b27eaa6561..792c45f0c2d29 100644 --- a/packages/next/src/pages/_document.tsx +++ b/packages/next/src/pages/_document.tsx @@ -1,5 +1,5 @@ -import React from 'next/dist/compiled/react' -import type { ReactElement, ReactNode } from 'next/dist/compiled/react' +import React from 'react' +import type { ReactElement, ReactNode } from 'react' import { OPTIMIZED_FONT_PROVIDERS, NEXT_BUILTIN_DOCUMENT, @@ -418,7 +418,7 @@ function getNextFontLinkTags( // Use `React.Component` to avoid errors from the RSC checks because // it can't be imported directly in Server Components: // -// import { Component } from 'next/dist/compiled/react' +// import { Component } from 'react' // // More info: https://github.com/vercel/next.js/pull/40686 export class Head extends React.Component { diff --git a/packages/next/src/pages/_error.tsx b/packages/next/src/pages/_error.tsx index 6707ef6a13ef4..effc8b75d129a 100644 --- a/packages/next/src/pages/_error.tsx +++ b/packages/next/src/pages/_error.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import Head from '../shared/lib/head' import type { NextPageContext } from '../shared/lib/utils' diff --git a/packages/next/src/server/app-render/app-render.tsx b/packages/next/src/server/app-render/app-render.tsx index b84f826e63f68..95560e8aa8fc3 100644 --- a/packages/next/src/server/app-render/app-render.tsx +++ b/packages/next/src/server/app-render/app-render.tsx @@ -18,7 +18,7 @@ import type { Revalidate } from '../lib/revalidate' import type { DeepReadonly } from '../../shared/lib/deep-readonly' import type { BaseNextRequest, BaseNextResponse } from '../base-http' -import React from 'next/dist/compiled/react' +import React from 'react' import RenderResult, { type AppPageRenderResultMetadata, diff --git a/packages/next/src/server/app-render/create-component-styles-and-scripts.tsx b/packages/next/src/server/app-render/create-component-styles-and-scripts.tsx index b080abf7eb269..372cd1ce4fc77 100644 --- a/packages/next/src/server/app-render/create-component-styles-and-scripts.tsx +++ b/packages/next/src/server/app-render/create-component-styles-and-scripts.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import { interopDefault } from './interop-default' import { getLinkAndScriptTags } from './get-css-inlined-link-tags' import type { AppRenderContext } from './app-render' diff --git a/packages/next/src/server/app-render/create-component-tree.tsx b/packages/next/src/server/app-render/create-component-tree.tsx index 3b78c419b5bec..0ea17745987dc 100644 --- a/packages/next/src/server/app-render/create-component-tree.tsx +++ b/packages/next/src/server/app-render/create-component-tree.tsx @@ -1,5 +1,5 @@ import type { FlightSegmentPath, CacheNodeSeedData } from './types' -import React, { type ReactNode } from 'next/dist/compiled/react' +import React, { type ReactNode } from 'react' import { isClientReference } from '../../lib/client-reference' import { getLayoutOrPageModule } from '../lib/app-dir-module' import type { LoaderTree } from '../lib/app-dir-module' diff --git a/packages/next/src/server/app-render/dynamic-rendering.ts b/packages/next/src/server/app-render/dynamic-rendering.ts index 3bb958ad82786..e27f807c16ff3 100644 --- a/packages/next/src/server/app-render/dynamic-rendering.ts +++ b/packages/next/src/server/app-render/dynamic-rendering.ts @@ -21,7 +21,7 @@ */ // Once postpone is in stable we should switch to importing the postpone export directly -import React from 'next/dist/compiled/react' +import React from 'react' import type { StaticGenerationStore } from '../../client/components/static-generation-async-storage.external' import { DynamicServerError } from '../../client/components/hooks-server-context' diff --git a/packages/next/src/server/app-render/encryption.ts b/packages/next/src/server/app-render/encryption.ts index 07a2c8dc4011d..59ffb87369d35 100644 --- a/packages/next/src/server/app-render/encryption.ts +++ b/packages/next/src/server/app-render/encryption.ts @@ -5,12 +5,12 @@ import 'server-only' import { renderToReadableStream, decodeReply, -} from 'next/dist/compiled/react-server-dom-webpack/server.edge' +} from 'react-server-dom-webpack/server.edge' /* eslint-disable import/no-extraneous-dependencies */ import { createFromReadableStream, encodeReply, -} from 'next/dist/compiled/react-server-dom-webpack/client.edge' +} from 'react-server-dom-webpack/client.edge' import { streamToString } from '../stream-utils/node-web-streams-helper' import { diff --git a/packages/next/src/server/app-render/entry-base.ts b/packages/next/src/server/app-render/entry-base.ts index e51ab563c7ce7..52decc09a7219 100644 --- a/packages/next/src/server/app-render/entry-base.ts +++ b/packages/next/src/server/app-render/entry-base.ts @@ -4,7 +4,7 @@ export { decodeReply, decodeAction, decodeFormState, -} from 'next/dist/compiled/react-server-dom-webpack/server.edge' +} from 'react-server-dom-webpack/server.edge' import AppRouter from '../../client/components/app-router' import LayoutRouter from '../../client/components/layout-router' diff --git a/packages/next/src/server/app-render/get-layer-assets.tsx b/packages/next/src/server/app-render/get-layer-assets.tsx index 864ed69361a04..9c770f1baa4b2 100644 --- a/packages/next/src/server/app-render/get-layer-assets.tsx +++ b/packages/next/src/server/app-render/get-layer-assets.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import { getLinkAndScriptTags } from './get-css-inlined-link-tags' import { getPreloadableFonts } from './get-preloadable-fonts' import type { AppRenderContext } from './app-render' diff --git a/packages/next/src/server/app-render/make-get-server-inserted-html.tsx b/packages/next/src/server/app-render/make-get-server-inserted-html.tsx index 74733f64903db..976733f19644f 100644 --- a/packages/next/src/server/app-render/make-get-server-inserted-html.tsx +++ b/packages/next/src/server/app-render/make-get-server-inserted-html.tsx @@ -1,11 +1,11 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import { isNotFoundError } from '../../client/components/not-found' import { getURLFromRedirectError, isRedirectError, getRedirectStatusCodeFromError, } from '../../client/components/redirect' -import { renderToReadableStream } from 'next/dist/compiled/react-dom/server.edge' +import { renderToReadableStream } from 'react-dom/server.edge' import { streamToString } from '../stream-utils/node-web-streams-helper' import { RedirectStatusCode } from '../../client/components/redirect-status-code' import { addPathPrefix } from '../../shared/lib/router/utils/add-path-prefix' diff --git a/packages/next/src/server/app-render/react-server.node.ts b/packages/next/src/server/app-render/react-server.node.ts index 03b8c95b646fc..404aa7a87a882 100644 --- a/packages/next/src/server/app-render/react-server.node.ts +++ b/packages/next/src/server/app-render/react-server.node.ts @@ -6,4 +6,4 @@ export { decodeReplyFromBusboy, decodeAction, decodeFormState, -} from 'next/dist/compiled/react-server-dom-webpack/server.node' +} from 'react-server-dom-webpack/server.node' diff --git a/packages/next/src/server/app-render/required-scripts.tsx b/packages/next/src/server/app-render/required-scripts.tsx index 5f2fce41c9592..1b3ff9325805f 100644 --- a/packages/next/src/server/app-render/required-scripts.tsx +++ b/packages/next/src/server/app-render/required-scripts.tsx @@ -1,7 +1,7 @@ import { encodeURIPath } from '../../shared/lib/encode-uri-path' import type { BuildManifest } from '../get-page-files' -import ReactDOM from 'next/dist/compiled/react-dom' +import ReactDOM from 'react-dom' export function getRequiredScripts( buildManifest: BuildManifest, diff --git a/packages/next/src/server/app-render/rsc/preloads.ts b/packages/next/src/server/app-render/rsc/preloads.ts index 0f102514f0974..fdb2bc39bdcc0 100644 --- a/packages/next/src/server/app-render/rsc/preloads.ts +++ b/packages/next/src/server/app-render/rsc/preloads.ts @@ -4,7 +4,7 @@ Files in the rsc directory are meant to be packaged as part of the RSC graph usi */ -import ReactDOM from 'next/dist/compiled/react-dom' +import ReactDOM from 'react-dom' export function preloadStyle(href: string, crossOrigin?: string | undefined) { const opts: any = { as: 'style' } diff --git a/packages/next/src/server/app-render/rsc/taint.ts b/packages/next/src/server/app-render/rsc/taint.ts index 5d15456806603..a37e0bf15d0d6 100644 --- a/packages/next/src/server/app-render/rsc/taint.ts +++ b/packages/next/src/server/app-render/rsc/taint.ts @@ -4,7 +4,7 @@ Files in the rsc directory are meant to be packaged as part of the RSC graph usi */ -import * as React from 'next/dist/compiled/react' +import * as React from 'react' type Reference = object type TaintableUniqueValue = string | bigint | ArrayBufferView diff --git a/packages/next/src/server/app-render/server-inserted-html.tsx b/packages/next/src/server/app-render/server-inserted-html.tsx index aff9d96914c6b..764dc62792077 100644 --- a/packages/next/src/server/app-render/server-inserted-html.tsx +++ b/packages/next/src/server/app-render/server-inserted-html.tsx @@ -1,7 +1,7 @@ // Provider for the `useServerInsertedHTML` API to register callbacks to insert // elements into the HTML stream. -import React from 'next/dist/compiled/react' +import React from 'react' import { ServerInsertedHTMLContext } from '../../shared/lib/server-inserted-html.shared-runtime' export function createServerInsertedHTML() { diff --git a/packages/next/src/server/app-render/static/static-renderer.ts b/packages/next/src/server/app-render/static/static-renderer.ts index 853e1902deb8b..616f762c68d50 100644 --- a/packages/next/src/server/app-render/static/static-renderer.ts +++ b/packages/next/src/server/app-render/static/static-renderer.ts @@ -1,8 +1,8 @@ import type { Options as RenderToReadableStreamOptions, ResumeOptions, -} from 'next/dist/compiled/react-dom/server.edge' -import type { Options as PrerenderOptions } from 'next/dist/compiled/react-dom/static.edge' +} from 'react-dom/server.edge' +import type { Options as PrerenderOptions } from 'react-dom/static.edge' type RenderResult = { stream: ReadableStream diff --git a/packages/next/src/server/app-render/walk-tree-with-flight-router-state.tsx b/packages/next/src/server/app-render/walk-tree-with-flight-router-state.tsx index 83c9a06d7d13d..3a0dd77ea61ec 100644 --- a/packages/next/src/server/app-render/walk-tree-with-flight-router-state.tsx +++ b/packages/next/src/server/app-render/walk-tree-with-flight-router-state.tsx @@ -4,7 +4,7 @@ import type { FlightSegmentPath, Segment, } from './types' -import React from 'next/dist/compiled/react' +import React from 'react' import { canSegmentBeOverridden, matchSegment, diff --git a/packages/next/src/server/dev/next-dev-server.ts b/packages/next/src/server/dev/next-dev-server.ts index 3af5457905360..333b31a952d52 100644 --- a/packages/next/src/server/dev/next-dev-server.ts +++ b/packages/next/src/server/dev/next-dev-server.ts @@ -6,7 +6,7 @@ import type { ParsedUrl } from '../../shared/lib/router/utils/parse-url' import type { ParsedUrlQuery } from 'querystring' import type { UrlWithParsedQuery } from 'url' import type { FallbackMode, MiddlewareRoutingItem } from '../base-server' -import type { FunctionComponent } from 'next/dist/compiled/react' +import type { FunctionComponent } from 'react' import type { RouteDefinition } from '../future/route-definitions/route-definition' import type { RouteMatcherManager } from '../future/route-matcher-managers/route-matcher-manager' import type { diff --git a/packages/next/src/server/future/route-modules/app-page/vendored/rsc/entrypoints.ts b/packages/next/src/server/future/route-modules/app-page/vendored/rsc/entrypoints.ts index 076a6d680e624..24bb9d600cf4a 100644 --- a/packages/next/src/server/future/route-modules/app-page/vendored/rsc/entrypoints.ts +++ b/packages/next/src/server/future/route-modules/app-page/vendored/rsc/entrypoints.ts @@ -1,7 +1,7 @@ -import * as React from 'next/dist/compiled/react' -import * as ReactDOM from 'next/dist/compiled/react-dom' -import * as ReactJsxDevRuntime from 'next/dist/compiled/react/jsx-dev-runtime' -import * as ReactJsxRuntime from 'next/dist/compiled/react/jsx-runtime' +import * as React from 'react' +import * as ReactDOM from 'react-dom' +import * as ReactJsxDevRuntime from 'react/jsx-dev-runtime' +import * as ReactJsxRuntime from 'react/jsx-runtime' function getAltProxyForBindingsDEV( type: 'Turbopack' | 'Webpack', diff --git a/packages/next/src/server/future/route-modules/app-page/vendored/ssr/entrypoints.ts b/packages/next/src/server/future/route-modules/app-page/vendored/ssr/entrypoints.ts index 0eb9a2171361d..70f432fff4e88 100644 --- a/packages/next/src/server/future/route-modules/app-page/vendored/ssr/entrypoints.ts +++ b/packages/next/src/server/future/route-modules/app-page/vendored/ssr/entrypoints.ts @@ -1,10 +1,10 @@ -import * as React from 'next/dist/compiled/react' -import * as ReactDOM from 'next/dist/compiled/react-dom/server-rendering-stub' -import * as ReactJsxDevRuntime from 'next/dist/compiled/react/jsx-dev-runtime' -import * as ReactJsxRuntime from 'next/dist/compiled/react/jsx-runtime' +import * as React from 'react' +import * as ReactDOM from 'react-dom/server-rendering-stub' +import * as ReactJsxDevRuntime from 'react/jsx-dev-runtime' +import * as ReactJsxRuntime from 'react/jsx-runtime' // eslint-disable-next-line import/no-extraneous-dependencies -import * as ReactDOMServerEdge from 'next/dist/compiled/react-dom/server.edge' +import * as ReactDOMServerEdge from 'react-dom/server.edge' function getAltProxyForBindingsDEV( type: 'Turbopack' | 'Webpack', diff --git a/packages/next/src/server/render.tsx b/packages/next/src/server/render.tsx index bee29d32f390d..c9cd388215ed6 100644 --- a/packages/next/src/server/render.tsx +++ b/packages/next/src/server/render.tsx @@ -40,8 +40,8 @@ import type { NextParsedUrlQuery } from './request-meta' import type { Revalidate, SwrDelta } from './lib/revalidate' import type { COMPILER_NAMES } from '../shared/lib/constants' -import React from 'next/dist/compiled/react' -import ReactDOMServer from 'next/dist/compiled/react-dom/server.browser' +import React from 'react' +import ReactDOMServer from 'react-dom/server.browser' import { StyleRegistry, createStyleRegistry } from 'styled-jsx' import { GSP_NO_RETURNED_VALUE, diff --git a/packages/next/src/shared/lib/amp-context.shared-runtime.ts b/packages/next/src/shared/lib/amp-context.shared-runtime.ts index f96ad7c7e2923..3d71886281cdb 100644 --- a/packages/next/src/shared/lib/amp-context.shared-runtime.ts +++ b/packages/next/src/shared/lib/amp-context.shared-runtime.ts @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' export const AmpStateContext: React.Context = React.createContext({}) diff --git a/packages/next/src/shared/lib/amp.ts b/packages/next/src/shared/lib/amp.ts index 4d9f6dd6d8ed7..8edd21db9c299 100644 --- a/packages/next/src/shared/lib/amp.ts +++ b/packages/next/src/shared/lib/amp.ts @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import { AmpStateContext } from './amp-context.shared-runtime' import { isInAmpMode } from './amp-mode' diff --git a/packages/next/src/shared/lib/app-dynamic.tsx b/packages/next/src/shared/lib/app-dynamic.tsx index 6c18d6ab151d4..651e2dd1ffe5d 100644 --- a/packages/next/src/shared/lib/app-dynamic.tsx +++ b/packages/next/src/shared/lib/app-dynamic.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import Loadable from './lazy-dynamic/loadable' import type { diff --git a/packages/next/src/shared/lib/app-router-context.shared-runtime.ts b/packages/next/src/shared/lib/app-router-context.shared-runtime.ts index 93bb4ca090999..3bb5b14b7ef83 100644 --- a/packages/next/src/shared/lib/app-router-context.shared-runtime.ts +++ b/packages/next/src/shared/lib/app-router-context.shared-runtime.ts @@ -7,7 +7,7 @@ import type { } from '../../client/components/router-reducer/router-reducer-types' import type { FetchServerResponseResult } from '../../client/components/router-reducer/fetch-server-response' import type { FlightRouterState } from '../../server/app-render/types' -import React from 'next/dist/compiled/react' +import React from 'react' export type ChildSegmentMap = Map diff --git a/packages/next/src/shared/lib/dynamic.tsx b/packages/next/src/shared/lib/dynamic.tsx index b5e52e18d8c1f..ae099f6904c95 100644 --- a/packages/next/src/shared/lib/dynamic.tsx +++ b/packages/next/src/shared/lib/dynamic.tsx @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import Loadable from './loadable.shared-runtime' const isServerSide = typeof window === 'undefined' diff --git a/packages/next/src/shared/lib/head-manager-context.shared-runtime.ts b/packages/next/src/shared/lib/head-manager-context.shared-runtime.ts index f640ceb03041d..f301086cd8ca2 100644 --- a/packages/next/src/shared/lib/head-manager-context.shared-runtime.ts +++ b/packages/next/src/shared/lib/head-manager-context.shared-runtime.ts @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' export const HeadManagerContext: React.Context<{ updateHead?: (state: any) => void diff --git a/packages/next/src/shared/lib/head.tsx b/packages/next/src/shared/lib/head.tsx index 3716ebb47a301..42f95767bfa4c 100644 --- a/packages/next/src/shared/lib/head.tsx +++ b/packages/next/src/shared/lib/head.tsx @@ -1,6 +1,6 @@ 'use client' -import React, { useContext } from 'next/dist/compiled/react' +import React, { useContext } from 'react' import Effect from './side-effect' import { AmpStateContext } from './amp-context.shared-runtime' import { HeadManagerContext } from './head-manager-context.shared-runtime' diff --git a/packages/next/src/shared/lib/hooks-client-context.shared-runtime.ts b/packages/next/src/shared/lib/hooks-client-context.shared-runtime.ts index c1be27625cccb..deba78ddf9bc6 100644 --- a/packages/next/src/shared/lib/hooks-client-context.shared-runtime.ts +++ b/packages/next/src/shared/lib/hooks-client-context.shared-runtime.ts @@ -1,6 +1,6 @@ 'use client' -import { createContext } from 'next/dist/compiled/react' +import { createContext } from 'react' import type { Params } from '../../shared/lib/router/utils/route-matcher' export const SearchParamsContext = createContext(null) diff --git a/packages/next/src/shared/lib/html-context.shared-runtime.ts b/packages/next/src/shared/lib/html-context.shared-runtime.ts index a57321f6e07e8..7b36d909e7a5e 100644 --- a/packages/next/src/shared/lib/html-context.shared-runtime.ts +++ b/packages/next/src/shared/lib/html-context.shared-runtime.ts @@ -5,7 +5,7 @@ import type { FontConfig } from '../../server/font-utils' import type { NextFontManifest } from '../../build/webpack/plugins/next-font-manifest-plugin' import type { DeepReadonly } from './deep-readonly' -import { createContext, useContext } from 'next/dist/compiled/react' +import { createContext, useContext } from 'react' export type HtmlProps = { __NEXT_DATA__: NEXT_DATA diff --git a/packages/next/src/shared/lib/image-config-context.shared-runtime.ts b/packages/next/src/shared/lib/image-config-context.shared-runtime.ts index 4e8db1da118f4..d7c3409da7cf2 100644 --- a/packages/next/src/shared/lib/image-config-context.shared-runtime.ts +++ b/packages/next/src/shared/lib/image-config-context.shared-runtime.ts @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import type { ImageConfigComplete } from './image-config' import { imageConfigDefault } from './image-config' diff --git a/packages/next/src/shared/lib/lazy-dynamic/dynamic-bailout-to-csr.tsx b/packages/next/src/shared/lib/lazy-dynamic/dynamic-bailout-to-csr.tsx index 20a6223a71271..dcb1ed1d8d741 100644 --- a/packages/next/src/shared/lib/lazy-dynamic/dynamic-bailout-to-csr.tsx +++ b/packages/next/src/shared/lib/lazy-dynamic/dynamic-bailout-to-csr.tsx @@ -1,6 +1,6 @@ 'use client' -import type { ReactElement } from 'next/dist/compiled/react' +import type { ReactElement } from 'react' import { BailoutToCSRError } from './bailout-to-csr' interface BailoutToCSRProps { diff --git a/packages/next/src/shared/lib/lazy-dynamic/loadable.tsx b/packages/next/src/shared/lib/lazy-dynamic/loadable.tsx index d3d13539964a2..1aa448a61e366 100644 --- a/packages/next/src/shared/lib/lazy-dynamic/loadable.tsx +++ b/packages/next/src/shared/lib/lazy-dynamic/loadable.tsx @@ -1,4 +1,4 @@ -import { Suspense, lazy } from 'next/dist/compiled/react' +import { Suspense, lazy } from 'react' import { BailoutToCSR } from './dynamic-bailout-to-csr' import type { ComponentModule } from './types' import { PreloadCss } from './preload-css' diff --git a/packages/next/src/shared/lib/loadable-context.shared-runtime.ts b/packages/next/src/shared/lib/loadable-context.shared-runtime.ts index 1ec53ce1a137b..c449b61d3ee96 100644 --- a/packages/next/src/shared/lib/loadable-context.shared-runtime.ts +++ b/packages/next/src/shared/lib/loadable-context.shared-runtime.ts @@ -1,6 +1,6 @@ 'use client' -import React from 'next/dist/compiled/react' +import React from 'react' type CaptureFn = (moduleName: string) => void diff --git a/packages/next/src/shared/lib/loadable.shared-runtime.tsx b/packages/next/src/shared/lib/loadable.shared-runtime.tsx index dda966a68c29b..82ba84182701f 100644 --- a/packages/next/src/shared/lib/loadable.shared-runtime.tsx +++ b/packages/next/src/shared/lib/loadable.shared-runtime.tsx @@ -22,7 +22,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE // https://github.com/jamiebuilds/react-loadable/blob/v5.5.0/src/index.js // Modified to be compatible with webpack 4 / Next.js -import React from 'next/dist/compiled/react' +import React from 'react' import { LoadableContext } from './loadable-context.shared-runtime' function resolve(obj: any) { diff --git a/packages/next/src/shared/lib/router-context.shared-runtime.ts b/packages/next/src/shared/lib/router-context.shared-runtime.ts index a710f017ae915..4a9d9a575b898 100644 --- a/packages/next/src/shared/lib/router-context.shared-runtime.ts +++ b/packages/next/src/shared/lib/router-context.shared-runtime.ts @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' import type { NextRouter } from './router/router' export const RouterContext = React.createContext(null) diff --git a/packages/next/src/shared/lib/router/action-queue.ts b/packages/next/src/shared/lib/router/action-queue.ts index 7d6c0b7a594ce..966b3cec083e9 100644 --- a/packages/next/src/shared/lib/router/action-queue.ts +++ b/packages/next/src/shared/lib/router/action-queue.ts @@ -10,7 +10,7 @@ import { } from '../../../client/components/router-reducer/router-reducer-types' import type { ReduxDevToolsInstance } from '../../../client/components/use-reducer-with-devtools' import { reducer } from '../../../client/components/router-reducer/router-reducer' -import React, { startTransition } from 'next/dist/compiled/react' +import React, { startTransition } from 'react' export type DispatchStatePromise = React.Dispatch diff --git a/packages/next/src/shared/lib/router/adapters.tsx b/packages/next/src/shared/lib/router/adapters.tsx index cac07e58723b2..650f7deeabc9f 100644 --- a/packages/next/src/shared/lib/router/adapters.tsx +++ b/packages/next/src/shared/lib/router/adapters.tsx @@ -2,7 +2,7 @@ import type { AppRouterInstance } from '../app-router-context.shared-runtime' import type { Params } from './utils/route-matcher' import type { NextRouter } from './router' -import React, { useMemo, useRef } from 'next/dist/compiled/react' +import React, { useMemo, useRef } from 'react' import { PathnameContext } from '../hooks-client-context.shared-runtime' import { isDynamicRoute } from './utils' import { asPathToSearchParams } from './utils/as-path-to-search-params' diff --git a/packages/next/src/shared/lib/router/router.ts b/packages/next/src/shared/lib/router/router.ts index e0e7bfb42b687..5e4ffceaee7fa 100644 --- a/packages/next/src/shared/lib/router/router.ts +++ b/packages/next/src/shared/lib/router/router.ts @@ -1,5 +1,5 @@ // tslint:disable:no-console -import type { ComponentType } from 'next/dist/compiled/react' +import type { ComponentType } from 'react' import type { DomainLocale } from '../../../server/config' import type { MittEmitter } from '../mitt' import type { ParsedUrlQuery } from 'querystring' diff --git a/packages/next/src/shared/lib/server-inserted-html.shared-runtime.tsx b/packages/next/src/shared/lib/server-inserted-html.shared-runtime.tsx index 53832ecc49a18..c095e18150088 100644 --- a/packages/next/src/shared/lib/server-inserted-html.shared-runtime.tsx +++ b/packages/next/src/shared/lib/server-inserted-html.shared-runtime.tsx @@ -1,13 +1,13 @@ 'use client' -import React, { useContext } from 'next/dist/compiled/react' +import React, { useContext } from 'react' export type ServerInsertedHTMLHook = (callbacks: () => React.ReactNode) => void // Use `React.createContext` to avoid errors from the RSC checks because // it can't be imported directly in Server Components: // -// import { createContext } from 'next/dist/compiled/react' +// import { createContext } from 'react' // // More info: https://github.com/vercel/next.js/pull/40686 export const ServerInsertedHTMLContext = diff --git a/packages/next/src/shared/lib/side-effect.tsx b/packages/next/src/shared/lib/side-effect.tsx index 121b565e620e1..aaa85a1db4f66 100644 --- a/packages/next/src/shared/lib/side-effect.tsx +++ b/packages/next/src/shared/lib/side-effect.tsx @@ -1,5 +1,5 @@ -import type React from 'next/dist/compiled/react' -import { Children, useEffect, useLayoutEffect } from 'next/dist/compiled/react' +import type React from 'react' +import { Children, useEffect, useLayoutEffect } from 'react' type State = JSX.Element[] | undefined diff --git a/packages/next/src/shared/lib/utils.ts b/packages/next/src/shared/lib/utils.ts index a164e3f9fe741..6e82f21f8e80b 100644 --- a/packages/next/src/shared/lib/utils.ts +++ b/packages/next/src/shared/lib/utils.ts @@ -1,5 +1,5 @@ import type { HtmlProps } from './html-context.shared-runtime' -import type { ComponentType } from 'next/dist/compiled/react' +import type { ComponentType } from 'react' import type { DomainLocale } from '../../server/config' import type { Env } from '@next/env' import type { IncomingMessage, ServerResponse } from 'http' diff --git a/packages/next/src/types.ts b/packages/next/src/types.ts index 0ad148624dd68..2a375309a0f69 100644 --- a/packages/next/src/types.ts +++ b/packages/next/src/types.ts @@ -7,7 +7,7 @@ import type { Agent as HttpAgent } from 'http' import type { Agent as HttpsAgent } from 'https' -import type React from 'next/dist/compiled/react' +import type React from 'react' import type { ParsedUrlQuery } from 'querystring' import type { IncomingMessage, ServerResponse } from 'http' diff --git a/packages/next/types/$$compiled.internal.d.ts b/packages/next/types/$$compiled.internal.d.ts index fae945d5faf35..17dd16aa9d1d6 100644 --- a/packages/next/types/$$compiled.internal.d.ts +++ b/packages/next/types/$$compiled.internal.d.ts @@ -66,7 +66,7 @@ declare module 'next/dist/compiled/jest-worker' { } declare module 'next/dist/compiled/react-is' { - export * from 'next/dist/compiled/react-is' + export * from 'react-is' } declare module 'next/dist/compiled/cssnano-simple' { @@ -355,11 +355,11 @@ declare module 'next/dist/compiled/@edge-runtime/primitives' { } declare module 'next/dist/compiled/react' { - import * as m from 'next/dist/compiled/react' + import * as m from 'react' export = m } declare module 'next/dist/compiled/react-dom' { - import * as m from 'next/dist/compiled/react-dom' + import * as m from 'react-dom' export = m } diff --git a/packages/next/types/react.d.ts b/packages/next/types/react.d.ts index ea14b1def3bd7..009c63ea878eb 100644 --- a/packages/next/types/react.d.ts +++ b/packages/next/types/react.d.ts @@ -1,4 +1,4 @@ -import React from 'next/dist/compiled/react' +import React from 'react' declare module 'react' { export function unstable_postpone(reason: string): never