feat: [TypeScript] Add missing methods types Promise.try + Promise.withResolvers#57215
Open
retyui wants to merge 1 commit into
Open
feat: [TypeScript] Add missing methods types Promise.try + Promise.withResolvers#57215retyui wants to merge 1 commit into
Promise.try + Promise.withResolvers#57215retyui wants to merge 1 commit into
Conversation
Contributor
Author
|
workaround: devs can add on the project level: // ./tsconfig.json
{
"extends": "@react-native/typescript-config",
"compilerOptions": {
"types": ["jest"],
+ "lib": [
+ "es2019",
+ "es2020.bigint",
+ "es2020.date",
+ "es2020.number",
+ "es2020.promise",
+ "es2020.string",
+ "es2020.symbol.wellknown",
+ "es2021.promise",
+ "es2021.string",
+ "es2021.weakref",
+ "es2022.array",
+ "es2022.object",
+ "es2022.string",
+ "es2024.promise",
+ "esnext.promise"
+ ]
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["**/node_modules", "**/Pods"]
}
|
|
@fabriziocucci has imported this pull request. If you are a Meta employee, you can view this in D108745447. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
New methods
Promise.tryandPromise.withResolverswere added to the Hermes V1 branch, see: facebook/hermes#2020I tested them on the latest RN 0.86.0, and they are working:
es2024.promise- includesPromise.withResolversesnext.promise- includesPromise.tryChangelog:
[GENERAL] [ADDED] - Add
Promise.try+Promise.withResolverstypescript typesTest Plan: