Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSC: Rename to buildRscClientAndServer #10103

Merged
merged 1 commit into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading