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

fix(rsc): only use web/src/entries.ts as the rscBuildAnalyze entry point #10218

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

jtoar
Copy link
Contributor

@jtoar jtoar commented Mar 13, 2024

Right now rscBuildAnalyze scans three entry points and ~1600 files for 'use client' and 'use server' directives.

{
  entries: "~/redwood-app/web/src/entries.ts",
  "entry.server": "~/redwood-app/web/src/entry.server.tsx",
  Document: "~/redwood-app/web/src/Document.tsx",
}

Checked with @Tobbe and the only entry point we actually need to scan is web/src/entries.ts. With this change, we only scan 267 files.

@jtoar jtoar added the release:fix This PR is a fix label Mar 13, 2024
@jtoar jtoar added this to the RSC milestone Mar 13, 2024
// to generate these entries, rather than write to actual file.
// And so, we might as well use on-the-fly generation for regular
// builds too
ssr: rwPaths.web.entries,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Vite docs say we can just make this a string inline here instead of needing another config block so seeing if that'll go. See https://vitejs.dev/config/build-options#build-ssr.

@Tobbe Tobbe added the changesets-ok Override the changesets check label Mar 14, 2024
@jtoar jtoar merged commit 23a9fac into main Mar 14, 2024
47 of 48 checks passed
@jtoar jtoar deleted the ds-rsc/only-scan-entries.ts branch March 14, 2024 08:47
@Josh-Walker-GM Josh-Walker-GM modified the milestones: RSC, v8.0.0 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants