feat(plugin-rsc): allow to control whether CSS links use React's precedence attribute#1064
Conversation
precedence attributeprecedence attribute
hi-ogawa
left a comment
There was a problem hiding this comment.
I'm seeing this error on console when cssLinkPrecedence: false.
react-dom_client.js?v=3a470fe3:16505
Cannot render a <link rel="stylesheet" /> outside the main document without knowing its precedence. Consider adding precedence="default" or moving it into the root <head> tag.
I'm fine to have this as option, but I'll note this API as @experimental as I'm not sure what the ideal shape of this yet in the long run.
Research on React's
|
|
Considering #1065, is it more preferable to not including |
|
I'm still unsure the full viability of style without |
Summary
Adds a new
cssLinkPrecedenceoption to control whether CSS links use React'sprecedenceattribute.true(default): CSS links includeprecedence="vite-rsc/importer-resources"orprecedence="vite-rsc/client-reference"false: CSS links are rendered without theprecedenceattributeUsage
Changes
cssLinkPrecedenceoption toRscPluginOptions(marked as@experimental)generateResourcesCodeto conditionally includeprecedencepreloadDepsinssr.tsxto respect the setting