mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
69ccbc3943
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