react-datetime icon indicating copy to clipboard operation
react-datetime copied to clipboard

peerDependencies error with react 0.13.x

Open markmus opened this issue 11 years ago • 8 comments

How I could fix this issue? I'm getting peerDependencies error when I try to update to 2.0.

Looks the problem is coming from npm ERR! peerinvalid Peer [email protected] wants react@^0.14.3.

Currently I'm using "react": "^0.13.3" While I need to upgrade my react-datetime to 2.0 since I'm getting error of OnClickOutside in IE9 on my current "react-datetime": "^1.3.0"

markmus avatar Dec 01 '15 08:12 markmus

:+1: for this. Why not release a version with support for 0.14 only?

brenoferreira avatar Feb 25 '16 19:02 brenoferreira

Hi

Yes, next version will be React 0.14 only compatible, having it compatible with previous versions is just too complicated.

Wait for news soon :)

arqex avatar Feb 26 '16 12:02 arqex

Great! But is there any reason for having the peerDependency for react-dom on this current release?

brenoferreira avatar Feb 26 '16 12:02 brenoferreira

@brenoferreira from what I can find, the only explicit reference to react-dom in the code base is in the test file. From that information only I think it can be moved to devDependencies.

@arqex what is the plan with this? Should we aim for a release who fully supports React 0.14 (or even 0.15 maybe)? Also, do you think we can move the dependency react-dom? Note, I have not tried building the component without react-dom.

simeg avatar Sep 12 '16 23:09 simeg

Hello, I would like to get the ball rolling on v3 and bringing this project into 2017.

Can I propose we set React peer dependency to 15+?

I've forked the project and am currently rewriting src files in ES2015 and removing redundant dependencies. I am using babel cli to convert the /src files to /lib files in plain js (as it is now). The package.json "main" entry would change from /DateTime.js to /lib/DateTime.js so it would behave the same as it is now, and a new package.json "module" entry could point to /src/DateTime.js which is used by Webpack and other bundlers looking for modern js.

To begin with, I will make sure the interface is exactly the same as it is now but with updating the major revision, now would be a good time to make a major change like removing moment as a core dependency. Fecha is made as a very lightweight (2k min gzipped) replacement for Moment and supports the same format strings. I looked into Date Fns but it does not support parsing dates with a format string (only ISO 8601 formats). We could also add params for formatDate, formatTime and parseDate to allow users to provide their own custom methods.

Users could still pass Moment objects as params to the component if we simply expect a Date like object that supports valueOf() to return the time in milliseconds. There's the question of TZ though. Locale would have to be passed in as a param.

Anyhow, I'm working on this now and would love for it to become part of v3 instead of leaving this in my own GitHub repo.

Cheers, Brendan

bjbrewster avatar Sep 30 '17 01:09 bjbrewster

@bjbrewster see #458 for bumping React peer dependency version.

simeg avatar Nov 05 '17 21:11 simeg

See https://github.com/YouCanBookMe/react-datetime/pull/463.

simeg avatar Feb 11 '18 20:02 simeg

Btw @bjbrewster, I haven't seen you here in a while. What happened to your ES2015 re-write? :) Sounds interesting.

simeg avatar Feb 11 '18 20:02 simeg