Repository navigation
refactor(core): use native Promise.withResolvers() in tests - #69739
Merged
Merged
Conversation
Member
|
We cannot use |
JeanMeche
requested changes
Jul 11, 2026
JeanMeche
left a comment
Member
There was a problem hiding this comment.
Please only replace it in the test files.
MeAkib
force-pushed
the
use-native-Promise.withResolvers
branch
from
July 11, 2026 02:09
70f2a94 to
ec3ede4
Compare
Promise.withResolvers()Promise.withResolvers() in tests
MeAkib
marked this pull request as draft
July 11, 2026 02:39
JeanMeche
approved these changes
Jul 11, 2026
Member
|
As mentioned this is not widely available yet. As such we do not want to replace it in our tests yet either to allow for our tests to be run in real browser environments which may not have support yet. |
Member
|
I do think our browser testing set supports it but we're still missing some type definitions.. |
MeAkib
force-pushed
the
use-native-Promise.withResolvers
branch
from
July 20, 2026 19:43
ec3ede4 to
3090768
Compare
JeanMeche
reviewed
Jul 20, 2026
| @@ -28,7 +28,7 @@ | |||
| }, | |||
| "rootDir": ".", | |||
| "inlineSourceMap": true, | |||
| "lib": ["es2022", "dom", "dom.iterable"], | |||
| "lib": ["es2022", "dom", "dom.iterable", "es2024.promise"], | |||
Member
There was a problem hiding this comment.
I believe we can drop this change.
Contributor
Author
JeanMeche
reviewed
Jul 20, 2026
Replaces the temporary `promiseWithResolvers` polyfill with the native `Promise.withResolvers()` API in test files and Updates the TypeScript configuration to include the `es2024.promise`.
JeanMeche
force-pushed
the
use-native-Promise.withResolvers
branch
from
July 21, 2026 07:13
79d9626 to
0511142
Compare
JeanMeche
marked this pull request as ready for review
July 21, 2026 07:23
JeanMeche
requested review from
alan-agius4
and removed request for
josephperrott
August 17, 2026 20:05
alan-agius4
approved these changes
Sep 1, 2026
Member
MeAkib
added a commit
to MeAkib/angular
that referenced
this pull request
Sep 6, 2026
Follow-up to angular#69739, applying the same change to the test suites that still hand-roll the deferred promise idiom: declaring an outer `resolve`/`reject` binding and capturing the executor arguments into it. Also drops the last two stand-ins for the native API — the `promiseWithResolvers` import in `resource_spec.ts` and the local `createPromise()` helper in the router's `bootstrap.spec.ts`. No configuration change is needed here: `packages/tsconfig-build.json` already lists `es2024.promise`, and zone.js implements `withResolvers()` on `ZoneAwarePromise`, so both the node and browser test targets pick the native API up. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
MeAkib
added a commit
to MeAkib/angular
that referenced
this pull request
Sep 6, 2026
Replaces the remaining hand-rolled deferred promise implementations with the native `Promise.withResolvers()` API and removes the now unused helper and import. Follow-up to angular#69739.
MeAkib
added a commit
to MeAkib/angular
that referenced
this pull request
Sep 6, 2026
Replaces the remaining hand-rolled deferred promise implementations with the native `Promise.withResolvers()` API and removes the now unused helper and import. Follow-up to angular#69739.
crisbeto
pushed a commit
that referenced
this pull request
Sep 9, 2026
Replaces the remaining hand-rolled deferred promise implementations with the native `Promise.withResolvers()` API and removes the now unused helper and import. Follow-up to #69739.
MeAkib
added a commit
to MeAkib/angular
that referenced
this pull request
Sep 28, 2026
…t files Replaces the remaining hand-rolled deferred promises in test-only files with the native `Promise.withResolvers()` API. Follow-up to angular#69739.
atscott
pushed a commit
that referenced
this pull request
Sep 28, 2026
…t files Replaces the remaining hand-rolled deferred promises in test-only files with the native `Promise.withResolvers()` API. Follow-up to #69739.
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.

Based on #69686 (comment)
Replaces the temporary
promiseWithResolverspolyfill with the nativePromise.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
es2024library.