praveenpuglia / vuetify-daterange-picker

The missing date range picker for Vuetify JS you have been looking for.
https://vuetify-daterange-picker.gitbook.io/docs
MIT License
197 stars 59 forks source link

Migrate from moment.js to `date-fns` #5

Closed vinaypuppal closed 6 years ago

vinaypuppal commented 6 years ago

Reason: moment.js produces larger bundle size and since we are not using all of moment.js it makes sense to import what we use only instead of full moment.js but moment.js has a performance overhead. Read this post for more info: https://raygun.com/blog/moment-js-vs-date-fns/

So it's better to use date-fns and import only what we use like

import format from 'date-fns/format';
praveenpuglia commented 6 years ago

Thanks for the suggestion. I was thinking of removing it too. Let me take a look.

praveenpuglia commented 6 years ago

Would you be interested in taking this up? All we need is a format function.

vinaypuppal commented 6 years ago

Yeah sure, so should we make date-fns as peerDependency or integrate into this component as you said we will be using only one format function so there won't be huge file size differences of our dist files. What do you say?

praveenpuglia commented 6 years ago

we'll need it as a dependency but just import those two functions. Webpack can take care of the rest.