Skip to content

Commit adb1a10

Browse files
author
Adam Gleitman
committed
ci: enforce RN peer dependency in stable branches
1 parent b19f02d commit adb1a10

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.ado/apple-pr.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ stages:
2828
- template: /.ado/jobs/test-javascript.yml@self
2929
- template: /.ado/jobs/npm-publish-dry-run.yml@self
3030

31+
- stage: Validate_Peer_Dependency
32+
displayName: 'Validate react-native Peer Dependency on Stable Branches'
33+
dependsOn: []
34+
condition: and(succeeded(), contains(variables['System.PullRequest.TargetBranch'], '-stable'))
35+
jobs:
36+
- job: CheckPeerDependency
37+
displayName: 'Check react-native in peerDependencies'
38+
pool:
39+
vmImage: $(vmImageApple)
40+
steps:
41+
- script: |
42+
set -eox pipefail
43+
if ! jq -e '.peerDependencies["react-native"]' packages/react-native/package.json > /dev/null; then
44+
echo "##vso[task.logissue type=error]react-native is not listed as a peerDependency in packages/react-native/package.json"
45+
exit 1
46+
fi
47+
displayName: 'Validate peerDependency in package.json'
48+
3149
# https://github.com/microsoft/react-native-macos/issues/2344
3250
# The Verdaccio server consistently hangs on creation, which is required for the integration tests
3351
# - stage: Integration

docs/Releases.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,13 @@ We do this so that our first release will have a proper patch version of 0, as s
221221
```
222222

223223
</details>
224+
225+
## Hermes Compatibility (0.74 and above)
226+
227+
*Note: This is only applicable if Hermes is enabled via the `USE_HERMES=1` environment variable when running `pod install`.*
228+
229+
React Native macOS updates the patch version automatically for every change that comes through, so our patch number can differ wildly from that of vanilla React Native.
230+
231+
To ensure the best possible Hermes compatibility, we specify a peer dependency in React Native macOS's `package.json` indicating which version of upstream React Native best corresponds with our own version. For example, our 0.74.34 corresponds to upstream's 0.74.7, and we reflect this connection in [this particular version of `package.json`](https://github.com/microsoft/react-native-macos/blob/2db3abeb5d4318fee3abdff4a4d1a68967223135/packages/react-native/package.json#L103).
232+
233+
For stable branches, the existence of this peer dependency is enforced as part of our CIs.

0 commit comments

Comments
 (0)