-
Notifications
You must be signed in to change notification settings - Fork 1k
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): Load all css links to support css with rsc #10544
Conversation
createElement(ServerEntry, { | ||
location: { pathname: rscId }, | ||
css: cssLinks, | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice implementation 🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The way that Tobbe and Danny laid the groundwork here made it somewhat easy to pass the collected css links through and have them loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a solid implementation to me! But will defer the final decision/ review to @Tobbe.
@Josh-Walker-GM Maybe it would be wise to keep a note of where/how we could potentially improve performance (Like you've done in the PR), but in the code?
…uth-store * 'main' of github.com:redwoodjs/redwood: chore(router): Add more code comments to analyzeRoutes (#10569) RSC: No need to use memo or useMemo in the server router (#10568) RSC: getViteConfig in rscWorker (#10567) Split RSC and RSA handling in rscWorker (#10565) RSC: Extract the fetchRSC function (#10564) RSC: Fix TODO regarding SSR in client.ts (#10562) Docs: QoL Updates to Contributing.md (#10561) Added warning note to not add WebAuthn (#10231) fix(rsc): Load all css links to support css with rsc (#10544) fix(cli): Add deprecation notice for edgio deployment (#10551) Define `process.env.NODE_ENV` in build process. (#10553) chore(docs): Update dbAuth and Supabase middleware READMEs (#10552) chore(deps): Upgrade React 19 to beta 20240508 (#10560) Revert "chore(deps): React beta 20240508 (#10558)" (#10559) chore(deps): React beta 20240508 (#10558) fix(functions): Fix context variable warning/error (#10556) fix(functions): Mock context in function test template (#10555) chore(middleware): Format code and comments and fix comment grammar (#10554)
Problem
Currently we don't have good css support with RSC. Therefore the pages are unstyled and look ugly.
Changes
Document
component which ultimately causes them to be inserted into the HTML stream as link tags.preinit
calls. It's no longer used and can be revived from the git history if needed.Notes
preinit
working or we can stop loading some of these css assets by determining if they need to be loaded or not based on the url we're responding to.