Instantsearch.js: React 15.3.1 shouldn't be a dependency.

Created on 5 Oct 2016  路  13Comments  路  Source: algolia/instantsearch.js

Propose using
"react": "^0.14.0" in devdependencies
See this example

Question

Most helpful comment

ok fine then thx, will do it assap

All 13 comments

Hi @salazareddie, thanks for the issue. Can you explain and comment how/if the current state is triggering some bad behavior on your side?

Thanks

@vvo

For NPM < 3 this causes two version of react to be loaded, and the app to go kaboom. The guys at material-ui had a similar issue, here.

Yep you're right thanks, it should be a peerDependency thought right? Because if you use this with npm, you will need react to be installed. Thus a peer will indicate this to you.

Also this may break some existing installations of instantsearch.js for npm users if we do this. For sure next breaking version we will do it, but for now we cannot.

What we can do is move to "^15.0.0" instead of "15.3.2" would that be fine for you? So that npm resolves this well.

@vvo Yes, it should be a peerDependency. Moving to ^15.0.0 should work for us. I think you will have to do the same for react-dom. Will grab latest once you push. Thanks for the quick turn around.

Ok so we are gonna move to ^15.0.0 put stick with dependencies field. We will move to peerDependency in another breaking version. None planned yet.

@salazareddie What's the react version you are using right now?

@vvo We are using 0.14.8. Tested the above solution locally and will do the trick. Just get these warnings when I npm install:

npm WARN unmet dependency /Users/esalazar/projects/***/node_modules/instantsearch.js requires react@'^15.0.0' but will load
npm WARN unmet dependency /Users/esalazar/projects/***/node_modules/react,
npm WARN unmet dependency which is version 0.14.8
npm WARN unmet dependency /Users/esalazar/projects/***/node_modules/instantsearch.js requires react-dom@'^15.0.0' but will load
npm WARN unmet dependency /Users/esalazar/projects/***/node_modules/react-dom,
npm WARN unmet dependency which is version 0.14.8

ok fine then thx, will do it assap

@vvo any updates on this?

Going to do a release in the coming hour, are you a react user? We do have a react specific set of components in the work right now if you want to beta test it, email at [email protected] thx

should be fixed, let me know

@vvo Do you want me to add a separate issue for moving the dependency to peer dependencies?

@salazareddie It's ok we'll do it but only on a breaking change, should happen this year :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

object505 picture object505  路  4Comments

vvo picture vvo  路  4Comments

anthonyBertrant picture anthonyBertrant  路  3Comments

ChristopherDosin picture ChristopherDosin  路  4Comments

bobylito picture bobylito  路  3Comments