Uh oh!
There was an error while loading. Please reload this page.
feature: Update Image.getSize/getSizeWithHeaders methods to return a promise - #42895
feature: Update Image.getSize/getSizeWithHeaders methods to return a promise#42895retyui wants to merge 1 commit into
Image.getSize/getSizeWithHeaders methods to return a promise#42895Conversation
Image.getSize method to return a promiseImage.getSize/getSizeWithHeaders methods to return a promiseUh oh!
There was an error while loading. Please reload this page.
e54c366 to
c690ad9Compare
This comment was marked as outdated.
This comment was marked as outdated.
cipolleschi
commented
Feb 7, 2024
/rebase - this commet will rebase the PR on top of main automatically. All these changes are JS changes only, there is no reason why the native builds should fail. Let's see if a rebase fixes CI. |
c690ad9 to
65fb75cCompare65fb75c to
46bb41fCompare46bb41f to
42bd4aaCompareanalysis-bot
commented
Feb 7, 2024
Base commit: c1b8f37 |
facebook-github-bot
commented
Feb 19, 2024
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
the |
cipolleschi
commented
Feb 26, 2024
I was looking into that. There is an internal E2E test that is failing and I need to understand why. I'll probably look into it tomorrow morning, as the day is almost over and I have another meeting coming up. :( |
This pull request was successfully merged by @retyui in 2c1bcba. When will my fix make it into a release? | Upcoming Releases |
Summary:
Image.getSize/getSizeWithHeadersare still working in old fashioned "callback" wayBut in 2024 more developers prefer use async/await syntax for asynchronous operations
So, in this PR I added support for Promise API with backward compatibility, modern way:
Changelog:
[GENERAL] [ADDED] -
Image.getSize/getSizeWithHeadersmethod returns a promise if you don't pass asuccesscallbackTest Plan:
a.
node_modules/react-native/Libraries/Image/Image.android.jsb.
node_modules/react-native/Libraries/Image/Image.ios.js