Skip to content

refactor(core): use native Promise.withResolvers() in tests#69739

Draft
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:use-native-Promise.withResolvers
Draft

refactor(core): use native Promise.withResolvers() in tests#69739
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:use-native-Promise.withResolvers

Conversation

@MeAkib

@MeAkib MeAkib commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Based on #69686 (comment)

Since Promise.withResolvers() is available natively now, we should use that instead of introducing a new utility.

Replaces the temporary promiseWithResolvers polyfill with the native Promise.withResolvers() API now that it is supported by both the runtime and TypeScript.

Also removes the polyfill and its exports, and updates the TypeScript configuration to include the es2024 library.

@pullapprove pullapprove Bot requested review from JeanMeche and josephperrott July 11, 2026 01:46
@angular-robot angular-robot Bot added the area: core Issues related to the framework runtime label Jul 11, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jul 11, 2026
@JeanMeche

Copy link
Copy Markdown
Member

We cannot use Promise.withResolvers outside of our test files. Its not "widely available" yet: https://web-platform-dx.github.io/web-features-explorer/features/promise-withresolvers/

@JeanMeche JeanMeche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please only replace it in the test files.

Replaces the temporary `promiseWithResolvers` polyfill with the
native `Promise.withResolvers()` API in test files and Updates the TypeScript configuration to include the `es2024.promise`.
@MeAkib MeAkib force-pushed the use-native-Promise.withResolvers branch from 70f2a94 to ec3ede4 Compare July 11, 2026 02:09
@MeAkib MeAkib changed the title refactor(core): use native Promise.withResolvers() refactor(core): use native Promise.withResolvers() in tests Jul 11, 2026
@MeAkib MeAkib marked this pull request as draft July 11, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Issues related to the framework runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants