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
Discovery: moment.js alternative #6763
Comments
For the alternatives, I think Here is a comparison of gzipped bundle sizes from the previously linked table:
If we configured webpack to allow tree-shaking we would be able to create a bundle with |
Here are the
In order to make the switch to |
I think it may be wise to hold off on this for a bit. We could pass an |
Need to:
|
@markgreenburg commented on Fri Aug 03 2018
Problem:
Moment.js is ~10x the size of React, gzipped (>60K). This seems to be the case despite removing locales via
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
. Further, imports can't be modularized so we can't take advantage of tree shaking. This is a really big dependency, and we don't really use many fancy features to make moment worth all this weight.Discovery:
moment
functions we use in vets-websitemoment-setup.js
inplatforms/site-wide
as well as autils/date/index.js
in addition to the usage across our apps.@cvalarida commented on Fri Aug 03 2018
@markgreenburg Did you measure this in the bundle served to the client or using VSCode's fancy new import size feature? I'm wondering if the latter doesn't factor in that webpack ignore plugin.
The text was updated successfully, but these errors were encountered: