This repository was archived by the owner on Oct 2, 2019. It is now read-only.
Depend to react-native
as a peer
#42
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm proposing two changes to how
react-native
dependencies should be handled:Consider
react-native
a peer dependency.This library is a plugin, it does not make use of React native, it adds functionality to it. As such there will never be a project that uses
react-native-router
, but does not already import React native.Defining
react-native
as a dependency can cause issues when the relaxed semver requirement allows different versions of the framework do be installed by different plugins, and the dependent project itself. This just broke my build when upgrading toreact-native
0.6.0, and prevented me from using 0.6.0-rc without forkingreact-native-router
. See: facebook/react-native#1606 (comment)Consider
react-native
to be always forwards compatible.Facebook has now moved to a two week release cycle, where they release a new minor version every two weeks and simultaneously release a release candidate of the next minor version.
While there may be breaking changes in the future, arbitrarily preventing users of
react-native-router
to upgrade is a bigger limitation.