From abc0a2c6e0a90b840ea618e41a1de073b198d810 Mon Sep 17 00:00:00 2001 From: Josh Story Date: Mon, 28 Aug 2023 11:57:51 -0700 Subject: [PATCH] Implements module preinitialization for SSR when using turbopack --- packages/next-swc/crates/next-api/src/app.rs | 1 + .../js/src/build/client/app-bootstrap.ts | 1 - .../js/src/build/client/app-turbopack.ts | 6 -- .../next-core/js/src/entry/app-renderer.tsx | 8 +-- .../js/src/entry/app/edge-page-bootstrap.ts | 8 +-- .../next-core/js/src/entry/app/hydrate.tsx | 8 +-- .../next-core/js/src/entry/app/manifest.ts | 8 --- .../next-core/js/types/compiled-next.d.ts | 1 + .../crates/next-core/js/types/globals.d.ts | 2 - .../crates/next-core/src/app_source.rs | 4 +- .../crates/next-core/src/next_import_map.rs | 67 ++++++++++++++++--- .../client_reference_manifest.rs | 2 + .../next-core/src/next_manifests/mod.rs | 8 +++ packages/next/src/client/app-turbopack.ts | 13 ---- .../group-stack-frames-by-framework.ts | 2 +- .../src/server/lib/router-utils/setup-dev.ts | 6 ++ packages/next/src/server/require-hook.ts | 31 +++++++++ packages/next/taskfile.js | 32 ++++++++- packages/next/types/misc.d.ts | 7 ++ 19 files changed, 148 insertions(+), 67 deletions(-) delete mode 100644 packages/next-swc/crates/next-core/js/src/build/client/app-turbopack.ts diff --git a/packages/next-swc/crates/next-api/src/app.rs b/packages/next-swc/crates/next-api/src/app.rs index 12ed8e54988795..64eafcd9ef627a 100644 --- a/packages/next-swc/crates/next-api/src/app.rs +++ b/packages/next-swc/crates/next-api/src/app.rs @@ -207,6 +207,7 @@ impl AppProject { "next-dynamic".to_string(), Vc::upcast(NextDynamicTransition::new(self.client_transition())), ), + ("next-ssr".to_string(), Vc::upcast(self.ssr_transition())), ] .into_iter() .collect(); diff --git a/packages/next-swc/crates/next-core/js/src/build/client/app-bootstrap.ts b/packages/next-swc/crates/next-core/js/src/build/client/app-bootstrap.ts index f90eb3a996e57f..040f2b66893806 100644 --- a/packages/next-swc/crates/next-core/js/src/build/client/app-bootstrap.ts +++ b/packages/next-swc/crates/next-core/js/src/build/client/app-bootstrap.ts @@ -6,7 +6,6 @@ import '../shims' import { appBootstrap } from 'next/dist/client/app-bootstrap' appBootstrap(() => { - require('./app-turbopack') const { hydrate } = require('./app-index') hydrate() }) diff --git a/packages/next-swc/crates/next-core/js/src/build/client/app-turbopack.ts b/packages/next-swc/crates/next-core/js/src/build/client/app-turbopack.ts deleted file mode 100644 index c1a4011904f99d..00000000000000 --- a/packages/next-swc/crates/next-core/js/src/build/client/app-turbopack.ts +++ /dev/null @@ -1,6 +0,0 @@ -// eslint-disable-next-line no-undef -self.__next_require__ = __turbopack_require__ - -// @ts-ignore -// eslint-disable-next-line no-undef -;(self as any).__next_chunk_load__ = __turbopack_load__ diff --git a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx index 951f91570d92d9..cb785b1c1ae928 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx +++ b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx @@ -18,13 +18,11 @@ import { PassThrough } from 'node:stream' import entry from 'APP_ENTRY' import BOOTSTRAP from 'APP_BOOTSTRAP' import { createServerResponse } from '../internal/http' -import { createManifests, installRequireAndChunkLoad } from './app/manifest' +import { createManifests } from './app/manifest' import { join } from 'node:path' import { nodeFs } from 'next/dist/server/lib/node-fs-methods' import { IncrementalCache } from 'next/dist/server/lib/incremental-cache' -installRequireAndChunkLoad() - const MIME_TEXT_HTML_UTF8 = 'text/html; charset=utf-8' startOperationStreamHandler(async (renderData: RenderData, respond) => { @@ -88,10 +86,6 @@ async function runOperation(renderData: RenderData) { }, ComponentMod: { ...entry, - __next_app__: { - require: __next_require__, - loadChunk: __next_chunk_load__, - }, pages: ['page.js'], }, incrementalCache: new IncrementalCache({ diff --git a/packages/next-swc/crates/next-core/js/src/entry/app/edge-page-bootstrap.ts b/packages/next-swc/crates/next-core/js/src/entry/app/edge-page-bootstrap.ts index 3d35d550dc0672..f50dfd5cf94a23 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app/edge-page-bootstrap.ts +++ b/packages/next-swc/crates/next-core/js/src/entry/app/edge-page-bootstrap.ts @@ -5,13 +5,11 @@ import { renderToHTMLOrFlight } from 'next/dist/server/app-render/app-render' ;('TURBOPACK { chunking-type: isolatedParallel }') import entry from 'APP_ENTRY' import BOOTSTRAP from 'APP_BOOTSTRAP' -import { createManifests, installRequireAndChunkLoad } from './manifest' +import { createManifests } from './manifest' import type { NextRequest, NextFetchEvent } from 'next/server' import type { RenderOpts } from 'next/dist/server/app-render/types' import type { ParsedUrlQuery } from 'querystring' -installRequireAndChunkLoad() - // avoid limiting stack traces to 10 lines Error.stackTraceLimit = 100 @@ -43,10 +41,6 @@ async function render(request: NextRequest, event: NextFetchEvent) { }, ComponentMod: { ...entry, - __next_app__: { - require: __next_require__, - loadChunk: __next_chunk_load__, - }, pages: ['page.js'], }, clientReferenceManifest, diff --git a/packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx b/packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx index abdf23d0fd7d3a..66f3f9527bea3e 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx +++ b/packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx @@ -2,7 +2,7 @@ import ReactDOMClient from 'react-dom/client' import React, { use } from 'react' import type { ReactElement } from 'react' import { version } from 'next/package.json' -import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-webpack/client' +import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-turbopack/client' import { callServer } from 'next/dist/client/app-call-server' import { linkGc } from 'next/dist/client/app-link-gc' @@ -19,12 +19,6 @@ window.next = { appDir: true, } -globalThis.__next_require__ = (data) => { - const [client_id] = JSON.parse(data) - return __turbopack_require__(client_id) -} -globalThis.__next_chunk_load__ = __turbopack_load__ - const appElement = document const getCacheKey = () => { diff --git a/packages/next-swc/crates/next-core/js/src/entry/app/manifest.ts b/packages/next-swc/crates/next-core/js/src/entry/app/manifest.ts index 2a9fd68517390e..d7e2ad6045abd4 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app/manifest.ts +++ b/packages/next-swc/crates/next-core/js/src/entry/app/manifest.ts @@ -114,11 +114,3 @@ export function createManifests() { return { clientReferenceManifest } } - -export function installRequireAndChunkLoad() { - globalThis.__next_require__ = (data) => { - const [, , ssr_id] = JSON.parse(data) - return __turbopack_require__(ssr_id) - } - globalThis.__next_chunk_load__ = () => Promise.resolve() -} diff --git a/packages/next-swc/crates/next-core/js/types/compiled-next.d.ts b/packages/next-swc/crates/next-core/js/types/compiled-next.d.ts index bc9f894f61ea4d..bae9caaa7cab05 100644 --- a/packages/next-swc/crates/next-core/js/types/compiled-next.d.ts +++ b/packages/next-swc/crates/next-core/js/types/compiled-next.d.ts @@ -1 +1,2 @@ declare module 'next/dist/compiled/react-server-dom-webpack/client' +declare module 'next/dist/compiled/react-server-dom-turbopack/client' diff --git a/packages/next-swc/crates/next-core/js/types/globals.d.ts b/packages/next-swc/crates/next-core/js/types/globals.d.ts index ecc0cb85966b7e..9d44d77e7f4538 100644 --- a/packages/next-swc/crates/next-core/js/types/globals.d.ts +++ b/packages/next-swc/crates/next-core/js/types/globals.d.ts @@ -8,8 +8,6 @@ declare global { var __webpack_public_path__: string | undefined var __DEV_MIDDLEWARE_MATCHERS: any[] - var __next_require__: (id: string) => any - var __next_chunk_load__: (id: string) => Promise var __next_f: ( | [isBootStrap: 0] | [isNotBootstrap: 1, responsePartial: string] diff --git a/packages/next-swc/crates/next-core/src/app_source.rs b/packages/next-swc/crates/next-core/src/app_source.rs index e5af263c3d6bdf..196217cc8d58ac 100644 --- a/packages/next-swc/crates/next-core/src/app_source.rs +++ b/packages/next-swc/crates/next-core/src/app_source.rs @@ -974,6 +974,8 @@ impl AppRenderer { const { GlobalError } = GlobalErrorMod; \"TURBOPACK { chunking-type: isolatedParallel; transition: next-edge-server-component }\"; import base from \"next/dist/server/app-render/entry-base\"\n + \"TURBOPACK { chunking-type: isolatedParallel; transition: next-ssr }\"; + import baseSsr from \"next/dist/server/app-render/entry-base-ssr\"\n "}); for import in loader_tree_module.imports { @@ -990,7 +992,7 @@ impl AppRenderer { result, // Need this hack because "export *" from CommonJS will trigger a warning // otherwise - "__turbopack_export_value__({{ tree, GlobalError, pathname, ...base }});\n" + "__turbopack_export_value__({{ tree, GlobalError, pathname, ...base, ...baseSsr }});\n" )?; let file = File::from(result.build()); diff --git a/packages/next-swc/crates/next-core/src/next_import_map.rs b/packages/next-swc/crates/next-core/src/next_import_map.rs index e05ac926c139f6..cba1d784f4d2d9 100644 --- a/packages/next-swc/crates/next-core/src/next_import_map.rs +++ b/packages/next-swc/crates/next-core/src/next_import_map.rs @@ -89,6 +89,14 @@ pub async fn get_next_client_import_map( ); } ClientContextType::App { app_dir } => { + import_map.insert_exact_alias( + "server-only", + request_to_import_mapping(app_dir, "next/dist/compiled/server-only"), + ); + import_map.insert_exact_alias( + "client-only", + request_to_import_mapping(app_dir, "next/dist/compiled/client-only"), + ); import_map.insert_exact_alias( "react", request_to_import_mapping(app_dir, "next/dist/compiled/react"), @@ -107,7 +115,10 @@ pub async fn get_next_client_import_map( ); import_map.insert_wildcard_alias( "react-server-dom-webpack/", - request_to_import_mapping(app_dir, "next/dist/compiled/react-server-dom-webpack/*"), + request_to_import_mapping( + app_dir, + "next/dist/compiled/react-server-dom-turbopack/*", + ), ); import_map.insert_exact_alias( "next/dynamic", @@ -228,7 +239,10 @@ pub async fn get_next_server_import_map( import_map.insert_wildcard_alias("react-dom/", external); import_map.insert_exact_alias("styled-jsx", external); import_map.insert_wildcard_alias("styled-jsx/", external); - import_map.insert_exact_alias("react-server-dom-webpack/", external); + import_map.insert_exact_alias( + "react-server-dom-webpack/", + ImportMapping::External(Some("react-server-dom-turbopack".into())).cell(), + ); } ServerContextType::AppSSR { .. } | ServerContextType::AppRSC { .. } @@ -446,7 +460,10 @@ async fn insert_next_server_special_aliases( ); import_map.insert_wildcard_alias( "react-server-dom-webpack/", - request_to_import_mapping(app_dir, "next/dist/compiled/react-server-dom-webpack/*"), + request_to_import_mapping( + app_dir, + "next/dist/compiled/react-server-dom-turbopack/*", + ), ); } // NOTE(alexkirsz) This logic maps loosely to @@ -469,6 +486,14 @@ async fn insert_next_server_special_aliases( // @opentelemetry/api request_to_import_mapping(app_dir, "next/dist/compiled/@opentelemetry/api"), ); + import_map.insert_exact_alias( + "server-only", + request_to_import_mapping(app_dir, "next/dist/compiled/server-only"), + ); + import_map.insert_exact_alias( + "client-only", + request_to_import_mapping(app_dir, "next/dist/compiled/client-only"), + ); import_map.insert_exact_alias( "react", request_to_import_mapping(app_dir, "next/dist/compiled/react/react.shared-subset"), @@ -485,7 +510,7 @@ async fn insert_next_server_special_aliases( ("react-dom/", "next/dist/compiled/react-dom/*"), ( "react-server-dom-webpack/", - "next/dist/compiled/react-server-dom-webpack/*", + "next/dist/compiled/react-server-dom-turbopack/*", ), ] { import_map.insert_wildcard_alias( @@ -496,12 +521,21 @@ async fn insert_next_server_special_aliases( } // ## SSR // - // * always uses externals, to ensure we're using the same React instance as the Next.js - // runtime + // * uses externals (except for react-server-dom-turbopack), to ensure we're using the same + // React instance as the Next.js runtime // * maps react-dom -> react-dom/server-rendering-stub - // * passes through react and (react|react-dom|react-server-dom-webpack)/(.*) to + // * maps react-server-dom-webpack -> react-server-dom-turbopack + // * passes through react and (react|react-dom|react-server-dom-turbopack)/(.*) to // next/dist/compiled/react and next/dist/compiled/$1/$2 resp. (NextMode::Build | NextMode::Development, ServerContextType::AppSSR { app_dir }) => { + import_map.insert_exact_alias( + "server-only", + request_to_import_mapping(app_dir, "next/dist/compiled/server-only"), + ); + import_map.insert_exact_alias( + "client-only", + request_to_import_mapping(app_dir, "next/dist/compiled/client-only"), + ); import_map.insert_exact_alias( "react", external_if_node(app_dir, "next/dist/compiled/react"), @@ -514,13 +548,24 @@ async fn insert_next_server_special_aliases( ), ); + // The react-server-dom-webpack mappings are intended to be bundled in every + // environment. These imports contain references to magic globals + // for bundlers that need to be processed by that bundler to work effectively + import_map.insert_exact_alias( + "react-server-dom-webpack", + request_to_import_mapping(app_dir, "next/dist/compiled/react-server-dom-turbopack"), + ); + import_map.insert_wildcard_alias( + "react-server-dom-webpack/", + request_to_import_mapping( + app_dir, + "next/dist/compiled/react-server-dom-turbopack/*", + ), + ); + for (wildcard_alias, request) in [ ("react/", "next/dist/compiled/react/*"), ("react-dom/", "next/dist/compiled/react-dom/*"), - ( - "react-server-dom-webpack/", - "next/dist/compiled/react-server-dom-webpack/*", - ), ] { let import_mapping = external_if_node(app_dir, request); import_map.insert_wildcard_alias(wildcard_alias, import_mapping); diff --git a/packages/next-swc/crates/next-core/src/next_manifests/client_reference_manifest.rs b/packages/next-swc/crates/next-core/src/next_manifests/client_reference_manifest.rs index 4458410d021983..800f6b2c2a8d4c 100644 --- a/packages/next-swc/crates/next-core/src/next_manifests/client_reference_manifest.rs +++ b/packages/next-swc/crates/next-core/src/next_manifests/client_reference_manifest.rs @@ -32,6 +32,8 @@ impl ClientReferenceManifest { ssr_chunking_context: Vc>, ) -> Result>> { let mut entry_manifest: ClientReferenceManifest = Default::default(); + entry_manifest.module_loading.prefix = "/_next/".to_string(); + entry_manifest.module_loading.cross_origin = None; let client_references_chunks = client_references_chunks.await?; let client_relative_path = client_relative_path.await?; let node_root_ref = node_root.await?; diff --git a/packages/next-swc/crates/next-core/src/next_manifests/mod.rs b/packages/next-swc/crates/next-core/src/next_manifests/mod.rs index 8f2ea09fea763f..dbfccf986dfdd8 100644 --- a/packages/next-swc/crates/next-core/src/next_manifests/mod.rs +++ b/packages/next-swc/crates/next-core/src/next_manifests/mod.rs @@ -178,6 +178,7 @@ pub enum ActionManifestWorkerEntry { #[derive(Serialize, Default, Debug)] #[serde(rename_all = "camelCase")] pub struct ClientReferenceManifest { + pub module_loading: ModuleLoading, /// Mapping of module path and export name to client module ID and required /// client chunks. pub client_modules: ManifestNode, @@ -192,6 +193,13 @@ pub struct ClientReferenceManifest { pub entry_css_files: HashMap>, } +#[derive(Serialize, Default, Debug)] +#[serde(rename_all = "camelCase")] +pub struct ModuleLoading { + pub prefix: String, + pub cross_origin: Option, +} + #[derive(Serialize, Default, Debug)] #[serde(rename_all = "camelCase")] pub struct ManifestNode { diff --git a/packages/next/src/client/app-turbopack.ts b/packages/next/src/client/app-turbopack.ts index afa25fd2c5ed82..e69de29bb2d1d6 100644 --- a/packages/next/src/client/app-turbopack.ts +++ b/packages/next/src/client/app-turbopack.ts @@ -1,13 +0,0 @@ -declare let __turbopack_require__: any - -// @ts-expect-error -process.env.__NEXT_NEW_LINK_BEHAVIOR = true - -// eslint-disable-next-line no-undef -;(self as any).__next_require__ = __turbopack_require__ - -// @ts-ignore -// eslint-disable-next-line no-undef -;(self as any).__next_chunk_load__ = __turbopack_load__ - -export {} diff --git a/packages/next/src/client/components/react-dev-overlay/internal/helpers/group-stack-frames-by-framework.ts b/packages/next/src/client/components/react-dev-overlay/internal/helpers/group-stack-frames-by-framework.ts index 8d689617a54822..c8e39cc8ae81be 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/helpers/group-stack-frames-by-framework.ts +++ b/packages/next/src/client/components/react-dev-overlay/internal/helpers/group-stack-frames-by-framework.ts @@ -14,7 +14,7 @@ function getFramework( if (!sourcePackage) return undefined if ( - /^(react|react-dom|react-is|react-refresh|react-server-dom-webpack|scheduler)$/.test( + /^(react|react-dom|react-is|react-refresh|react-server-dom-webpack|react-server-dom-turbopack|scheduler)$/.test( sourcePackage ) ) { diff --git a/packages/next/src/server/lib/router-utils/setup-dev.ts b/packages/next/src/server/lib/router-utils/setup-dev.ts index 24b8a095d113e8..d84a5b8d8fd105 100644 --- a/packages/next/src/server/lib/router-utils/setup-dev.ts +++ b/packages/next/src/server/lib/router-utils/setup-dev.ts @@ -303,10 +303,16 @@ async function startWatcher(opts: SetupOpts) { require.resolve( 'next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js' ), + require.resolve( + 'next/dist/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js' + ), // And this redirecting module as well require.resolve( 'next/dist/compiled/react-server-dom-webpack/client.edge.js' ), + require.resolve( + 'next/dist/compiled/react-server-dom-turbopack/client.edge.js' + ), ]) ) diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 1f53b3b479109c..a0bb3401dc2fbf 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -44,6 +44,14 @@ export const baseOverrides = { 'next/dist/compiled/react-server-dom-webpack/server.edge', 'react-server-dom-webpack/server.node': 'next/dist/compiled/react-server-dom-webpack/server.node', + 'react-server-dom-turbopack/client': + 'next/dist/compiled/react-server-dom-turbopack/client', + 'react-server-dom-turbopack/client.edge': + 'next/dist/compiled/react-server-dom-turbopack/client.edge', + 'react-server-dom-turbopack/server.edge': + 'next/dist/compiled/react-server-dom-turbopack/server.edge', + 'react-server-dom-turbopack/server.node': + 'next/dist/compiled/react-server-dom-turbopack/server.node', } export const experimentalOverrides = { @@ -70,6 +78,14 @@ export const experimentalOverrides = { 'next/dist/compiled/react-server-dom-webpack-experimental/server.edge', 'react-server-dom-webpack/server.node': 'next/dist/compiled/react-server-dom-webpack-experimental/server.node', + 'react-server-dom-turbopack/client': + 'next/dist/compiled/react-server-dom-turbopack-experimental/client', + 'react-server-dom-turbopack/client.edge': + 'next/dist/compiled/react-server-dom-turbopack-experimental/client.edge', + 'react-server-dom-turbopack/server.edge': + 'next/dist/compiled/react-server-dom-turbopack-experimental/server.edge', + 'react-server-dom-turbopack/server.node': + 'next/dist/compiled/react-server-dom-turbopack-experimental/server.node', } export function addHookAliases(aliases: [string, string][] = []) { @@ -95,6 +111,21 @@ function overrideReact() { addHookAliases(toResolveMap(baseOverrides)) } } + + if (process.env.TURBOPACK || process.env.EXPERIMENTAL_TURBOPACK) { + addHookAliases( + toResolveMap({ + 'react-server-dom-webpack/client': + 'next/dist/compiled/react-server-dom-turbopack/client', + 'react-server-dom-webpack/client.edge': + 'next/dist/compiled/react-server-dom-turbopack/client.edge', + 'react-server-dom-webpack/server.edge': + 'next/dist/compiled/react-server-dom-turbopack/server.edge', + 'react-server-dom-webpack/server.node': + 'next/dist/compiled/react-server-dom-turbopack/server.node', + }) + ) + } } overrideReact() diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index 232f0bb530fc49..647b8bf81fc155 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -1806,17 +1806,17 @@ export async function copy_vendor_react(task_) { // react-server-dom-webpack // Currently, this `next` and `experimental` channels are always in sync so // we can use the same version for both. - const reactServerDomDir = dirname( + const reactServerDomWebpackDir = dirname( relative( __dirname, require.resolve(`react-server-dom-webpack${packageSuffix}/package.json`) ) ) yield task - .source(join(reactServerDomDir, 'LICENSE')) + .source(join(reactServerDomWebpackDir, 'LICENSE')) .target(`src/compiled/react-server-dom-webpack${packageSuffix}`) yield task - .source(join(reactServerDomDir, '{package.json,*.js,cjs/**/*.js}')) + .source(join(reactServerDomWebpackDir, '{package.json,*.js,cjs/**/*.js}')) // eslint-disable-next-line require-yield .run({ every: true }, function* (file) { if (file.base === 'package.json') { @@ -1824,6 +1824,32 @@ export async function copy_vendor_react(task_) { } }) .target(`src/compiled/react-server-dom-webpack${packageSuffix}`) + + // react-server-dom-turbopack + // Currently, this `next` and `experimental` channels are always in sync so + // we can use the same version for both. + const reactServerDomTurbopackDir = dirname( + relative( + __dirname, + require.resolve( + `react-server-dom-turbopack${packageSuffix}/package.json` + ) + ) + ) + yield task + .source(join(reactServerDomTurbopackDir, 'LICENSE')) + .target(`src/compiled/react-server-dom-turbopack${packageSuffix}`) + yield task + .source( + join(reactServerDomTurbopackDir, '{package.json,*.js,cjs/**/*.js}') + ) + // eslint-disable-next-line require-yield + .run({ every: true }, function* (file) { + if (file.base === 'package.json') { + file.data = overridePackageName(file.data) + } + }) + .target(`src/compiled/react-server-dom-turbopack${packageSuffix}`) } // As taskr transpiles async functions into generators, to reuse the same logic diff --git a/packages/next/types/misc.d.ts b/packages/next/types/misc.d.ts index b22d2bd2957eee..346fae75fb2263 100644 --- a/packages/next/types/misc.d.ts +++ b/packages/next/types/misc.d.ts @@ -15,6 +15,11 @@ declare module 'next/dist/compiled/react-server-dom-webpack/client.edge' declare module 'next/dist/compiled/react-server-dom-webpack/client.browser' declare module 'next/dist/compiled/react-server-dom-webpack/server.browser' declare module 'next/dist/compiled/react-server-dom-webpack/server.edge' +declare module 'next/dist/compiled/react-server-dom-turbopack/client' +declare module 'next/dist/compiled/react-server-dom-turbopack/client.edge' +declare module 'next/dist/compiled/react-server-dom-turbopack/client.browser' +declare module 'next/dist/compiled/react-server-dom-turbopack/server.browser' +declare module 'next/dist/compiled/react-server-dom-turbopack/server.edge' declare module 'next/dist/client/app-call-server' declare module 'next/dist/compiled/react-dom/server' declare module 'next/dist/compiled/react-dom/server.edge' @@ -22,6 +27,8 @@ declare module 'next/dist/compiled/react-dom/server.browser' declare module 'next/dist/compiled/browserslist' declare module 'react-server-dom-webpack/client' declare module 'react-server-dom-webpack/server.edge' +declare module 'react-server-dom-turbopack/client' +declare module 'react-server-dom-turbopack/server.edge' declare module 'react-dom/server.browser' declare module 'react-dom/server.edge'