-
Notifications
You must be signed in to change notification settings - Fork 25k
Adding support for unions in Codegen Schema #54489
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
arushikesarwani94
wants to merge
1
commit into
facebook:main
from
arushikesarwani94:export-D86501597
Closed
Adding support for unions in Codegen Schema #54489
arushikesarwani94
wants to merge
1
commit into
facebook:main
from
arushikesarwani94:export-D86501597
+3,467
−1,734
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
@arushikesarwani94 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D86501597. |
ca640fe to
3357a65
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 13, 2025
Summary: Pull Request resolved: facebook#54489 Previously, the parser was mapping to Array<any> when the element types of union were different. This caused compat checker to not recognize changes in unions of different types. `StringLiteralUnionTypeAnnotation` already had support for `types`, that can be expanded to all Union types so as to incorporate the Unions of different types. ``` { type: 'StringLiteralUnionTypeAnnotation', types: [ { type: 'StringLiteralTypeAnnotation' value: 'light' }, { type: 'StringLiteralTypeAnnotation' value: 'dark' }, ], } ``` NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this. The value of this is that the compat checker can now error when the union of different types changes. Also for consistency added support for similar literal types for Number & Boolean i.e `NumberLiteralTypeAnnotation` & `BooleanLiteralTypeAnnotation` Changelog: [Internal] Differential Revision: D86501597
3357a65 to
2369e47
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 14, 2025
Summary: Pull Request resolved: facebook#54489 Previously, the parser was mapping to Array<any> when the element types of union were different. This caused compat checker to not recognize changes in unions of different types. `StringLiteralUnionTypeAnnotation` already had support for `types`, that can be expanded to all Union types so as to incorporate the Unions of different types. ``` { type: 'StringLiteralUnionTypeAnnotation', types: [ { type: 'StringLiteralTypeAnnotation' value: 'light' }, { type: 'StringLiteralTypeAnnotation' value: 'dark' }, ], } ``` NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this. The value of this is that the compat checker can now error when the union of different types changes. Also for consistency added support for similar literal types for Number & Boolean i.e `NumberLiteralTypeAnnotation` & `BooleanLiteralTypeAnnotation` Changelog: [Internal] Differential Revision: D86501597
2369e47 to
f867487
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 14, 2025
Summary: Pull Request resolved: facebook#54489 Previously, the parser was mapping to Array<any> when the element types of union were different. This caused compat checker to not recognize changes in unions of different types. `StringLiteralUnionTypeAnnotation` already had support for `types`, that can be expanded to all Union types so as to incorporate the Unions of different types. ``` { type: 'StringLiteralUnionTypeAnnotation', types: [ { type: 'StringLiteralTypeAnnotation' value: 'light' }, { type: 'StringLiteralTypeAnnotation' value: 'dark' }, ], } ``` NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this. The value of this is that the compat checker can now error when the union of different types changes. Also for consistency added support for similar literal types for Number & Boolean i.e `NumberLiteralTypeAnnotation` & `BooleanLiteralTypeAnnotation` Changelog: [Internal] Differential Revision: D86501597
f867487 to
f42584f
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 14, 2025
Summary: Pull Request resolved: facebook#54489 Previously, the parser was mapping to Array<any> when the element types of union were different. This caused compat checker to not recognize changes in unions of different types. `StringLiteralUnionTypeAnnotation` already had support for `types`, that can be expanded to all Union types so as to incorporate the Unions of different types. ``` { type: 'StringLiteralUnionTypeAnnotation', types: [ { type: 'StringLiteralTypeAnnotation' value: 'light' }, { type: 'StringLiteralTypeAnnotation' value: 'dark' }, ], } ``` NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this. The value of this is that the compat checker can now error when the union of different types changes. Also for consistency added support for similar literal types for Number & Boolean i.e `NumberLiteralTypeAnnotation` & `BooleanLiteralTypeAnnotation` Changelog: [Internal] Differential Revision: D86501597
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 14, 2025
Summary: Pull Request resolved: facebook#54489 Previously, the parser was mapping to Array<any> when the element types of union were different. This caused compat checker to not recognize changes in unions of different types. `StringLiteralUnionTypeAnnotation` already had support for `types`, that can be expanded to all Union types so as to incorporate the Unions of different types. ``` { type: 'StringLiteralUnionTypeAnnotation', types: [ { type: 'StringLiteralTypeAnnotation' value: 'light' }, { type: 'StringLiteralTypeAnnotation' value: 'dark' }, ], } ``` NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this. The value of this is that the compat checker can now error when the union of different types changes. Also for consistency added support for similar literal types for Number & Boolean i.e `NumberLiteralTypeAnnotation` & `BooleanLiteralTypeAnnotation` Changelog: [Internal] Differential Revision: D86501597
f42584f to
7e4c508
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 14, 2025
Summary: Pull Request resolved: facebook#54489 Previously, the parser was mapping to Array<any> when the element types of union were different. This caused compat checker to not recognize changes in unions of different types. `StringLiteralUnionTypeAnnotation` already had support for `types`, that can be expanded to all Union types so as to incorporate the Unions of different types. ``` { type: 'StringLiteralUnionTypeAnnotation', types: [ { type: 'StringLiteralTypeAnnotation' value: 'light' }, { type: 'StringLiteralTypeAnnotation' value: 'dark' }, ], } ``` NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this. The value of this is that the compat checker can now error when the union of different types changes. Also for consistency added support for similar literal types for Number & Boolean i.e `NumberLiteralTypeAnnotation` & `BooleanLiteralTypeAnnotation` Changelog: [Internal] Differential Revision: D86501597
49c24d7 to
9cec0e4
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 15, 2025
Summary: Pull Request resolved: facebook#54489 Previously, the parser was mapping to Array<any> when the element types of union were different. This caused compat checker to not recognize changes in unions of different types. `StringLiteralUnionTypeAnnotation` already had support for `types`, that can be expanded to all Union types so as to incorporate the Unions of different types. ``` { type: 'StringLiteralUnionTypeAnnotation', types: [ { type: 'StringLiteralTypeAnnotation' value: 'light' }, { type: 'StringLiteralTypeAnnotation' value: 'dark' }, ], } ``` NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this. The value of this is that the compat checker can now error when the union of different types changes. Also for consistency added support for similar literal types for Number & Boolean i.e `NumberLiteralTypeAnnotation` & `BooleanLiteralTypeAnnotation` Changelog: [Internal] Differential Revision: D86501597
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 15, 2025
Summary: Pull Request resolved: facebook#54489 Previously, the parser was mapping to Array<any> when the element types of union were different. This caused compat checker to not recognize changes in unions of different types. `StringLiteralUnionTypeAnnotation` already had support for `types`, that can be expanded to all Union types so as to incorporate the Unions of different types. ``` { type: 'StringLiteralUnionTypeAnnotation', types: [ { type: 'StringLiteralTypeAnnotation' value: 'light' }, { type: 'StringLiteralTypeAnnotation' value: 'dark' }, ], } ``` NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this. The value of this is that the compat checker can now error when the union of different types changes. Also for consistency added support for similar literal types for Number & Boolean i.e `NumberLiteralTypeAnnotation` & `BooleanLiteralTypeAnnotation` Changelog: [Internal] Differential Revision: D86501597
a06e626 to
e012f3f
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 18, 2025
Summary: Pull Request resolved: facebook#54489 Previously, the parser was mapping to Array<any> when the element types of union were different. This caused compat checker to not recognize changes in unions of different types. `StringLiteralUnionTypeAnnotation` already had support for `types`, that can be expanded to all Union types so as to incorporate the Unions of different types in parser logic. ``` { type: 'StringLiteralUnionTypeAnnotation', types: [ { type: 'StringLiteralTypeAnnotation' value: 'light' }, { type: 'StringLiteralTypeAnnotation' value: 'dark' }, ], } ``` NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this. The value of this is that the compat checker can now error when the union of different types changes. Also for consistency added support for similar literal types for Number & Boolean i.e `NumberLiteralTypeAnnotation` & `BooleanLiteralTypeAnnotation` Changelog: [Internal] Differential Revision: D86501597
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 18, 2025
Summary: Pull Request resolved: facebook#54489 Previously, the parser was mapping to Array<any> when the element types of union were different. This caused compat checker to not recognize changes in unions of different types. `StringLiteralUnionTypeAnnotation` already had support for `types`, that can be expanded to all Union types so as to incorporate the Unions of different types in parser logic. ``` { type: 'StringLiteralUnionTypeAnnotation', types: [ { type: 'StringLiteralTypeAnnotation' value: 'light' }, { type: 'StringLiteralTypeAnnotation' value: 'dark' }, ], } ``` NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this. The value of this is that the compat checker can now error when the union of different types changes. Also for consistency added support for similar literal types for Number & Boolean i.e `NumberLiteralTypeAnnotation` & `BooleanLiteralTypeAnnotation` Changelog: [Internal] Differential Revision: D86501597
e012f3f to
9b00a10
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 18, 2025
Summary: Pull Request resolved: facebook#54489 Previously, the parser was mapping to Array<any> when the element types of union were different. This caused compat checker to not recognize changes in unions of different types. `StringLiteralUnionTypeAnnotation` already had support for `types`, that can be expanded to all Union types so as to incorporate the Unions of different types in parser logic. ``` { type: 'StringLiteralUnionTypeAnnotation', types: [ { type: 'StringLiteralTypeAnnotation' value: 'light' }, { type: 'StringLiteralTypeAnnotation' value: 'dark' }, ], } ``` NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this. The value of this is that the compat checker can now error when the union of different types changes. Also for consistency added support for similar literal types for Number & Boolean i.e `NumberLiteralTypeAnnotation` & `BooleanLiteralTypeAnnotation` Changelog: [Internal] Differential Revision: D86501597
9b00a10 to
77d899b
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 18, 2025
Summary: Pull Request resolved: facebook#54489 Previously, the parser was mapping to Array<any> when the element types of union were different. This caused compat checker to not recognize changes in unions of different types. `StringLiteralUnionTypeAnnotation` already had support for `types`, that can be expanded to all Union types so as to incorporate the Unions of different types in parser logic. ``` { type: 'StringLiteralUnionTypeAnnotation', types: [ { type: 'StringLiteralTypeAnnotation' value: 'light' }, { type: 'StringLiteralTypeAnnotation' value: 'dark' }, ], } ``` NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this. The value of this is that the compat checker can now error when the union of different types changes. Also for consistency added support for similar literal types for Number & Boolean i.e `NumberLiteralTypeAnnotation` & `BooleanLiteralTypeAnnotation` Changelog: [Internal] Differential Revision: D86501597
77d899b to
aef04c3
Compare
c23be31 to
44ced73
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 23, 2025
…book#54489) Summary: Pull Request resolved: facebook#54489 Adding support for Unions in react-native-codegen & Compat Checker so that they can allow non-homogenous types and un-special casing StringLiteralUnionTypeAnnotation. Changelog: [Internal] Differential Revision: D86501597
44ced73 to
f6fcb1e
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Nov 25, 2025
…book#54489) Summary: Pull Request resolved: facebook#54489 Adding support for Unions in react-native-codegen & Compat Checker so that they can allow non-homogenous types and un-special casing StringLiteralUnionTypeAnnotation. Changelog: [Internal] Differential Revision: D86501597
f6fcb1e to
d241fed
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Dec 1, 2025
…book#54489) Summary: Pull Request resolved: facebook#54489 Adding support for Unions in react-native-codegen & Compat Checker so that they can allow non-homogenous types and un-special casing StringLiteralUnionTypeAnnotation. Changelog: [Internal] Differential Revision: D86501597
d241fed to
da43449
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Dec 2, 2025
…book#54489) Summary: Pull Request resolved: facebook#54489 Adding support for Unions in react-native-codegen & Compat Checker so that they can allow non-homogenous types and un-special casing StringLiteralUnionTypeAnnotation. Changelog: [Internal] Differential Revision: D86501597
da43449 to
4be9855
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Dec 2, 2025
…book#54489) Summary: Pull Request resolved: facebook#54489 Adding support for Unions in react-native-codegen & Compat Checker so that they can allow non-homogenous types and un-special casing StringLiteralUnionTypeAnnotation. Changelog: [Internal] Differential Revision: D86501597
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Dec 2, 2025
…book#54489) Summary: Pull Request resolved: facebook#54489 Adding support for Unions in react-native-codegen & Compat Checker so that they can allow non-homogenous types and un-special casing StringLiteralUnionTypeAnnotation. Changelog: [Internal] Differential Revision: D86501597
688e51d to
cfbdd4a
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Dec 2, 2025
…book#54489) Summary: Pull Request resolved: facebook#54489 Adding support for Unions in react-native-codegen & Compat Checker so that they can allow non-homogenous types and un-special casing StringLiteralUnionTypeAnnotation. Changelog: [Internal] Differential Revision: D86501597
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Dec 2, 2025
…book#54489) Summary: Pull Request resolved: facebook#54489 Adding support for Unions in react-native-codegen & Compat Checker so that they can allow non-homogenous types and un-special casing StringLiteralUnionTypeAnnotation. Changelog: [Internal] Differential Revision: D86501597
cee3b22 to
0eb6c8b
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Dec 3, 2025
…book#54489) Summary: Pull Request resolved: facebook#54489 Adding support for Unions in react-native-codegen & Compat Checker so that they can allow non-homogenous types and un-special casing StringLiteralUnionTypeAnnotation. Changelog: [Internal] Differential Revision: D86501597
0eb6c8b to
e12fb39
Compare
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Dec 3, 2025
…book#54489) Summary: Pull Request resolved: facebook#54489 Adding support for Unions in react-native-codegen & Compat Checker so that they can allow non-homogenous types and un-special casing `StringLiteralUnionTypeAnnotation`. Changelog: [Internal] **NOTE:** In case this needs to be reverted for any breakage to OTA Compat Checker v2, consider disabling it with D88289605 instead of reverting this change. Differential Revision: D86501597
…book#54489) Summary: Pull Request resolved: facebook#54489 Adding support for Unions in react-native-codegen & Compat Checker so that they can allow non-homogenous types and un-special casing `StringLiteralUnionTypeAnnotation`. Changelog: [Internal] **NOTE:** In case this needs to be reverted for any breakage to OTA Compat Checker v2, consider disabling it with D88289605 instead of reverting this change. Reviewed By: RSNara Differential Revision: D86501597
e12fb39 to
90c3102
Compare
Collaborator
|
This pull request was successfully merged by @arushikesarwani94 in 95cc1e7 When will my fix make it into a release? | How to file a pick request? |
|
This pull request has been merged in 95cc1e7. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
Merged
This PR has been merged.
meta-exported
p: Facebook
Partner: Facebook
Partner
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Previously, the parser was mapping to Array when the element types of union were different. This caused compat checker to not recognize changes in unions of different types.
StringLiteralUnionTypeAnnotationalready had support fortypes, that can be expanded to all Union types so as to incorporate the Unions of different types.NOTE: Generators behavior still remain unchanged hence don't allow unions of different types. Only RN Compat Checker consumes this.
The value of this is that the compat checker can now error when the union of different types changes.
Changelog: [Internal]
Differential Revision: D86501597