Skip to content

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sapphi-red
Copy link
Member

Description

I only included the ones already merged.

@sapphi-red sapphi-red added the documentation Improvements or additions to documentation label May 16, 2025
@sapphi-red sapphi-red added this to the 7.0 milestone May 22, 2025

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.
Copy link
Contributor

@ghiscoding ghiscoding May 22, 2025

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 :)

Copy link
Member Author

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+?

Copy link
Contributor

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 🚀

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants