Conversation
🦋 Changeset detectedLatest commit: c369d0a The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Claude and me did a HMR analysis for global CSS in RSC-only server components tl;dr: it looks like the bug is in Setup of the repro
Where the render actually happensDirect path: Indirect path: That alone would be OK — plugin-rsc does have a pipeline for this. It has an In practice it doesn't work, and when I instrumented the relevant bits it became clear why. Bug 1 — no cache-buster on CSS hrefs in the rsc env
function normalizeViteImportAnalysisUrl(environment, id) {
let url = normalizeResolvedIdToUrl(environment, id, { id });
if (environment.config.consumer === "client") {
const mod = environment.moduleGraph.getModuleById(id);
if (mod && mod.lastHMRTimestamp > 0)
url = injectQuery(url, `t=${mod.lastHMRTimestamp}`);
}
return url;
}The The fresh timestamp is sitting right there on the module in the graph and gets thrown away. The URL that ends up in the Flight stream is the bare Bug 2 — CSS changes don't invalidate importers in the rsc envEven if 1 were fixed, you'd still need the virtual module that generates the But
It does not invalidate This one I verified with a second instrumentation — printing on the The
|
|
also prepared a fix for tanstack: TanStack/router#7219 |
adds a tanstack start example and a fix to resolve css urls even if they contain querystrings
e.g.
\0virtual:yak-css:src/components/Clock.tsx.css?direct