feat(create-rspack): better default browserslist target#10290
feat(create-rspack): better default browserslist target#10290chenjiahan merged 1 commit intoweb-infra-dev:mainfrom
Conversation
✅ Deploy Preview for rspack canceled.Built without sensitive environment variables
|
CodSpeed Performance ReportMerging #10290 will not alter performanceComparing 🎉 Hooray!
|
|
Sorry, this was not an expected change, here are the reasons:
|
tl;dr: @chenjiahan I understand wanting to be conservative with our default browser target, but do not think that Vite did anything more than just use the most modern, widely-supported browsers at the time. Sticking with five-year old browsers leaves performance on the table for the vast majority of our users. This PR proposes a way that we can continuously stay with the most widely supported browsers while also introducing new features as they become widely available. |
Summary: The current browserslist default has two problems 1. It only covers [31% of users](https://browsersl.ist/#q=chrome+%3E%3D+87%2C+edge+%3E%3D+88%2C+firefox+%3E%3D+78%2C+safari+%3E%3D+14) 2. The versions are hardcoded, so needs to be manually updated This commit changes the default browserslist to dynamically update as browser usage changes, and moves coverage from 31% to [91%](https://browsersl.ist/#q=last+2+versions%2C+Firefox+ESR%2C+%3E+0.2%25%2C+not+dead)
|
btw, while doing research for my last post I discovered Vite will probably make the same change too 😁 vitejs/vite#20007 |
|
Thanks for the detailed introduction, I agree that it makes sense to preset a dynamic range in the Rspack templates. I noticed that the default value of browserslist is "> 0.5%, last 2 versions, Firefox ESR, not dead", while this PR introduces a different order of values (e.g. Firefox ESR is at the end). Is this intentional? |
No 🙂 |
|
@chenjiahan should we make similar patches for Rsbuild and Modern.js? |
|
It's a breaking change for Rsbuild so I prefer to update the value in major release. |
|
@chenjiahan makes sense. Are we already working on a major release in a (if we really want to avoid a breaking change, we could update the |
|
Yeah keep Rsbuild's templates clean is quite import as it's an zero config build tool. We haven't have a clear plan for Rsbuild's next major version. Maybe later in the year we'll start thinking about it. |
|
What about Modern.js? We already provide a I see Modern.js will drop support for Node 16 next month. When will Rsbuild drop support? |
|
For Morern.js, would you like to create an issue in the Modern js repo? Rsbuild will drop Node 16 support in Rsbuild 1.5, which should be released in Q3 2025. |
See discussion in web-infra-dev/rspack#10290 for info
|
@chenjiahan let's discuss the Rsbuild change in web-infra-dev/rsbuild#5235 and the Modern.js patch in web-infra-dev/modern.js#7147 |
See discussion in web-infra-dev/rspack#10290 for info
See discussion in web-infra-dev/rspack#10290 for info
See discussion in web-infra-dev/rspack#10290 for info
Summary: The current browserslist default has two problems
This commit changes the default browserslist to dynamically update as browser usage changes, and moves coverage from 31% to 91%