Skip to content
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

Open
tommiehansen opened this issue Sep 28, 2015 · 6 comments
Open

Reduce plugin bundle size #165

tommiehansen opened this issue Sep 28, 2015 · 6 comments
Labels
Status: todo Accepted issue that needs someone to fix it. Type: meta Issue related to plugin infrastructure, publishing, or other repository-related matters.

Comments

@tommiehansen
Copy link

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?

@tommiehansen
Copy link
Author

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....

@longbill
Copy link
Owner

longbill commented Jan 5, 2016

Yes, you're right. The size is too big especially when it is used on a mobile site.

@suluke
Copy link

suluke commented Jan 5, 2016

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 I don't mean to be hijacking your project here. I am very grateful for your fantastic library. I am eager to hear your opinion on my work so far. Maybe we can find a way to return some of it into your repository? Be warned, though, I have modified the structure of the project quite heavily

@tommiehansen
Copy link
Author

@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. 👍

@tommiehansen
Copy link
Author

@suluke Sounds great, but 30kb is still much when consideringen something of a base for a datepicker component.

@monovertex monovertex changed the title Light version? Reduce plugin bundle size Sep 19, 2018
@monovertex
Copy link
Collaborator

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.

@monovertex monovertex added Type: meta Issue related to plugin infrastructure, publishing, or other repository-related matters. Status: todo Accepted issue that needs someone to fix it. labels Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: todo Accepted issue that needs someone to fix it. Type: meta Issue related to plugin infrastructure, publishing, or other repository-related matters.
Projects
None yet
Development

No branches or pull requests

4 participants