Closed Bug 1864821 Opened 2 years ago Closed 2 years ago

Replace PromiseUtils.defer with Promise.withResolvers

Categories

(Toolkit :: Async Tooling, task, P3)

task

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(5 files)

Promise.withResolvers is shipping in 121. Once we know it is stable (i.e. when 121 is shipping/about to ship), we should replace our internal PromiseUtils.defer implementation with it.

It looks like the return result of our implementation already matches withResolvers, so it should be a simple replace & tidy up imports.

It might be nice to remove PromiseUtils.sys.mjs completely, but that also requires working out what to do with PromiseUtils.idleDispatch which might be better for a follow-up bug.

Severity: -- → N/A
Priority: -- → P3
Assignee: nobody → standard8
Status: NEW → ASSIGNED

Depends on D197489

Mark -- how did you do this rewrite? Did you use jscodeshift? If so, can you share your script?

Flags: needinfo?(standard8)

(In reply to Nick Alexander :nalexander [he/him] from comment #6)

Mark -- how did you do this rewrite? Did you use jscodeshift? If so, can you share your script?

I probably should have used something like that, but I actually did it mainly via search & replace in VS Code.

Flags: needinfo?(standard8)
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f0f477492d58 Replace PromiseUtils.defer() with Promise.withResolvers() in browser window scopes. r=Gijs,extension-reviewers,application-update-reviewers,rpl,nalexander https://hg.mozilla.org/integration/autoland/rev/a153350a94b5 Fix timing in PageData's test_queue.js and switch to use Promise.withResolvers(). r=Gijs https://hg.mozilla.org/integration/autoland/rev/1312d3b498c2 Replace PromiseUtils.defer() with Promise.withResolvers() in extension code. r=extension-reviewers,geckoview-reviewers,rpl,m_kato https://hg.mozilla.org/integration/autoland/rev/72ada31bf7ca Replace PromiseUtils.defer() with Promise.withResolvers() in system modules. r=Gijs,perftest-reviewers,necko-reviewers,extension-reviewers,application-update-reviewers,fxview-reviewers,sync-reviewers,sessionstore-reviewers,reusable-components-reviewers,rpl,jesup,hjones,kshampur,skhamis,nalexander,sclements https://hg.mozilla.org/integration/autoland/rev/a1da4237db8e Remove PromiseUtils.defer(). r=Gijs
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: