Skip to content

Commit

Permalink
RSC: Rename to buildRscClientAndServer (#10103)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored Mar 3, 2024
1 parent 80d9bfd commit 67fab61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 2 additions & 6 deletions packages/vite/src/buildFeServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getConfig, getPaths } from '@redwoodjs/project-config'

import { buildRouteHooks } from './buildRouteHooks'
import { buildRouteManifest } from './buildRouteManifest'
import { buildRscFeServer } from './buildRscFeServer'
import { buildRscClientAndServer } from './buildRscClientAndServer'
import { buildForStreamingServer } from './streaming/buildForStreamingServer'
import { ensureProcessDirWeb } from './utils'

Expand Down Expand Up @@ -42,14 +42,10 @@ export const buildFeServer = async ({ verbose, webDir }: BuildOptions = {}) => {
throw new Error('RSC entries file not found')
}

await buildRscFeServer()
await buildRscClientAndServer()

// Write a route manifest
return await buildRouteManifest()

//
// RSC specific code ends here
//
}

// We generate the RSC client bundle in the rscBuildClient function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { rscBuildCopyCssAssets } from './rsc/rscBuildCopyCssAssets'
import { rscBuildForServer } from './rsc/rscBuildForServer'
import { rscBuildRwEnvVars } from './rsc/rscBuildRwEnvVars'

export const buildRscFeServer = async () => {
export const buildRscClientAndServer = async () => {
// Analyze all files and generate a list of RSCs and RSFs
const { clientEntryFiles, serverEntryFiles } = await rscBuildAnalyze()

Expand All @@ -20,9 +20,14 @@ export const buildRscFeServer = async () => {
)

// Copy CSS assets from server to client
//
// TODO (RSC): We need to better understand how this work and how it can be
// improved.
// Can we do this more similar to how it's done for streaming?
await rscBuildCopyCssAssets(serverBuildOutput)

// Mappings from server to client asset file names
// Used by the RSC worker
await rscBuildClientEntriesMappings(
clientBuildOutput,
serverBuildOutput,
Expand Down

0 comments on commit 67fab61

Please sign in to comment.