-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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: Remove antd-with-locales import #29788
perf: Remove antd-with-locales import #29788
Conversation
5ff7440
to
93d7200
Compare
Loving these! Here are some suggestions (take 'em or leave 'em) that I came up with totally on my own with no help. Potential concerns:
Suggestions for improvement:
|
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.
Potential enhancements on the thread, but I love it. LGTM.
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.
LGTM! Thinking of ways to prevent this, but I can totally see how whoever brought this npm library having no indication of the impact on the bundle.
Let's think about what CI automation we'd like to have in place to alert author/reviewers about bundle size changes. Let me start a discussion thread about it.
Started a GH discussion about preventing bundle size creep using CI here -> #29803 |
59c8519
to
5e6df76
Compare
Had to bump |
5e6df76
to
866c9a7
Compare
@kgabryje I think your PR's lockfile has slipped out the required This is in the This is in your PR's branch (only 2 search results without the ones in |
Oh that's interesting... I only bumped a tests library. I'll try to regenerate package-lock and see if it helps. Thanks! |
Looks like it's related to this bug. I generated the package-lock file on my M2 macbook, and only arm64 references were generated. I fixed it by removing package-lock.json AND node_modules before rerunning |
9eb5b43
to
59207fa
Compare
59207fa
to
3782273
Compare
Thanks @kgabryje for going through and find the underlying RC! This seems precarious and I couldn't help but wonder if migrating to Edit: according to this comment in the linked issue, upgrading to currently latest
|
I did all that with the latest npm version 🙁 A quick (and a bit dirty) fix might be to |
2d6c934
to
f2fdbf3
Compare
The missing optional dependency should be fixed in @mistercrunch's PR, but this package by default will only put into the lockfile the required optional dependencies per the machine that was used to build the lockfile. The docker image recreates the package-lock file, but this may be an issue in the future with pypi or official release tarballs. -- edit -- |
SUMMARY
We were importing a huge package
antd-with-locales
(over 4MB) just to pick 1 locale for DatePicker from it.This PR removes that import and lazy loads just the required locale.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
After:
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION