-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
simple support to the Partial<T> annotation #35960
Closed
Closed
Conversation
This file contains 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
Summary: This feature allows using `$Partial<Obj>` in flow and `Partial<Obj>` in TypeScript based on the spec mentioned here: https://flow.org/en/docs/types/utilities/#toc-partial. We currently only allow passing an Obj to Partial so ``` export type SomeObj = { a: string, b?: boolean, }; export type PartialSomeObj = Partial<SomeObj>; ``` should work. and also- ``` export type PartialSomeObj = Partial<{ a: string, b?: boolean, }>; ``` But not ``` export type PartialSomeObj = Partial<Partial<{ a: string, b?: boolean, }>>; ``` This can be improved in the future by a recursive unwrapping of the value inside the `Partial` annotation. Changelog: [General] [Added] - Allow the use of "Partial<T>" in Turbo Module specs. Reviewed By: christophpurrer, cipolleschi Differential Revision: D42640880 fbshipit-source-id: 380cecceeef501c6021e61152efb238b98138e7e
facebook-github-bot
added
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
p: Facebook
Partner: Facebook
Partner
labels
Jan 25, 2023
react-native-bot
added
the
Type: Enhancement
A new feature or enhancement of an existing feature.
label
Jan 25, 2023
This pull request was exported from Phabricator. Differential Revision: D42640880 |
Base commit: 2bfb53c |
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Jan 25, 2023
Summary: Pull Request resolved: facebook#35960 This feature allows using `$Partial<Obj>` in flow and `Partial<Obj>` in TypeScript based on the spec mentioned here: https://flow.org/en/docs/types/utilities/#toc-partial. We currently only allow passing an Obj to Partial so ``` export type SomeObj = { a: string, b?: boolean, }; export type PartialSomeObj = Partial<SomeObj>; ``` should work. and also- ``` export type PartialSomeObj = Partial<{ a: string, b?: boolean, }>; ``` But not ``` export type PartialSomeObj = Partial<Partial<{ a: string, b?: boolean, }>>; ``` This can be improved in the future by a recursive unwrapping of the value inside the `Partial` annotation. Changelog: [General] [Added] - Allow the use of "Partial<T>" in Turbo Module specs. Reviewed By: christophpurrer, cipolleschi Differential Revision: D42640880 fbshipit-source-id: 414653ab443969a0d0f15aab5131dc27c05a91fe
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Jan 25, 2023
Summary: Pull Request resolved: facebook#35961 Pull Request resolved: facebook#35960 This fixes facebook#35864 This feature allows using `$Partial<Obj>` in flow and `Partial<Obj>` in TypeScript based on the spec mentioned here: https://flow.org/en/docs/types/utilities/#toc-partial. We currently only allow passing an Obj to Partial so ``` export type SomeObj = { a: string, b?: boolean, }; export type PartialSomeObj = Partial<SomeObj>; ``` should work. and also- ``` export type PartialSomeObj = Partial<{ a: string, b?: boolean, }>; ``` But not ``` export type PartialSomeObj = Partial<Partial<{ a: string, b?: boolean, }>>; ``` This can be improved in the future by a recursive unwrapping of the value inside the `Partial` annotation. Changelog: [General] [Added] - Allow the use of "Partial<T>" in Turbo Module specs. Reviewed By: christophpurrer, cipolleschi Differential Revision: D42640880 fbshipit-source-id: 7f55e6cb2eec41f5e9d085b21b9ffd658b665140
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Jan 25, 2023
Summary: Pull Request resolved: facebook#35961 Pull Request resolved: facebook#35960 This fixes facebook#35864 This feature allows using `$Partial<Obj>` in flow and `Partial<Obj>` in TypeScript based on the spec mentioned here: https://flow.org/en/docs/types/utilities/#toc-partial. We currently only allow passing an Obj to Partial so ``` export type SomeObj = { a: string, b?: boolean, }; export type PartialSomeObj = Partial<SomeObj>; ``` should work. and also- ``` export type PartialSomeObj = Partial<{ a: string, b?: boolean, }>; ``` But not ``` export type PartialSomeObj = Partial<Partial<{ a: string, b?: boolean, }>>; ``` This can be improved in the future by a recursive unwrapping of the value inside the `Partial` annotation. Changelog: [General] [Added] - Allow the use of "Partial<T>" in Turbo Module specs. Reviewed By: christophpurrer, cipolleschi Differential Revision: D42640880 fbshipit-source-id: eba1ef64dd3a0c95d267a04f9e56cb8641ccbbf2
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Jan 26, 2023
Summary: Pull Request resolved: facebook#35961 Pull Request resolved: facebook#35960 This fixes facebook#35864 This feature allows using `$Partial<Obj>` in flow and `Partial<Obj>` in TypeScript based on the spec mentioned here: https://flow.org/en/docs/types/utilities/#toc-partial. We currently only allow passing an Obj to Partial so ``` export type SomeObj = { a: string, b?: boolean, }; export type PartialSomeObj = Partial<SomeObj>; ``` should work. and also- ``` export type PartialSomeObj = Partial<{ a: string, b?: boolean, }>; ``` But not ``` export type PartialSomeObj = Partial<Partial<{ a: string, b?: boolean, }>>; ``` This can be improved in the future by a recursive unwrapping of the value inside the `Partial` annotation. Changelog: [General] [Added] - Allow the use of "Partial<T>" in Turbo Module specs. Reviewed By: christophpurrer, cipolleschi Differential Revision: D42640880 fbshipit-source-id: e0b863c6863c312cc7b77438b326bfa5ed845d33
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Jan 26, 2023
Summary: Pull Request resolved: facebook#35961 Pull Request resolved: facebook#35960 This fixes facebook#35864 This feature allows using `$Partial<Obj>` in flow and `Partial<Obj>` in TypeScript based on the spec mentioned here: https://flow.org/en/docs/types/utilities/#toc-partial. We currently only allow passing an Obj to Partial so ``` export type SomeObj = { a: string, b?: boolean, }; export type PartialSomeObj = Partial<SomeObj>; ``` should work. and also- ``` export type PartialSomeObj = Partial<{ a: string, b?: boolean, }>; ``` But not ``` export type PartialSomeObj = Partial<Partial<{ a: string, b?: boolean, }>>; ``` This can be improved in the future by a recursive unwrapping of the value inside the `Partial` annotation. Changelog: [General] [Added] - Allow the use of "Partial<T>" in Turbo Module specs. Reviewed By: christophpurrer, cipolleschi Differential Revision: D42640880 fbshipit-source-id: 0caf8a600313d27efed83696359d0b3eca025303
facebook-github-bot
pushed a commit
that referenced
this pull request
Jan 26, 2023
Summary: Pull Request resolved: #35961 Pull Request resolved: #35960 This fixes #35864 This feature allows using `$Partial<Obj>` in flow and `Partial<Obj>` in TypeScript based on the spec mentioned here: https://flow.org/en/docs/types/utilities/#toc-partial. We currently only allow passing an Obj to Partial so ``` export type SomeObj = { a: string, b?: boolean, }; export type PartialSomeObj = Partial<SomeObj>; ``` should work. and also- ``` export type PartialSomeObj = Partial<{ a: string, b?: boolean, }>; ``` But not ``` export type PartialSomeObj = Partial<Partial<{ a: string, b?: boolean, }>>; ``` This can be improved in the future by a recursive unwrapping of the value inside the `Partial` annotation. Changelog: [General] [Added] - Allow the use of "Partial<T>" in Turbo Module specs. Reviewed By: christophpurrer, cipolleschi Differential Revision: D42640880 fbshipit-source-id: 03a3fccc38ccfc7a5440fe11893beb68e77753f3
OlimpiaZurek
pushed a commit
to OlimpiaZurek/react-native
that referenced
this pull request
May 22, 2023
Summary: Pull Request resolved: facebook#35961 Pull Request resolved: facebook#35960 This fixes facebook#35864 This feature allows using `$Partial<Obj>` in flow and `Partial<Obj>` in TypeScript based on the spec mentioned here: https://flow.org/en/docs/types/utilities/#toc-partial. We currently only allow passing an Obj to Partial so ``` export type SomeObj = { a: string, b?: boolean, }; export type PartialSomeObj = Partial<SomeObj>; ``` should work. and also- ``` export type PartialSomeObj = Partial<{ a: string, b?: boolean, }>; ``` But not ``` export type PartialSomeObj = Partial<Partial<{ a: string, b?: boolean, }>>; ``` This can be improved in the future by a recursive unwrapping of the value inside the `Partial` annotation. Changelog: [General] [Added] - Allow the use of "Partial<T>" in Turbo Module specs. Reviewed By: christophpurrer, cipolleschi Differential Revision: D42640880 fbshipit-source-id: 03a3fccc38ccfc7a5440fe11893beb68e77753f3
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
p: Facebook
Partner: Facebook
Partner
Type: Enhancement
A new feature or enhancement of an existing feature.
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:
This feature allows using
$Partial<Obj>
in flow andPartial<Obj>
in TypeScript based on the spec mentioned here: https://flow.org/en/docs/types/utilities/#toc-partial.We currently only allow passing an Obj to Partial so
should work.
and also-
But not
This can be improved in the future by a recursive unwrapping of the value inside the
Partial
annotation.Changelog:
[General] [Added] - Allow the use of "Partial" in Turbo Module specs.
Reviewed By: christophpurrer, cipolleschi
Differential Revision: D42640880