-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: refactor project to use Promise.withResolvers
#54836
Conversation
Review requested:
|
bc7bdeb
to
3e6cec1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After all these years - this is still a bad API but we might as well use the official one :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anonrig could this have any impact on pref?
Should any benchmarks be run?
I think it will improve performance but I'm not sure. Once the tests pass, let's have a benchmark ci just to be sure. |
|
It seems like it can be removed by a v8 flag: https://github.com/v8/v8/blob/3b12a031d2293acf01872e213473c8657671c8db/src/init/bootstrapper.cc#L5585 |
We should probably wait for 20.x to be in maintenance so it does not create conflicts when backporting other PRs (we could also wait for V8 to drop the flag, but we don't officially support running Node.js with undocumented flags, so that's not a blocker) |
@anonrig ... I see you marked this |
Alternatively, if we choose to backport this, we could also choose to polyfill |
We've decided that any change to globally available APIs would be semver-major in #54330 (I mean it hasn't landed yet, but it already has your approval 😅), so backporting to v20.x is a no-go. |
0c08b61
to
c69b907
Compare
Blocked on #55115 |
This needs a rebase. |
# Conflicts: # lib/internal/blob.js # lib/internal/test_runner/harness.js # lib/internal/test_runner/runner.js # test/parallel/test-runner-run-watch.mjs # test/parallel/test-runner-watch-mode-complex.mjs # test/parallel/test-runner-watch-mode.mjs
Co-authored-by: Antoine du Hamel <[email protected]>
4adca35
to
df1b7e5
Compare
Landed in bb8cc65 |
PR-URL: #54836 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
PR-URL: nodejs#54836 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
PR-URL: nodejs#54836 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
This commit does not land cleanly on |
PR-URL: #54836 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
PR-URL: #54836 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Node.js v22+ supports
Promise.withResolvers()
. Let's use them!