-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
Bundle size optimized via different date-fns imports #346
Bundle size optimized via different date-fns imports #346
Conversation
Nice visualization created with https://github.com/hughsk/disc . |
I realize the size difference, that is obvious but I am not sure what you have done to produce the smaller bundle size. Further, we are working on the next major version and among the many internal changes, we are moving the bundling process to webpack for many reasons, among which are to take advantage of tree shaking to produce optimized bundle size |
@mikeerickson Well, the most important change is the first line of the modified file. I am basically importing only those functions that are used within I found such advice pretty common in the context of that package: date-fns/date-fns#771 (comment) so I though it should be used within P. S. It would be nice to have the optimization released in the v3 branch :) |
@mikeerickson Anything I can do to merge it? And being released? |
This is awesome! @mikeerickson can it be merged? Looks like it doesn't have any problems and tests passed. |
@zetoke I will review this PR and work to get another minor version out this weekend. Thank you for your efforts. |
@jacekk I will be addressing this over the weekend. Thank your for your efforts. |
@mikeerickson thank you very much! |
@mikeerickson Any ETA for a new, smaller release? |
@mikeerickson can we help anyhow to release those 3 lines of code that saves a lot of kilobytes in client bundles? |
@zetoke my apologies, I thought I already did this. I will get a new version pushed up this weekend. |
@mikeerickson thank you very much! |
@zetoke You thanked, but the latest released version is 3.17.1 from Sep 4th. What I am missing in here? 🤔 |
@jacekk sorry for delay, I am recovering from flu, but this will get done as soon as I am back to life (hoping tomorrow) |
TLDR: The bundle size has been reduced from almost 600K into 62K.
After clone:
Changed:
After changes: