@@ -34,12 +34,18 @@ const fixtures = [
3434 templateDisplayName : string ;
3535} > ;
3636
37- type RouteBasePath = "css" | "rsc-server-first-css" ;
37+ type RouteBasePath =
38+ | "css-with-links-export"
39+ | "css-with-floated-link"
40+ | "rsc-server-first-route" ;
3841const getRouteBasePaths = ( templateName : TemplateName ) => {
39- if ( templateName . includes ( "rsc" ) ) {
40- return [ "css" , "rsc-server-first-css" ] as const satisfies RouteBasePath [ ] ;
41- }
42- return [ "css" ] as const satisfies RouteBasePath [ ] ;
42+ return [
43+ "css-with-links-export" ,
44+ "css-with-floated-link" ,
45+ ...( templateName . includes ( "rsc" )
46+ ? ( [ "rsc-server-first-route" ] as const )
47+ : [ ] ) ,
48+ ] as const satisfies RouteBasePath [ ] ;
4349} ;
4450
4551const files = ( { templateName } : { templateName : TemplateName } ) => ( {
@@ -162,14 +168,17 @@ const files = ({ templateName }: { templateName: TemplateName }) => ({
162168 return null;
163169 }
164170
165- export function links() {
166- return [{ rel: "stylesheet", href: postcssLinkedStyles }];
171+ ${
172+ routeBasePath === "css-with-links-export"
173+ ? `export function links() { return [{ rel: "stylesheet", href: postcssLinkedStyles }]; }`
174+ : ""
167175 }
168176
169177 function TestRoute() {
170178 return (
171179 <>
172180 <input />
181+ ${ routeBasePath !== "css-with-links-export" ? `<link rel="stylesheet" href={postcssLinkedStyles} precedence="default" />` : "" }
173182 <div id="entry-client" className="entry-client">
174183 <div id="css-modules" className={cssModulesStyles.index}>
175184 <div id="css-postcss-linked" className="${ routeBasePath } -postcss-linked">
@@ -517,11 +526,6 @@ async function hmrWorkflow({
517526 base ?: string ;
518527 templateName : TemplateName ;
519528} ) {
520- if ( templateName . includes ( "rsc" ) ) {
521- // TODO: Fix CSS HMR support in RSC Framework mode
522- return ;
523- }
524-
525529 for ( const routeBase of getRouteBasePaths ( templateName ) ) {
526530 let pageErrors : Error [ ] = [ ] ;
527531 page . on ( "pageerror" , ( error ) => pageErrors . push ( error ) ) ;
@@ -555,10 +559,11 @@ async function hmrWorkflow({
555559 await Promise . all (
556560 [
557561 "#css-bundled" ,
558- "#css-postcss-linked" ,
559562 "#css-modules" ,
560- "#css-vanilla-global" ,
561- "#css-vanilla-local" ,
563+ ...( ! templateName . includes ( "rsc" )
564+ ? // TODO: Fix these in RSC Framework Mode
565+ [ "#css-postcss-linked" , "#css-vanilla-global" , "#css-vanilla-local" ]
566+ : [ ] ) ,
562567 ] . map (
563568 async ( selector ) =>
564569 await expect ( page . locator ( selector ) ) . toHaveCSS (
@@ -569,9 +574,13 @@ async function hmrWorkflow({
569574 ) ;
570575
571576 // Ensure CSS updates were handled by HMR
572- await expect ( input ) . toHaveValue ( "stateful" ) ;
577+ // TODO: Fix state preservation in RSC Framework mode
578+ if ( ! templateName . includes ( "rsc" ) ) {
579+ await expect ( input ) . toHaveValue ( "stateful" ) ;
580+ }
573581
574- if ( routeBase === "css" ) {
582+ // RSC Framework Mode doesn't support custom entries yet
583+ if ( ! templateName . includes ( "rsc" ) ) {
575584 // The following change triggers a full page reload, so we check it after all the checks for HMR state preservation
576585 await edit ( "app/entry.client.css" , modifyCss ) ;
577586 await expect ( page . locator ( "#entry-client" ) ) . toHaveCSS (
0 commit comments