Commit Graph
4 Commits
Author SHA1 Message Date
Eli WhiteandFacebook GitHub Bot 69ccbc3943 Allow union changes when the new element is in the middle of the union (#50117)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50117

D70870978 failed the compat check because it modified a union by removing an element in the middle:

```
'global' | 'self'
```

from
```
'global' | 'application' | 'self'
```

This caused the compat check to complain that index 1 in both unions: `self` didn't match `application` and thus it was a type incompatibility.

We should have been comparing these as an unsorted array of options, which first sorts, then treats differences as added/removed elements instead of incompatbile elements.

If in the example above the removed element was the last one from the union, it would have been fine.

Once these are classified as added/removed, the VersionDiffer is able to check whether that change is allowed in fromNative or toNative.

Changelog: [General][Fixed] Compatibility Check: Allow union changes when the new element is in the middle of the union

Reviewed By: makovkastar

Differential Revision: D71433054

fbshipit-source-id: 20a73f0ba0576daf30cec97bae969b31baf7f468
2025-03-19 11:33:08 -07:00
Eli WhiteandFacebook GitHub Bot 60e3921f9c Initial Open Sourcing of React Native Compatibility Check (#49340)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49340

This tool enables checking the boundary between JavaScript and Native for
backwards incompatible changes to protect against crashes.

This is useful for:

- Local Development
- Over the Air updates on platforms that support it
- Theoretically: Server Components with React Native

Check out the Readme for more information

Changelog: [General][Added] Open Sourcing React Native's Compatibility Check

Reviewed By: panagosg7

Differential Revision: D69476742

fbshipit-source-id: 8af6039839c5475c1258fa82d9750a9320cf0751
2025-02-12 08:24:13 -08:00
Qian WuandFacebook GitHub Bot df3a60293c Revert D69277991: Initial Open Sourcing of React Native Compatibility Check
Differential Revision:
D69277991

Original commit changeset: 886a983d4b17

Original Phabricator Diff: D69277991

fbshipit-source-id: f69d528d87c22d03b0c3e654733c8efa89104df0
2025-02-11 10:35:55 -08:00
Eli WhiteandFacebook GitHub Bot 6590bb3e14 Initial Open Sourcing of React Native Compatibility Check (#49311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49311

This tool enables checking the boundary between JavaScript and Native for
backwards incompatible changes to protect against crashes.

This is useful for:

- Local Development
- Over the Air updates on platforms that support it
- Theoretically: Server Components with React Native

Check out the Readme for more information

Changelog: [General][Added] Open Sourcing React Native's Compatibility Check

Reviewed By: yungsters

Differential Revision: D69277991

fbshipit-source-id: 886a983d4b17609ce771cdd93b75f34bbd8417dc
2025-02-11 08:23:16 -08:00