Skip to content

Commit

Permalink
Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Feb 29, 2024
1 parent ab38ba3 commit c2ea888
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
2 changes: 2 additions & 0 deletions packages/babel-config/src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ export const getWebSideOverrides = (
},
]

console.log('babel - How many times does this get called?')

return overrides.filter(
(override: false | TransformOptions): override is TransformOptions => {
return !!override
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/src/commands/experimental/setupRscHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,6 @@ export const handler = async ({ force, verbose }) => {
)
},
},
// TODO (RSC): Remove this once we have a better way to handle routes.
// This is a total hack right now
{
title: 'Overwriting routes...',
task: async () => {
Expand Down
4 changes: 0 additions & 4 deletions packages/vite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,6 @@ export default function redwoodPluginVite(): PluginOption[] {
babel: {
...getWebSideDefaultBabelConfig({
forVite: true,
// @MARK: Potential issue in the future. We don't want to set react
// plugins in each build file because we should be able to trigger
// the builds from the vite CLI directly.
forRscClient: rwConfig.experimental.rsc?.enabled,
}),
},
}),
Expand Down
4 changes: 4 additions & 0 deletions packages/vite/src/rsc/rscBuildAnalyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import { rscAnalyzePlugin } from './rscVitePlugins'
* Doesn't output any files, only collects a list of RSCs and RSFs
*/
export async function rscBuildAnalyze(viteConfigPath: string) {
console.log('\n')
console.log('1. rscBuildAnalyze')
console.log('==================\n')

const rwPaths = getPaths()
const clientEntryFileSet = new Set<string>()
const serverEntryFileSet = new Set<string>()
Expand Down
5 changes: 5 additions & 0 deletions packages/vite/src/rsc/rscBuildClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export async function rscBuildClient(
webDist: string,
clientEntryFiles: Record<string, string>
) {
console.log('\n')
console.log('2. rscBuildClient')
console.log('=================\n')

const rwPaths = getPaths()

const clientBuildOutput = await viteBuild({
Expand All @@ -35,6 +39,7 @@ export async function rscBuildClient(
babel: {
...getWebSideDefaultBabelConfig({
forVite: true,
forRscClient: true,
}),
},
}),
Expand Down
4 changes: 4 additions & 0 deletions packages/vite/src/rsc/rscBuildCopyCssAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export function rscBuildCopyCssAssets(
webDist: string,
webDistServer: string
) {
console.log('\n')
console.log('4. rscBuildCopyCssAssets')
console.log('========================\n')

// TODO (RSC) Some css is now duplicated in two files (i.e. for client
// components). Probably don't want that.
// Also not sure if this works on "soft" rerenders (i.e. not a full page
Expand Down
6 changes: 5 additions & 1 deletion packages/vite/src/rsc/rscBuildServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export async function rscBuildServer(
serverEntryFiles: Record<string, string>,
customModules: Record<string, string>
) {
console.log('\n')
console.log('3. rscBuildServer')
console.log('=================\n')

const input = {
entries: entriesFile,
...clientEntryFiles,
Expand All @@ -41,7 +45,7 @@ export async function rscBuildServer(

const serverBuildOutput = await viteBuild({
// ...configFileConfig,
root: rwPaths.web.base,
root: rwPaths.web.src,
envPrefix: 'REDWOOD_ENV_',
publicDir: path.join(rwPaths.web.base, 'public'),
envFile: false,
Expand Down

0 comments on commit c2ea888

Please sign in to comment.