-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
docs: migration guide for v7 #20051
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
base: main
Are you sure you want to change the base?
docs: migration guide for v7 #20051
Conversation
|
||
As part of the new experimental [Environment API](/guide/api-environment.md), a big internal refactoring was needed. Vite 6 strives to avoid breaking changes to ensure most projects can quickly upgrade to the new major. We'll wait until a big portion of the ecosystem has moved to stabilize and start recommending the use of the new APIs. There may be some edge cases but these should only affect low level usage by frameworks and tools. We have worked with maintainers in the ecosystem to mitigate these differences before the release. Please [open an issue](https://github.com/vitejs/vite/issues/new?assignees=&labels=pending+triage&projects=&template=bug_report.yml) if you spot a regression. | ||
Vite no longer supports Node.js 18, which reached its EOL. Node.js 20.19+ / 22.12+ is now required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing you guys decided to use Node.js 20.19+
because of the recent require(esm)
feature? If so, it might be worth mentioning the reasoning somewhere in the migration since that is quite far from the regular v20.0
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that is the reason. I didn't include the reason here because I thought the focus should be on the necessary steps for the migration. Do you think it's important to explain the reason? Or would it be more helpful to highlight that this is not 20.0+ / 22.0+?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah right, I do think it's useful to know, but it could indeed be mentioned somewhere else (perhaps in the official release blog post might be a better place to put it?). We're slowly getting closer to an ESM-Only world 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have this is a draft for the blog post:
Vite now requires Node.js 20.19+, 22.12+. We have dropped Node.js 18, now that it has reached its EOL at the end of April 2025.
We require these new ranges so Node.js supports require(esm)
without a flag. This lets us distribute Vite as ESM only without preventing Vite JavaScript API from being required from CJS modules. Check out Anthony Fu's Move on to ESM-only for a detailed review of the current state of ESM in the ecosystem.
Description
I only included the ones already merged.