-
Notifications
You must be signed in to change notification settings - Fork 150
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
Update to react 15 #24
base: master
Are you sure you want to change the base?
Conversation
@yuanyan can you please merge this? It's breaking our CI |
Please avoid adding react as a dependency instead of a peerDependency. Doing so will mean that React 15.x will always be installed when this package is installed which will be bad if/when React 16 comes out. Much better to keep React as both a peerDependency and a devDependency, that way things won't actually break for people using future versions of React before this package gets updated. |
@jharris4 Why peerDependency is good for React 16? |
If React 15 is a dependency of Halogen and someone installs Halogen in a project that has a dependency on React 16, then both versions of React will be installed which will cause an error. If React 15 is a peerDependency of Halogen and someone installs Halogen in a project that has a dependency on React 16, then npm will give a warning, but the project will still work correctly if React 15 and React 16 are compatible. You can see that other packages are following the convention of specifying React as a peerDependency mostly for this reason. For example, see react-motion (https://github.com/chenglou/react-motion/blob/master/package.json) or react-dimensions (https://github.com/digidem/react-dimensions/blob/master/package.json) |
No it won't break, that's why you add as BOTH a peerDependency AND a devDependency. |
If you add it as a dependency (instead of devDependency) then whichever version of react you list in the dependencies section will always be installed whenever halogen is installed, and the peerDependency is pointless. The best way to do it would be like this (Note the use of ^ as well to allow newer versions as well):
You can look at the links to the package.json for the projects I pasted above, or many other examples on npm/github to see that this is how most people are managing dependencies on React to make it easier for people to migrate from one version of React to another. |
When will this be merged? |
@yuanyan Any update? |
Request to get this change merged upstream |
whats with the 2nd commit? It looks like it does not belong here. |
Perhaps unnecessary, but it does reflect the real history of the changes. I would say look at the discussion on the various approaches in this SO article. Would you suggest the squash alternative instead? |
It's unfortunate that the owner decided to save generated code in the repo. That makes one file changes ( |
@jacobdr I did not squash commits to get the whole history. |
Blocking us from using atm |
fwiw, I switched to this: https://github.com/jonjaques/react-loaders and it's working well and looks indentical. |
Can you merge this please? @yuanyan |
@yuanyan Removed peer dependencies and added react as dependencies.