Skip to content

ci(0.77): Add docs and CI checks for RN peer dependency #2556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .ado/apple-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,21 @@ stages:
# jobs:
# - template: /.ado/jobs/test-react-native-macos-init.yml@self
# - template: /.ado/jobs/react-native-test-app-integration.yml@self

- stage: Validate_Peer_Dependency
displayName: 'Validate Peer Dependency'
dependsOn: []
condition: and(succeeded(), contains(variables['System.PullRequest.TargetBranch'], '-stable'))
jobs:
- job: CheckRNPeerDependency
displayName: 'react-native'
pool:
vmImage: $(vmImageApple)
steps:
- script: |
set -eox pipefail
if ! jq -e '.peerDependencies["react-native"]' packages/react-native/package.json > /dev/null; then
echo "##vso[task.logissue type=error]react-native is not listed as a peerDependency in packages/react-native/package.json"
exit 1
fi
displayName: 'Validate peerDependency in package.json'
10 changes: 10 additions & 0 deletions docs/Releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,13 @@ We do this so that our first release will have a proper patch version of 0, as s
```

</details>

## Hermes Compatibility (0.74 and above)

*Note: This is only applicable if Hermes is enabled via the `USE_HERMES=1` environment variable when running `pod install`.*

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.

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).

For stable branches, the existence of this peer dependency is enforced as part of our CIs.