MikaelEdebro / vue-airbnb-style-datepicker

A VueJs datepicker with a similar look and functionality as the popular AirBnb datepicker.
https://mikaeledebro.gitbooks.io/vue-airbnb-style-datepicker/
MIT License
506 stars 105 forks source link

date-fns as peer-dep ? #9

Closed lgooday closed 6 years ago

lgooday commented 6 years ago

I'm wondering about the requirement of having date-fns as peer-dep

Could'nt it be a dependency ? I'm using fecha and don't want to add a new dep for date management.

There might be a constraint / trade off I might not see here , but if agreed to you want me to PR ?

MikaelEdebro commented 6 years ago

If I set date-fns as a dependency, whenever someone downloads the datepicker, it will also download date-fns, and this is not desired behaviour for people already using date-fns in their apps. There will be code duplication, if let say a user is using date-fns 1.2.0, and vue-airbnb-style-datepicker uses date-fns 1.3.4.

What's good with date-fns (in comparison to for example Moment.js), is that you can add only the things you actually need, since it's module based.

I mean, the actual bundle size doesn't change for you even if it's set as a dependency. The date-fns methods required for the datepicker to work will still be included in the final bundle.