Skip to content

Commit

Permalink
fix: RN Windows Dependency and Example (#267)
Browse files Browse the repository at this point in the history
* Move react-native-windows back to being a peerDependency

@rectified95 added Windows support to datetime-picker a while back. react-native-windows was added as a peer dependency, but this created warnings in cases where react-native-windows wasn't present in the host app. These warnings are currently present for all community modules with Windows support when RNW isn't installed.

A [follow-up change a few months ago](feda177) moved react-native-windows from a peerDependency to an optional dependency. This got rid of the warning but also means that:

- Every user of datetimepicker is now pulling in react-native-windows by default, even if they don't need it
- Due to how it's declared, we now have a transitive peer dependency forcing usage of RN 0.62 instead of RN 0.63
- It will potentially be broken on even react-native-windows 0.62 since we're pulling in multiple RNW versions

This change moves the dependency back to a peer dependency, loosens it to support RNW 0.63, and fixes up a couple of devDependencies that were looser than requested by react-native.

* Fix Windows Example
  • Loading branch information
NickGerleman authored Sep 3, 2020
1 parent 03ba7a2 commit ab9c486
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 24 deletions.
2 changes: 2 additions & 0 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ const ThemedTextInput = (props) => {
const MODE_VALUES = Platform.select({
ios: Object.values(IOS_MODE),
android: Object.values(ANDROID_MODE),
windows: [],
});
const DISPLAY_VALUES = Platform.select({
ios: Object.values(IOS_DISPLAY),
android: Object.values(ANDROID_DISPLAY),
windows: [],
});
const MINUTE_INTERVALS = [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30];

Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,20 @@
"metro-react-native-babel-preset": "^0.58.0",
"moment": "^2.24.0",
"prettier": "^2.0.5",
"react": "^16.11.0",
"react": "16.11.0",
"react-native": "^0.62.2",
"react-native-windows": "^0.62.0-0",
"react-test-renderer": "^16.11.0",
"react-test-renderer": "16.11.0",
"semantic-release": "^17.1.1"
},
"peerDependencies": {
"react": ">=16.8.3",
"react-native": ">=0.59"
"react-native": ">=0.59",
"react-native-windows": ">=0.62"
},
"dependencies": {
"invariant": "^2.2.4"
},
"optionalDependencies": {
"react-native-windows": "^0.62.0-0"
},
"detox": {
"test-runner": "jest",
"runner-config": "example/e2e/config.json",
Expand Down
28 changes: 10 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8427,20 +8427,20 @@ react-refresh@^0.4.0:
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.3.tgz#966f1750c191672e76e16c2efa569150cc73ab53"
integrity sha512-Hwln1VNuGl/6bVwnd0Xdn1e84gT/8T9aYNL+HAKDArLCS7LWjwr7StE30IEYbIkx0Vi3vs+coQxe+SQDbGbbpA==

react-test-renderer@^16.11.0:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.13.1.tgz#de25ea358d9012606de51e012d9742e7f0deabc1"
integrity sha512-Sn2VRyOK2YJJldOqoh8Tn/lWQ+ZiKhyZTPtaO0Q6yNj+QDbmRkVFap6pZPy3YQk8DScRDfyqm/KxKYP9gCMRiQ==
[email protected]:
version "16.11.0"
resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.11.0.tgz#72574566496462c808ac449b0287a4c0a1a7d8f8"
integrity sha512-nh9gDl8R4ut+ZNNb2EeKO5VMvTKxwzurbSMuGBoKtjpjbg8JK/u3eVPVNi1h1Ue+eYK9oSzJjb+K3lzLxyA4ag==
dependencies:
object-assign "^4.1.1"
prop-types "^15.6.2"
react-is "^16.8.6"
scheduler "^0.19.1"
scheduler "^0.17.0"

react@^16.11.0:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e"
integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==
[email protected]:
version "16.11.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.11.0.tgz#d294545fe62299ccee83363599bf904e4a07fdbb"
integrity sha512-M5Y8yITaLmU0ynd0r1Yvfq98Rmll6q8AxaEe88c8e7LxO8fZ2cNgmFt0aGAS9wzf1Ao32NKXtCl+/tVVtkxq6g==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
Expand Down Expand Up @@ -8963,22 +8963,14 @@ saxes@^5.0.0:
dependencies:
xmlchars "^2.2.0"

[email protected]:
[email protected], scheduler@^0.17.0:
version "0.17.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.17.0.tgz#7c9c673e4ec781fac853927916d1c426b6f3ddfe"
integrity sha512-7rro8Io3tnCPuY4la/NuI5F2yfESpnfZyT6TtkXnSWVkcu0BCDJ+8gk5ozUaFaxpIyNuWAPXrH0yFcSi28fnDA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"

scheduler@^0.19.1:
version "0.19.1"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196"
integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"

semantic-release@^17.1.1:
version "17.1.1"
resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-17.1.1.tgz#d9775968e841b2b7c5020559e4481aea8520ca75"
Expand Down

0 comments on commit ab9c486

Please sign in to comment.