Skip to content

Commit

Permalink
Remove commented out loadModule code
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Mar 16, 2024
1 parent 9670ae4 commit 0d95410
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions packages/vite/src/clientSsr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ console.log('__webpack_require__', __webpack_require__)
console.log("__webpack_require__('FooBar')", __webpack_require__('FooBar'))

import path from 'node:path'
// import url from 'node:url'

import { use, createElement } from 'react'

Expand Down Expand Up @@ -52,34 +51,6 @@ async function getFunctionComponent<Props>(
throw new StatusError('No function component found', 404)
}

// async function loadModule<T>(moduleId: string): Promise<T> {
// console.log('moduleId', moduleId)
// const clientBuildManifestUrl = url.pathToFileURL(
// path.join(getPaths().web.distClient, 'client-build-manifest.json'),
// ).href
// const clientBuildManifest = (
// await import(clientBuildManifestUrl, { with: { type: 'json' } })
// ).default
// const rsdwClientKey = Object.keys(clientBuildManifest).find((key) =>
// key.startsWith('_client.edge-'),
// )
// console.log('rsdwClientKey', rsdwClientKey)
// const clientEdgeFileName = clientBuildManifest[rsdwClientKey || ''].file
// console.log('clientEdgeFileName', clientEdgeFileName)
// const modFullPath =
// '/Users/tobbe/tmp/test-project-rsc-external-packages-and-cells/web/dist/client/'

// const mod = (await import(modFullPath + clientEdgeFileName)).c
// console.log('mod', mod)

// if (mod) {
// return mod
// }

// // TODO (RSC): Making this a 404 error is marked as "HACK" in waku's source
// throw new StatusError('No module found', 404)
// }

// This gets executed in a RSC server "world" and should return the path to
// the chunk on in the client/browser "world"
function resolveClientEntryForProd(
Expand Down Expand Up @@ -306,7 +277,6 @@ export function renderFromDist<TProps>(rscId: string) {
const { createFromReadableStream } = await import(
'react-server-dom-webpack/client.edge'
)
// const { createFromReadableStream } = await loadModule<any>('RSDW-client')

// Like `createFromFetch`
const data = createFromReadableStream(stream, {
Expand Down

0 comments on commit 0d95410

Please sign in to comment.