Skip to content

Commit aeaf335

Browse files
committed
Nits to fix tests after rebasing
1 parent cc96b43 commit aeaf335

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

packages/next-swc/crates/next-core/src/next_import_map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,6 @@ pub async fn get_next_server_import_map(
249249
import_map.insert_wildcard_alias("react-dom/", external);
250250
import_map.insert_exact_alias("styled-jsx", external);
251251
import_map.insert_wildcard_alias("styled-jsx/", external);
252-
import_map.insert_exact_alias(
253-
"react-server-dom-webpack/",
254-
ImportMapping::External(Some("react-server-dom-turbopack".into())).cell(),
255-
);
256252
// TODO: we should not bundle next/dist/build/utils in the pages renderer at all
257253
import_map.insert_wildcard_alias("next/dist/build/utils", external);
258254
}
@@ -267,6 +263,10 @@ pub async fn get_next_server_import_map(
267263
"next/dynamic",
268264
request_to_import_mapping(project_path, "next/dist/shared/lib/app-dynamic"),
269265
);
266+
import_map.insert_exact_alias(
267+
"react-server-dom-webpack/",
268+
ImportMapping::External(Some("react-server-dom-turbopack".into())).cell(),
269+
);
270270
}
271271
ServerContextType::Middleware => {}
272272
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { appBootstrap } from './app-bootstrap'
22

33
appBootstrap(() => {
4+
// This import must go first because it needs to patch webpack chunk loading
5+
// before React patches chunk loading.
6+
require('./app-webpack')
7+
const { hydrate } = require('./app-index')
48
// Include app-router and layout-router in the main chunk
59
require('next/dist/client/components/app-router')
610
require('next/dist/client/components/layout-router')
7-
require('./app-webpack')
8-
const { hydrate } = require('./app-index')
911
hydrate()
1012
})

packages/next/src/server/app-render/use-flight-response.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export function useFlightResponse(
2626
}
2727
// react-server-dom-webpack/client.edge must not be hoisted for require cache clearing to work correctly
2828
let createFromReadableStream
29+
// @TODO: investigate why the aliasing for turbopack doesn't pick this up, requiring this runtime check
2930
if (process.env.TURBOPACK) {
3031
createFromReadableStream =
3132
// eslint-disable-next-line import/no-extraneous-dependencies

0 commit comments

Comments
 (0)