Skip to content

Conversation

@markdalgleish
Copy link
Member

@markdalgleish markdalgleish commented Aug 22, 2025

This doesn't get us to 100% support, but this solves a number of issues and ensures the tests are passing against the fixes:

  • Updated @vitejs/plugin-rsc to fix an issue where it was removing link tags during HMR if they were rendered by our Links component.
  • Cloned serverResponse to detect redirects to fix an issue where CSS was missing on page load in dev when using floated link tags.
  • Updated vite-css-test.ts so that we're running all passing test cases with comments explaining what's left to fix.

@changeset-bot
Copy link

changeset-bot bot commented Aug 22, 2025

⚠️ No Changeset found

Latest commit: ef90a84

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

? []
: [{ file: "styles.module.css", selector: "#css-modules" }]),
// TODO: Fix HMR for `?url` CSS imports in RSC Framework mode: https://github.com/vitejs/vite-plugin-react/issues/772
// Once fixed, check if this also fixes HMR for Vanilla Extract
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For vanilla extract, we found a user land workaround https://github.com/pawelblaszczyk5/vite-rsc-experiments/blob/643649f2e6562c859d9612126bfc3a183e03c7b5/apps/vanilla-extract/vite.config.ts

I'm not sure yet whether rsc plugin should handle this in some general way or vanilla extract plugin should adjust it somehow.

@markdalgleish markdalgleish merged commit 300927d into dev Aug 26, 2025
8 checks passed
@markdalgleish markdalgleish deleted the markdalgleish/improve-vite-rsc-framework-css-hmr branch August 26, 2025 00:13
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

🤖 Hello there,

We just published version 7.9.0-pre.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 7.9.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants