Closed lgooday closed 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.
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 ?