-
Notifications
You must be signed in to change notification settings - Fork 952
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
perf: use browserslist targets #6891
Conversation
...(mode === 'test' | ||
? [] | ||
: [ |
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.
This is either ESLint or Prettiers doing but it should be fine.
I'm a bit on edge about this, seems like a very low gain compared to potentially reducing usability in older browsers 🤔 |
We are already targeting the CSS of the browsers list config via autoprefixer and postcss. And the current target we have is quite broad so I'm not that worried about it. |
Could we test this branch preview vs prod on old browsers somehow? browser stack or similar? |
I can look into it 👍🏻 |
Gave it a quick test on Safari 15.6 using browserstack (latest supported version of safari 15) and it seems to work without issues. But to be sure this doesn't change silently in the future we can add safari 15 to the browsers list target. I see little point in testing chromium and Firefox as these are self updating, EDIT: Firefox ESR are included in the defaults. |
I propose we use this browsers list config: "browserslist": [
"defaults",
"safari 15.6",
"ios_saf 15.6",
"> 0.25%",
"not ie 11",
"not op_mini all"
], vs what we use now: "browserslist": [
"defaults",
"not ie 11",
"not op_mini all"
], |
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.
Looks good to me!
To be safe I think we could document a revert plan then monitor sentry on deployment, if we see a significantly higher than expected error rate we could roll it back.
Should I change the browsers list target to explicitly include Safari 15.6? |
Issue
ESBuild is not picking up these automatically creating less than optimal generated code.
Description
Adds a package that converts our browserslist target to a ESBuild target instead, this shaves some code of the bundles but more importantly uses more efficient syntax and newer features like optional chaining to reduce property access and similar.
This reduces the total app size from
4307.86 KiB
to4294.74 KiB
.Also converts the config file to a module config instead of a
cts
config so the new package works as expected. This is needed for Vite 5 later on anyhow.Note
If we are unsure about the compatibility I can always adjust the browsers list targets as well. For example explicitly include iOS/Safari 15.
Double check
pnpx prettier@2 --write .
andpoetry run format
in the top level directory to format my changes.