Skip to content

Cherrypick Promise.try and Promise.withResolvers to the Hermes V1 branch (250829098.0.0-stable)#2020

Merged
lavenzg merged 1 commit into
facebook:250829098.0.0-stablefrom
retyui:feat/retyui/Promise.try-222
May 14, 2026
Merged

Cherrypick Promise.try and Promise.withResolvers to the Hermes V1 branch (250829098.0.0-stable)#2020
lavenzg merged 1 commit into
facebook:250829098.0.0-stablefrom
retyui:feat/retyui/Promise.try-222

Conversation

@retyui

@retyui retyui commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Based on this conversations: #2018 (comment)

Test Plan

LIT_OPTS="-j1" LIT_FILTER="promise-try.js" cmake --build build --target check-hermes
LIT_OPTS="-j1" LIT_FILTER="promise-withResolvers.js" cmake --build build --target check-hermes

@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 14, 2026
@lavenzg

lavenzg commented May 14, 2026

Copy link
Copy Markdown
Contributor

Thanks for making the PR!

@lavenzg lavenzg merged commit af831bb into facebook:250829098.0.0-stable May 14, 2026
26 checks passed
meta-codesync Bot pushed a commit that referenced this pull request May 15, 2026
Summary:
The PR is merged into stable, we need to port to current staging so
that it will be still usable in next stable release. Our own Promise
improvements are only included in static_h branch and will be
available in next staging release.

Reviewed By: tmikov

Differential Revision: D105240151

fbshipit-source-id: ab1c080c8c58ead964c44dd63d1059ca2c481184
@retyui

retyui commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

It's working, React Native 0.86.x:

{
  "Promise.try": [Function anonymous], 
  "Promise.withResolvers": [Function anonymous], 
  "ReactNativeVersion.getVersionString()": "0.86.0"
}

meta-codesync Bot pushed a commit to react/react-native that referenced this pull request Jun 16, 2026
….withResolvers` (#57215)

Summary:
New methods `Promise.try` and `Promise.withResolvers` were added to the Hermes V1 branch, see: facebook/hermes#2020

I tested them on the latest RN 0.86.0, and they are working:
```tsx
console.log({
  'ReactNativeVersion.getVersionString()':ReactNativeVersion.getVersionString(),
  'Promise.try': Promise.try,
  'Promise.withResolvers': Promise.withResolvers,
});
//{
//  "Promise.try": [Function anonymous],
//  "Promise.withResolvers": [Function anonymous],
//  "ReactNativeVersion.getVersionString()": "0.86.0"
// }
```

- `es2024.promise` - includes `Promise.withResolvers`
- `esnext.promise` - includes `Promise.try`

## Changelog:

[GENERAL] [ADDED] - Add `Promise.try` + `Promise.withResolvers` typescript types

Pull Request resolved: #57215

Test Plan:
```
edit `node_modules/react-native/typescript-config/tsconfig.json`
add `es2024.promise` `esnext.promise`
try to use new methods in ts files

// no error expected
```

Reviewed By: robhogan

Differential Revision: D108745447

Pulled By: fabriziocucci

fbshipit-source-id: dfebe404ab45bc4cb9071692d2f13c42b2816e51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants