Skip to content

Commit 8ddbd42

Browse files
amgleitmanAdam Gleitman
andauthored
ci(0.74): Add docs and CI checks for RN peer dependency (microsoft#2545)
## Summary: This enforces and explains the existence of a peer dependency on RNCore for Hermes builds. ## Test Plan: The added CI should pass. Co-authored-by: Adam Gleitman <[email protected]>
1 parent 2db3abe commit 8ddbd42

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

37+
- stage: Validate_Peer_Dependency
38+
displayName: 'Validate Peer Dependency'
39+
dependsOn: []
40+
condition: and(succeeded(), contains(variables['System.PullRequest.TargetBranch'], '-stable'))
41+
jobs:
42+
- job: CheckRNPeerDependency
43+
displayName: 'react-native'
44+
pool:
45+
vmImage: $(vmImageApple)
46+
steps:
47+
- script: |
48+
set -eox pipefail
49+
if ! jq -e '.peerDependencies["react-native"]' packages/react-native/package.json > /dev/null; then
50+
echo "##vso[task.logissue type=error]react-native is not listed as a peerDependency in packages/react-native/package.json"
51+
exit 1
52+
fi
53+
displayName: 'Validate peerDependency in package.json'
54+
3755
# - 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
@@ -83,3 +83,13 @@ We do this so that our first release will have a proper patch version of 0, as s
8383
> semver.inc('0.72.0-ready', 'patch')
8484
'0.72.0' // Better!
8585
```
86+
87+
## Hermes Compatibility (0.74 and above)
88+
89+
*Note: This is only applicable if Hermes is enabled via the `USE_HERMES=1` environment variable when running `pod install`.*
90+
91+
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.
92+
93+
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).
94+
95+
For stable branches, the existence of this peer dependency is enforced as part of our CIs.

0 commit comments

Comments
 (0)