Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Vite 6 support #12469

Merged
merged 14 commits into from
Dec 17, 2024
Merged

Add Vite 6 support #12469

merged 14 commits into from
Dec 17, 2024

Conversation

markdalgleish
Copy link
Member

@markdalgleish markdalgleish commented Dec 5, 2024

Tasks:

  • Support integration tests running against both Vite 5 and 6
  • Fix CSS side-effect FOUC in dev
  • Fix typecheck command
  • Fix client HMR on server code changes
  • Run config/routes.ts integration tests against Vite 5 and 6

Copy link

changeset-bot bot commented Dec 5, 2024

🦋 Changeset detected

Latest commit: 98e8c25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@react-router/dev Major
@react-router/fs-routes Major
@react-router/remix-routes-option-adapter Major
create-react-router Major
react-router Major
react-router-dom Major
@react-router/architect Major
@react-router/cloudflare Major
@react-router/express Major
@react-router/node Major
@react-router/serve Major

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

@sapphi-red
Copy link

I made these PR to remix while testing Vite 6. I didn't try them with RR7, but it might be useful.
remix-run/remix#10254, remix-run/remix#10255

@@ -85,7 +85,7 @@
"semver": "^7.3.7",
"set-cookie-parser": "^2.6.0",
"valibot": "^0.41.0",
"vite-node": "^1.6.0"
"vite-node": "3.0.0-beta.2"
Copy link
Member Author

@markdalgleish markdalgleish Dec 16, 2024

Choose a reason for hiding this comment

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

This was bumped because v3 is the first major version of vite-node to officially support both Vite v5 and v6: https://github.com/vitest-dev/vitest/blob/main/packages/vite-node/package.json#L89. I think it's okay we're running a beta version because we're using vite-node in a very limited capacity to run config files and we don't expose any Vite internals to consumers. However, just to be sure, we run the routes.ts tests against both v5 and v6 of Vite.

@markdalgleish markdalgleish marked this pull request as ready for review December 16, 2024 05:40
@markdalgleish
Copy link
Member Author

@sapphi-red Thanks for your help on the Remix repo. I've applied your HMR fix here, and I've also adjusted my approach for using ssrLoadModule for CSS files to detect the major version of Vite, just like your Remix PR. I initially wanted to avoid relying on Vite version numbers to toggle behaviour if possible, but I think your approach is more straightforward if you don't consider this to be a problem.

Copy link
Member Author

@markdalgleish markdalgleish left a comment

Choose a reason for hiding this comment

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

Just noting that I pair reviewed these changes with @pcattori.

@markdalgleish markdalgleish merged commit 5115991 into dev Dec 17, 2024
8 checks passed
@markdalgleish markdalgleish deleted the vite-6-support branch December 17, 2024 00:04
@sapphi-red
Copy link

Great that it's merged 🙂 It would be nice if we can have RR7 in the ecosystem-ci as well.

Copy link
Contributor

🤖 Hello there,

We just published version 7.1.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!

Copy link
Contributor

🤖 Hello there,

We just published version 7.1.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.

2 participants