Skip to content

Commit 73a9186

Browse files
author
Adam Gleitman
committed
ci(0.76): Add docs and CI checks for RN peer dependency
1 parent e553795 commit 73a9186

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
@@ -32,4 +32,22 @@ stages:
3232
# jobs:
3333
#- template: /.ado/jobs/test-react-native-macos-init.yml@self
3434

35+
- stage: Validate_Peer_Dependency
36+
displayName: 'Validate Peer Dependency'
37+
dependsOn: []
38+
condition: and(succeeded(), contains(variables['System.PullRequest.TargetBranch'], '-stable'))
39+
jobs:
40+
- job: CheckRNPeerDependency
41+
displayName: 'react-native'
42+
pool:
43+
vmImage: $(vmImageApple)
44+
steps:
45+
- script: |
46+
set -eox pipefail
47+
if ! jq -e '.peerDependencies["react-native"]' packages/react-native/package.json > /dev/null; then
48+
echo "##vso[task.logissue type=error]react-native is not listed as a peerDependency in packages/react-native/package.json"
49+
exit 1
50+
fi
51+
displayName: 'Validate peerDependency in package.json'
52+
3553
# - template: /.ado/jobs/react-native-test-app-integration.yml@self

docs/Releases.md

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

217217
</details>
218+
219+
## Hermes Compatibility (0.74 and above)
220+
221+
*Note: This is only applicable if Hermes is enabled via the `USE_HERMES=1` environment variable when running `pod install`.*
222+
223+
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.
224+
225+
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).
226+
227+
For stable branches, the existence of this peer dependency is enforced as part of our CIs.

0 commit comments

Comments
 (0)