Skip to content

Commit

Permalink
Nits to fix tests after rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
gnoff committed Oct 3, 2023
1 parent 02f9ce3 commit 7ff720f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/next-swc/crates/next-core/src/next_import_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,6 @@ 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/",
ImportMapping::External(Some("react-server-dom-turbopack".into())).cell(),
);
// TODO: we should not bundle next/dist/build/utils in the pages renderer at all
import_map.insert_wildcard_alias("next/dist/build/utils", external);
}
Expand All @@ -267,6 +263,10 @@ pub async fn get_next_server_import_map(
"next/dynamic",
request_to_import_mapping(project_path, "next/dist/shared/lib/app-dynamic"),
);
import_map.insert_exact_alias(
"react-server-dom-webpack/",
ImportMapping::External(Some("react-server-dom-turbopack".into())).cell(),
);
}
ServerContextType::Middleware => {}
}
Expand Down
6 changes: 4 additions & 2 deletions packages/next/src/client/app-next.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { appBootstrap } from './app-bootstrap'

appBootstrap(() => {
// This import must go first because it needs to patch webpack chunk loading
// before React patches chunk loading.
require('./app-webpack')
const { hydrate } = require('./app-index')
// Include app-router and layout-router in the main chunk
require('next/dist/client/components/app-router')
require('next/dist/client/components/layout-router')
require('./app-webpack')
const { hydrate } = require('./app-index')
hydrate()
})
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function useFlightResponse(
}
// react-server-dom-webpack/client.edge must not be hoisted for require cache clearing to work correctly
let createFromReadableStream
// @TODO: investigate why the aliasing for turbopack doesn't pick this up, requiring this runtime check
if (process.env.TURBOPACK) {
createFromReadableStream =
// eslint-disable-next-line import/no-extraneous-dependencies
Expand Down

0 comments on commit 7ff720f

Please sign in to comment.