-
Notifications
You must be signed in to change notification settings - Fork 579
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
Reduce plugin bundle size #165
Comments
No interest i see... i decided to write my own instead. The goal is to have a fully functional date-range picker under 5kb (minified, non-gzip). The problem with this library is it's size. 63kb + moment.js (23kb) is quite huge for only a datepicker.... |
Yes, you're right. The size is too big especially when it is used on a mobile site. |
I wanted to draw your attention to my fork of this project. It is quite extensive, but it is still working as a drop-in replacement on the demo page. As part of the refactoring, I try to split the functionality into several browserify modules, which in turn can be excluded from the compiled library. So far, I have only extracted the language strings and the time-selection functionality, but I am sure there's more to come. The minified library my build produces is only 30Kb when those features are left out. |
@longbill Yes, exactly. I need something that works well on broadband but would work well on smaller screens or poor connections (imagine sitting on a subway or even being in-flight between New York and Cancun) as well. Usually a datepicker component is only one of the things one load therefor my comment about 63+23kb being way too much just for the purpose of picking two dates. Anyway -- i've began coding such a thing myself with more specific usecases (light + loads of features isn't possible). It isn't easy, but it can be done. 👍 |
@suluke Sounds great, but 30kb is still much when consideringen something of a base for a datepicker component. |
I agree with the arguments presented here and I believe we can greatly reduce the bundle size. The first step would be to extract i18n into separate locale files. After that we can probably start exploring replacing moment.js. |
Any possibilities for a lighter version and dumping the requirements for Moment.js? As it is now the whole package clocks in at close to 100+ kb which is a tad much only for using a calendar.
There are alternatives to moment.js as well like fecha https://github.com/taylorhakes/fecha , xdate js etc.
As it is now the datepicker is filled with every feature imaginable. Maybe create extensions instead so that the core can be a bit lighter?
The text was updated successfully, but these errors were encountered: