Skip to content

Commit 5e927f7

Browse files
committed
Run Vanilla Extract HMR assertion in RSC Framework Mode
1 parent b5a44b8 commit 5e927f7

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

integration/vite-css-test.ts

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -551,15 +551,6 @@ async function hmrWorkflow({
551551
file: "styles-bundled.css",
552552
selector: "#css-bundled",
553553
},
554-
// TODO: Fix HMR for CSS Modules in server-first routes in RSC Framework mode
555-
...(routeBase === "rsc-server-first-route"
556-
? []
557-
: ([
558-
{
559-
file: "styles.module.css",
560-
selector: "#css-modules",
561-
},
562-
] as const)),
563554
{
564555
file: "styles-postcss-linked.css",
565556
selector: "#css-postcss-linked",
@@ -568,13 +559,15 @@ async function hmrWorkflow({
568559
file: "styles-vanilla-global.css.ts",
569560
selector: "#css-vanilla-global",
570561
},
571-
// TODO: Fix HMR for locally scoped Vanilla Extract styles in RSC
572-
// Framework mode. May require changes to the RSC plugin, or Vanilla
573-
// Extract. Userland workaround for now:
574-
// https://github.com/pawelblaszczyk5/vite-rsc-experiments/blob/643649f2e6562c859d9612126bfc3a183e03c7b5/apps/vanilla-extract/vite.config.ts
575-
...(templateName.includes("rsc")
562+
// TODO: Fix HMR for CSS Modules and locally scoped Vanilla Extract in
563+
// server-first routes in RSC Framework mode
564+
...(routeBase === "rsc-server-first-route"
576565
? []
577566
: ([
567+
{
568+
file: "styles.module.css",
569+
selector: "#css-modules",
570+
},
578571
{
579572
file: "styles-vanilla-local.css.ts",
580573
selector: "#css-vanilla-local",
@@ -594,14 +587,6 @@ async function hmrWorkflow({
594587
`CSS update for ${routeFile}`,
595588
).toHaveCSS("padding", NEW_PADDING);
596589

597-
// TODO: Fix state preservation for Vanilla Extract HMR
598-
if (
599-
templateName.includes("rsc") &&
600-
file === "styles-vanilla-global.css.ts"
601-
) {
602-
continue;
603-
}
604-
605590
// Ensure CSS updates were handled by HMR
606591
await expect(input, `State preservation for ${routeFile}`).toHaveValue(
607592
routeFile,

0 commit comments

Comments
 (0)