docs: rephrase browser range and features relation #19286
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I was discussing with @btea about the wording of this:
https://vite.dev/guide/build.html#browser-compatibility
The documented features don't match with the browser ranges, and few users have brought this up from time to time. And the reason is mostly that we're bumping to support features like nullish coalescing and bigint so they're not unnecessarily transpiled in modern browsers. However, this wasn't clearly explained in the docs.
This PR rephrases the paragraph, so instead of
targets browsers which support
, it'stargets browsers that support modern JS, such as ...
. This way we're not implying that the browser ranges strictly follow the feature set mentioned.Ideally we could strictly follow the feature set mentioned, however the browserslist query we used is outdated and can't be reproduced anymore, so I've updated it to use caniuse. Maybe in the next major we can bump up the browser ranges again to match the JS features we intend to follow.
I remember we've brought up to update the browser ranges to be "last 2 years" in the past for every major, but I don't think we've done that. Maybe it's also something we can revisit if we want to do this.