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
Move moment to peerDependencies #1168
Conversation
I agree this is probably better, however there's some discussion going on here #122. |
Not sure if we can make this change without breaking everyone's datepickers. What do you think? |
Codecov Report
@@ Coverage Diff @@
## master #1168 +/- ##
=======================================
Coverage 85.36% 85.36%
=======================================
Files 13 13
Lines 888 888
Branches 146 146
=======================================
Hits 758 758
Misses 42 42
Partials 88 88 Continue to review full report at Codecov.
|
Some discussion which ended 1 year and a half ago. I think this should be reconsidered. I think that everyone who uses the datepicker are already using |
@Kerumen I think the plan is to bump the major only when we think the API is stable. Keeping it at 0 is also truly semver compliant since semver says
|
@aij Yes, seems legit too. npm won't auto-upgrade people and if they manually do it, they will know why their code breaks (if it breaks). |
Okay lets do this. We use yarn.lock instead of the package-lock.json, so lets make sure that's updated. |
@Kerumen Let me know if you want to proceed with this, happy to merge now we're reaching consensus. |
8be91c2
to
4bb8887
Compare
4bb8887
to
b6bea21
Compare
@martijnrusschen Conflicts resolved. I set |
Supersedes #419
Fixes #122
It's better to move
moment
topeerDependencies
because it prevents duplication of moment instances which can leads to bugs (when loading locals for instance).In our project, we have a fixed dependency of
moment@2.18
.react-datepicker
installsmoment@2.19
so 2 instances of moment are loaded andlocals
doesn't work for the moment ofreact-datepicker
.If you look at
react-dates
, this is how they requiremoment
: https://github.com/airbnb/react-dates/blob/master/package.json#L126I also removed
package-lock.json
as it's not used in the project anymore. Tell me if I should remove this from the PR as it's not quite related (but I didn't know which lockfile to update so I thought it should be better to delete it).