GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — timers: add experimental scheduler api by jasnell · Pull Request #40909 · nodejs/node

Conversation

@jasnell

@jasnell jasnell commented Nov 21, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Adds experimental implementations of the yield and wait APIs being
explored at https://github.com/WICG/scheduling-apis.

When I asked the WHATWG folks about the possibility of standardizing the
awaitable versions of setTimeout/setImmediate
that we have implemented in timers/promises, they pointed at the work
in progress scheduling APIs draft as they direction they'll be going.
While there is definitely a few thing in that draft that have
questionable utility to Node.js, the yield and wait APIs map cleanly to
the setImmediate and setTimeout we already have.

const { scheduler } = require('timers/promises');

await scheduler.wait(1000);  // Continue after 1 second

await scheduler.yield();  // Continue after this turn of the event loop

Signed-off-by: James M Snell [email protected]

/cc @mcollina

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

benjamingr, bricss, sindresorhus, lin72h, punkeel, dnalborczyk, simonplend, voxpelli, and ra100 reacted with thumbs up emoji bricss and ilhamgusti reacted with eyes emoji
All reactions
  • 👍 9 reactions
  • 👀 2 reactions
@jasnell jasnell added timers Issues and PRs related to timers, setImmediate(), setInterval(), and setTimeout(). semver-minor PRs that contain new features and should be released in the next minor version. experimental Issues and PRs related to experimental features. labels Nov 21, 2021
benjamingr
benjamingr reviewed Nov 21, 2021
View reviewed changes

@benjamingr benjamingr left a comment

Copy link
Copy Markdown
Member

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.

This is really cool. Note when I proposed implementing the "overlaying" API (scheduler.postTask) in the past people were opposed in core.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasnell

jasnell commented Nov 21, 2021

Copy link
Copy Markdown
Member Author

Yep, I happen to agree that postTask() likely doesn't make sense here, but I'm certainly willing to entertain it, but not in this PR :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Nov 21, 2021
@benjamingr

benjamingr commented Nov 21, 2021

Copy link
Copy Markdown
Member

cc @nodejs/timers

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@benjamingr

benjamingr commented Nov 21, 2021

Copy link
Copy Markdown
Member

Are there WPTs for this API?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Nov 21, 2021

Copy link
Copy Markdown
Member Author

Not yet. There are scheduler API tests in WPT but they currently focus entirely on the postTask and TaskManager APIs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@devsnek

devsnek commented Nov 21, 2021

Copy link
Copy Markdown
Member

this is very cool. shouldn't it be flagged if it's experimental?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Nov 21, 2021

Copy link
Copy Markdown
Member Author

Since it requires explicit opt in by requiring, a flag shouldn't be necessary and really wouldn't be helpful

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Nov 21, 2021
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

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.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mcollina mcollina added the notable-change PRs with changes that should be highlighted in changelogs. label Nov 21, 2021
Mesteery
Mesteery reviewed Nov 21, 2021
View reviewed changes
Comment thread lib/timers/promises.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/timers/promises.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Mesteery

Mesteery commented Nov 21, 2021

Copy link
Copy Markdown
Contributor

Shouldn't the Scheduler constructor be private like for Performance?

new performance.constructor; // illegal
new timers.promises.scheduler.constructor; // allowed, in Chrome: illegal
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aduh95
aduh95 approved these changes Nov 22, 2021
View reviewed changes
@nodejs-github-bot

This comment has been minimized.

Sign in to view
benjamingr
benjamingr approved these changes Nov 23, 2021
View reviewed changes
aduh95
aduh95 reviewed Nov 23, 2021
View reviewed changes
Comment thread doc/api/timers.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@aduh95 aduh95 added author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Nov 23, 2021
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 23, 2021
@nodejs-github-bot

This comment has been minimized.

Sign in to view
This was referenced Nov 24, 2021
CI Reliability 2021-11-24 nodejs/reliability#127
Open
CI Reliability 2021-11-25 nodejs/reliability#128
Open
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@sindresorhus sindresorhus mentioned this pull request Nov 25, 2021
Rule proposal: prefer-queue-microtask sindresorhus/eslint-plugin-unicorn#1346
Closed
This was referenced Nov 26, 2021
CI Reliability 2021-11-26 nodejs/reliability#129
Open
CI Reliability 2021-11-27 nodejs/reliability#130
Open
danielleadams added a commit that referenced this pull request Dec 14, 2021
@danielleadams
2021-12-14, Version 17.3.0 (Current)
99c57db
Notable changes:

* lib:
  * make AbortSignal cloneable/transferable (James M Snell) #41050
* deps:
  * upgrade npm to 8.3.0 (npm team) #41127
* doc:
  * add @bnb as a collaborator (Tierney Cyren) #41100
* timers:
  * add experimental scheduler api (James M Snell) #40909

PR-URL: #41167
danielleadams added a commit that referenced this pull request Dec 16, 2021
@danielleadams
2021-12-16, Version 17.3.0 (Current)
6daa15f
OpenSSL-3.0.1:

OpenSSL-3.0.1 contains a fix for CVE-2021-4044: Invalid handling of X509_verify_cert() internal errors in libssl (Moderate). This is a vulnerability in OpenSSL that may be exploited through Node.js. More information can be read here: https://www.openssl.org/news/secadv/20211214.txt.

Contributed by Richard Lau #41177

Other Notable Changes:

* lib:
  * make AbortSignal cloneable/transferable (James M Snell) #41050
* deps:
  * upgrade npm to 8.3.0 (npm team) #41127
* doc:
  * add @bnb as a collaborator (Tierney Cyren) #41100
* process:
  * add `getActiveResourcesInfo()` (Darshan Sen) #40813
* timers:
  * add experimental scheduler api (James M Snell) #40909

PR-URL: #41167
danielleadams added a commit that referenced this pull request Dec 17, 2021
@danielleadams
2021-12-17, Version 17.3.0 (Current)
e5873d7
OpenSSL-3.0.1:

OpenSSL-3.0.1 contains a fix for CVE-2021-4044: Invalid handling of X509_verify_cert() internal errors
in libssl (Moderate). This is a vulnerability in OpenSSL that may be exploited through Node.js.
More information can be read here: https://www.openssl.org/news/secadv/20211214.txt.

Contributed by Richard Lau #41177

Other Notable Changes:

* lib:
    * make AbortSignal cloneable/transferable (James M Snell) #41050
* deps:
    * upgrade npm to 8.3.0 (npm team) #41127
* doc:
    * add @bnb as a collaborator (Tierney Cyren) #41100
* process:
    * add `getActiveResourcesInfo()` (Darshan Sen) #40813
* timers:
    * add experimental scheduler api (James M Snell) #40909

PR-URL: #41167
danielleadams added a commit that referenced this pull request Dec 17, 2021
@danielleadams
2021-12-17, Version 17.3.0 (Current)
aeb9c0e
OpenSSL-3.0.1:

OpenSSL-3.0.1 contains a fix for CVE-2021-4044: Invalid handling of X509_verify_cert() internal errors
in libssl (Moderate). This is a vulnerability in OpenSSL that may be exploited through Node.js.
More information can be read here: https://www.openssl.org/news/secadv/20211214.txt.

Contributed by Richard Lau #41177

Other Notable Changes:

* lib:
    * make AbortSignal cloneable/transferable (James M Snell) #41050
* deps:
    * upgrade npm to 8.3.0 (npm team) #41127
* doc:
    * add @bnb as a collaborator (Tierney Cyren) #41100
* process:
    * add `getActiveResourcesInfo()` (Darshan Sen) #40813
* timers:
    * add experimental scheduler api (James M Snell) #40909

PR-URL: #41167
danielleadams pushed a commit that referenced this pull request Jan 31, 2022
@jasnell @danielleadams
timers: add experimental scheduler api
9c213cf
Adds experimental implementations of the yield and wait APIs being
explored at https://github.com/WICG/scheduling-apis.

When I asked the WHATWG folks about the possibility of standardizing the
[awaitable versions of setTimeout/setImmediate](whatwg/html#7340)
that we have implemented in `timers/promises`, they pointed at the work
in progress scheduling APIs draft as they direction they'll be going.
While there is definitely a few thing in that draft that have
questionable utility to Node.js, the yield and wait APIs map cleanly to
the setImmediate and setTimeout we already have.

Signed-off-by: James M Snell <[email protected]>

PR-URL: #40909
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
danielleadams pushed a commit that referenced this pull request Jan 31, 2022
@jasnell @danielleadams
timers: add experimental scheduler api
514dab6
Adds experimental implementations of the yield and wait APIs being
explored at https://github.com/WICG/scheduling-apis.

When I asked the WHATWG folks about the possibility of standardizing the
[awaitable versions of setTimeout/setImmediate](whatwg/html#7340)
that we have implemented in `timers/promises`, they pointed at the work
in progress scheduling APIs draft as they direction they'll be going.
While there is definitely a few thing in that draft that have
questionable utility to Node.js, the yield and wait APIs map cleanly to
the setImmediate and setTimeout we already have.

Signed-off-by: James M Snell <[email protected]>

PR-URL: #40909
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
danielleadams pushed a commit that referenced this pull request Feb 1, 2022
@jasnell @danielleadams
timers: add experimental scheduler api
c5f9e96
Adds experimental implementations of the yield and wait APIs being
explored at https://github.com/WICG/scheduling-apis.

When I asked the WHATWG folks about the possibility of standardizing the
[awaitable versions of setTimeout/setImmediate](whatwg/html#7340)
that we have implemented in `timers/promises`, they pointed at the work
in progress scheduling APIs draft as they direction they'll be going.
While there is definitely a few thing in that draft that have
questionable utility to Node.js, the yield and wait APIs map cleanly to
the setImmediate and setTimeout we already have.

Signed-off-by: James M Snell <[email protected]>

PR-URL: #40909
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
@danielleadams danielleadams mentioned this pull request Feb 1, 2022
v16.14.0 proposal #41804
Merged
danielleadams added a commit that referenced this pull request Feb 1, 2022
@danielleadams
2022-02-01, Version 16.14.0 'Gallium' (LTS)
81e78c2
Notable changes

* async_hooks:
  * (SEMVER-MINOR) expose async\_wrap providers (Rafael Gonzaga) #40760
* child_process:
  * (SEMVER-MINOR) add support for URL to `cp.fork` (Antoine du Hamel) #41225
* doc:
  * add @Mesteery to collaborators (Mestery) #41543
  * add @bnb as a collaborator (Tierney Cyren) #41100
* esm:
  * (SEMVER-MINOR) add support for JSON import assertion (Antoine du Hamel) #40250
  * (SEMVER-MINOR) graduate capturerejections to supported (James M Snell) #41267
  * (SEMVER-MINOR) add EventEmitterAsyncResource to core (James M Snell) #41246
* events:
  * (SEMVER-MINOR) propagate weak option for kNewListener (James M Snell) #40899
* lib:
  * (SEMVER-MINOR) make AbortSignal cloneable/transferable (James M Snell) #41050
  * (SEMVER-MINOR) add AbortSignal.timeout (James M Snell) #40899
  * (SEMVER-MINOR) add reason to AbortSignal (James M Snell) #40807
  * (SEMVER-MINOR) add unsubscribe method to non-active DC channels (simon-id) #40433
  * (SEMVER-MINOR) add return value for DC channel.unsubscribe (simon-id) #40433
* perf_hooks:
  * (SEMVER-MINOR) multiple fixes for Histogram (James M Snell) #41153
* process:
  * (SEMVER-MINOR) add `getActiveResourcesInfo()` (Darshan Sen) #40813
* src:
  * (SEMVER-MINOR) add x509.fingerprint512 to crypto module (3nprob) #39809
  * (SEMVER-MINOR) add flags for controlling process behavior (Cheng Zhao) #40339
* stream:
  * (SEMVER-MINOR) add filter method to readable (Benjamin Gruenbaum) #41354
  * (SEMVER-MINOR) add isReadable helper (Robert Nagy) #41199
  * (SEMVER-MINOR) add map method to Readable (Benjamin Gruenbaum) #40815
  * deprecate thenable support (Antoine du Hamel) #40860
* util:
  * (SEMVER-MINOR) pass through the inspect function to custom inspect functions (Ruben Bridgewater) #41019
  * (SEMVER-MINOR) add numericSeparator to util.inspect (Ruben Bridgewater) #41003
  * (SEMVER-MINOR) always visualize cause property in errors during inspection (Ruben Bridgewater) #41002
* timers:
  * (SEMVER-MINOR) add experimental scheduler api (James M Snell) #40909
* v8:
  * (SEMVER-MINOR) multi-tenant promise hook api (Stephen Belanger) #39283

PR-URL: #41804
danielleadams added a commit that referenced this pull request Feb 1, 2022
@danielleadams
2022-02-08, Version 16.14.0 'Gallium' (LTS)
100b945
Notable changes

* async_hooks:
  * (SEMVER-MINOR) expose async\_wrap providers (Rafael Gonzaga) #40760
* child_process:
  * (SEMVER-MINOR) add support for URL to `cp.fork` (Antoine du Hamel) #41225
* doc:
  * add @Mesteery to collaborators (Mestery) #41543
  * add @bnb as a collaborator (Tierney Cyren) #41100
* esm:
  * (SEMVER-MINOR) add support for JSON import assertion (Antoine du Hamel) #40250
  * (SEMVER-MINOR) graduate capturerejections to supported (James M Snell) #41267
  * (SEMVER-MINOR) add EventEmitterAsyncResource to core (James M Snell) #41246
* events:
  * (SEMVER-MINOR) propagate weak option for kNewListener (James M Snell) #40899
* lib:
  * (SEMVER-MINOR) make AbortSignal cloneable/transferable (James M Snell) #41050
  * (SEMVER-MINOR) add AbortSignal.timeout (James M Snell) #40899
  * (SEMVER-MINOR) add reason to AbortSignal (James M Snell) #40807
  * (SEMVER-MINOR) add unsubscribe method to non-active DC channels (simon-id) #40433
  * (SEMVER-MINOR) add return value for DC channel.unsubscribe (simon-id) #40433
* perf_hooks:
  * (SEMVER-MINOR) multiple fixes for Histogram (James M Snell) #41153
* process:
  * (SEMVER-MINOR) add `getActiveResourcesInfo()` (Darshan Sen) #40813
* src:
  * (SEMVER-MINOR) add x509.fingerprint512 to crypto module (3nprob) #39809
  * (SEMVER-MINOR) add flags for controlling process behavior (Cheng Zhao) #40339
* stream:
  * (SEMVER-MINOR) add filter method to readable (Benjamin Gruenbaum) #41354
  * (SEMVER-MINOR) add isReadable helper (Robert Nagy) #41199
  * (SEMVER-MINOR) add map method to Readable (Benjamin Gruenbaum) #40815
  * deprecate thenable support (Antoine du Hamel) #40860
* util:
  * (SEMVER-MINOR) pass through the inspect function to custom inspect functions (Ruben Bridgewater) #41019
  * (SEMVER-MINOR) add numericSeparator to util.inspect (Ruben Bridgewater) #41003
  * (SEMVER-MINOR) always visualize cause property in errors during inspection (Ruben Bridgewater) #41002
* timers:
  * (SEMVER-MINOR) add experimental scheduler api (James M Snell) #40909
* v8:
  * (SEMVER-MINOR) multi-tenant promise hook api (Stephen Belanger) #39283

PR-URL: #41804
danielleadams added a commit that referenced this pull request Feb 5, 2022
@danielleadams
2022-02-08, Version 16.14.0 'Gallium' (LTS)
6ab4341
Notable changes

* async_hooks:
  * (SEMVER-MINOR) expose async\_wrap providers (Rafael Gonzaga) #40760
* child_process:
  * (SEMVER-MINOR) add support for URL to `cp.fork` (Antoine du Hamel) #41225
* doc:
  * add @Mesteery to collaborators (Mestery) #41543
  * add @bnb as a collaborator (Tierney Cyren) #41100
* esm:
  * (SEMVER-MINOR) add support for JSON import assertion (Antoine du Hamel) #40250
  * (SEMVER-MINOR) graduate capturerejections to supported (James M Snell) #41267
  * (SEMVER-MINOR) add EventEmitterAsyncResource to core (James M Snell) #41246
* events:
  * (SEMVER-MINOR) propagate weak option for kNewListener (James M Snell) #40899
* lib:
  * (SEMVER-MINOR) make AbortSignal cloneable/transferable (James M Snell) #41050
  * (SEMVER-MINOR) add AbortSignal.timeout (James M Snell) #40899
  * (SEMVER-MINOR) add reason to AbortSignal (James M Snell) #40807
  * (SEMVER-MINOR) add unsubscribe method to non-active DC channels (simon-id) #40433
  * (SEMVER-MINOR) add return value for DC channel.unsubscribe (simon-id) #40433
* perf_hooks:
  * (SEMVER-MINOR) multiple fixes for Histogram (James M Snell) #41153
* process:
  * (SEMVER-MINOR) add `getActiveResourcesInfo()` (Darshan Sen) #40813
* src:
  * (SEMVER-MINOR) add x509.fingerprint512 to crypto module (3nprob) #39809
  * (SEMVER-MINOR) add flags for controlling process behavior (Cheng Zhao) #40339
* stream:
  * (SEMVER-MINOR) add filter method to readable (Benjamin Gruenbaum) #41354
  * (SEMVER-MINOR) add isReadable helper (Robert Nagy) #41199
  * (SEMVER-MINOR) add map method to Readable (Benjamin Gruenbaum) #40815
  * deprecate thenable support (Antoine du Hamel) #40860
* util:
  * (SEMVER-MINOR) pass through the inspect function to custom inspect functions (Ruben Bridgewater) #41019
  * (SEMVER-MINOR) add numericSeparator to util.inspect (Ruben Bridgewater) #41003
  * (SEMVER-MINOR) always visualize cause property in errors during inspection (Ruben Bridgewater) #41002
* timers:
  * (SEMVER-MINOR) add experimental scheduler api (James M Snell) #40909
* v8:
  * (SEMVER-MINOR) multi-tenant promise hook api (Stephen Belanger) #39283

PR-URL: #41804
danielleadams added a commit that referenced this pull request Feb 6, 2022
@danielleadams
2022-02-08, Version 16.14.0 'Gallium' (LTS)
7b99665
Notable changes:

Importing JSON modules now requires experimental import assertions
syntax

This release adds experimental support for the import assertions stage 3
proposal.

To keep Node.js ESM implementation as compatible as possible with the
HTML spec, import assertions are now required to import JSON modules
(still behind the `--experimental-json-modules` CLI flag):

```mjs
import info from './package.json' assert { type: 'json' };
```

Or use dynamic import:

```mjs
const info = await import('./package.json', {
  assert: { type: 'json' }
});
```

Contributed by Antoine du Hamel and Geoffrey Booth #40250

Other notable changes:

* async_hooks:
  * (SEMVER-MINOR) expose async_wrap providers (Rafael Gonzaga) #40760
* child_process:
  * (SEMVER-MINOR) add support for URL to `cp.fork` (Antoine du Hamel) #41225
* doc:
  * add @Mesteery to collaborators (Mestery) #41543
  * add @bnb as a collaborator (Tierney Cyren) #41100
* esm:
  * (SEMVER-MINOR) graduate capturerejections to supported (James M Snell) #41267
  * (SEMVER-MINOR) add EventEmitterAsyncResource to core (James M Snell) #41246
* events:
  * (SEMVER-MINOR) propagate weak option for kNewListener (James M Snell) #40899
* fs:
  * (SEMVER-MINOR) accept URL as argument for `fs.rm` and `fs.rmSync` (Antoine du Hamel) #41132
* lib:
  * (SEMVER-MINOR) make AbortSignal cloneable/transferable (James M Snell) #41050
  * (SEMVER-MINOR) add AbortSignal.timeout (James M Snell) #40899
  * (SEMVER-MINOR) add reason to AbortSignal (James M Snell) #40807
  * (SEMVER-MINOR) add unsubscribe method to non-active DC channels (simon-id) #40433
  * (SEMVER-MINOR) add return value for DC channel.unsubscribe (simon-id) #40433
* loader:
  * (SEMVER-MINOR) return package format from defaultResolve if known (Gabriel Bota) #40980
* perf_hooks:
  * (SEMVER-MINOR) multiple fixes for Histogram (James M Snell) #41153
* process:
  * (SEMVER-MINOR) add `getActiveResourcesInfo()` (Darshan Sen) #40813
* src:
  * (SEMVER-MINOR) add x509.fingerprint512 to crypto module (3nprob) #39809
  * (SEMVER-MINOR) add flags for controlling process behavior (Cheng Zhao) #40339
* stream:
  * (SEMVER-MINOR) add filter method to readable (Benjamin Gruenbaum) #41354
  * (SEMVER-MINOR) add isReadable helper (Robert Nagy) #41199
  * (SEMVER-MINOR) add map method to Readable (Benjamin Gruenbaum) #40815
  * deprecate thenable support (Antoine du Hamel) #40860
* util:
  * (SEMVER-MINOR) pass through the inspect function to custom inspect functions (Ruben Bridgewater) #41019
  * (SEMVER-MINOR) add numericSeparator to util.inspect (Ruben Bridgewater) #41003
  * (SEMVER-MINOR) always visualize cause property in errors during inspection (Ruben Bridgewater) #41002
* timers:
  * (SEMVER-MINOR) add experimental scheduler api (James M Snell) #40909
* v8:
  * (SEMVER-MINOR) multi-tenant promise hook api (Stephen Belanger) #39283

PR-URL: #41804
danielleadams added a commit that referenced this pull request Feb 7, 2022
@danielleadams
2022-02-08, Version 16.14.0 'Gallium' (LTS)
418ff70
Notable changes:

Importing JSON modules now requires experimental import assertions
syntax

This release adds experimental support for the import assertions stage 3
proposal.

To keep Node.js ESM implementation as compatible as possible with the
HTML spec, import assertions are now required to import JSON modules
(still behind the `--experimental-json-modules` CLI flag):

```mjs
import info from './package.json' assert { type: 'json' };
```

Or use dynamic import:

```mjs
const info = await import('./package.json', {
  assert: { type: 'json' }
});
```

Contributed by Antoine du Hamel and Geoffrey Booth #40250

Other notable changes:

* async_hooks:
  * (SEMVER-MINOR) expose async_wrap providers (Rafael Gonzaga) #40760
* child_process:
  * (SEMVER-MINOR) add support for URL to `cp.fork` (Antoine du Hamel) #41225
* doc:
  * add @Mesteery to collaborators (Mestery) #41543
  * add @bnb as a collaborator (Tierney Cyren) #41100
* esm:
  * (SEMVER-MINOR) graduate capturerejections to supported (James M Snell) #41267
  * (SEMVER-MINOR) add EventEmitterAsyncResource to core (James M Snell) #41246
* events:
  * (SEMVER-MINOR) propagate weak option for kNewListener (James M Snell) #40899
* fs:
  * (SEMVER-MINOR) accept URL as argument for `fs.rm` and `fs.rmSync` (Antoine du Hamel) #41132
* lib:
  * (SEMVER-MINOR) make AbortSignal cloneable/transferable (James M Snell) #41050
  * (SEMVER-MINOR) add AbortSignal.timeout (James M Snell) #40899
  * (SEMVER-MINOR) add reason to AbortSignal (James M Snell) #40807
  * (SEMVER-MINOR) add unsubscribe method to non-active DC channels (simon-id) #40433
  * (SEMVER-MINOR) add return value for DC channel.unsubscribe (simon-id) #40433
* loader:
  * (SEMVER-MINOR) return package format from defaultResolve if known (Gabriel Bota) #40980
* perf_hooks:
  * (SEMVER-MINOR) multiple fixes for Histogram (James M Snell) #41153
* process:
  * (SEMVER-MINOR) add `getActiveResourcesInfo()` (Darshan Sen) #40813
* src:
  * (SEMVER-MINOR) add x509.fingerprint512 to crypto module (3nprob) #39809
  * (SEMVER-MINOR) add flags for controlling process behavior (Cheng Zhao) #40339
* stream:
  * (SEMVER-MINOR) add filter method to readable (Benjamin Gruenbaum) #41354
  * (SEMVER-MINOR) add isReadable helper (Robert Nagy) #41199
  * (SEMVER-MINOR) add map method to Readable (Benjamin Gruenbaum) #40815
  * deprecate thenable support (Antoine du Hamel) #40860
* util:
  * (SEMVER-MINOR) pass through the inspect function to custom inspect functions (Ruben Bridgewater) #41019
  * (SEMVER-MINOR) add numericSeparator to util.inspect (Ruben Bridgewater) #41003
  * (SEMVER-MINOR) always visualize cause property in errors during inspection (Ruben Bridgewater) #41002
* timers:
  * (SEMVER-MINOR) add experimental scheduler api (James M Snell) #40909
* v8:
  * (SEMVER-MINOR) multi-tenant promise hook api (Stephen Belanger) #39283

PR-URL: #41804
danielleadams added a commit that referenced this pull request Feb 8, 2022
@danielleadams
2022-02-08, Version 16.14.0 'Gallium' (LTS)
2455b26
Notable changes:

Importing JSON modules now requires experimental import assertions
syntax

This release adds experimental support for the import assertions stage 3
proposal.

To keep Node.js ESM implementation as compatible as possible with the
HTML spec, import assertions are now required to import JSON modules
(still behind the `--experimental-json-modules` CLI flag):

```mjs
import info from './package.json' assert { type: 'json' };
```

Or use dynamic import:

```mjs
const info = await import('./package.json', {
  assert: { type: 'json' }
});
```

Contributed by Antoine du Hamel and Geoffrey Booth #40250

Other notable changes:

* async_hooks:
  * (SEMVER-MINOR) expose async_wrap providers (Rafael Gonzaga) #40760
* child_process:
  * (SEMVER-MINOR) add support for URL to `cp.fork` (Antoine du Hamel) #41225
* doc:
  * add @Mesteery to collaborators (Mestery) #41543
  * add @bnb as a collaborator (Tierney Cyren) #41100
* esm:
  * (SEMVER-MINOR) graduate capturerejections to supported (James M Snell) #41267
  * (SEMVER-MINOR) add EventEmitterAsyncResource to core (James M Snell) #41246
* events:
  * (SEMVER-MINOR) propagate weak option for kNewListener (James M Snell) #40899
* fs:
  * (SEMVER-MINOR) accept URL as argument for `fs.rm` and `fs.rmSync` (Antoine du Hamel) #41132
* lib:
  * (SEMVER-MINOR) make AbortSignal cloneable/transferable (James M Snell) #41050
  * (SEMVER-MINOR) add AbortSignal.timeout (James M Snell) #40899
  * (SEMVER-MINOR) add reason to AbortSignal (James M Snell) #40807
  * (SEMVER-MINOR) add unsubscribe method to non-active DC channels (simon-id) #40433
  * (SEMVER-MINOR) add return value for DC channel.unsubscribe (simon-id) #40433
* loader:
  * (SEMVER-MINOR) return package format from defaultResolve if known (Gabriel Bota) #40980
* perf_hooks:
  * (SEMVER-MINOR) multiple fixes for Histogram (James M Snell) #41153
* process:
  * (SEMVER-MINOR) add `getActiveResourcesInfo()` (Darshan Sen) #40813
* src:
  * (SEMVER-MINOR) add x509.fingerprint512 to crypto module (3nprob) #39809
  * (SEMVER-MINOR) add flags for controlling process behavior (Cheng Zhao) #40339
* stream:
  * (SEMVER-MINOR) add filter method to readable (Benjamin Gruenbaum) #41354
  * (SEMVER-MINOR) add isReadable helper (Robert Nagy) #41199
  * (SEMVER-MINOR) add map method to Readable (Benjamin Gruenbaum) #40815
  * deprecate thenable support (Antoine du Hamel) #40860
* util:
  * (SEMVER-MINOR) pass through the inspect function to custom inspect functions (Ruben Bridgewater) #41019
  * (SEMVER-MINOR) add numericSeparator to util.inspect (Ruben Bridgewater) #41003
  * (SEMVER-MINOR) always visualize cause property in errors during inspection (Ruben Bridgewater) #41002
* timers:
  * (SEMVER-MINOR) add experimental scheduler api (James M Snell) #40909
* v8:
  * (SEMVER-MINOR) multi-tenant promise hook api (Stephen Belanger) #39283

PR-URL: #41804
@QuentinGruber QuentinGruber mentioned this pull request Mar 29, 2022
change promise timer with scheduler api QuentinGruber/h1z1-server#774
Closed
@Renegade334 Renegade334 mentioned this pull request Aug 23, 2025
The future of the Scheduler API #59596
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aduh95 aduh95 aduh95 approved these changes
@mcollina mcollina mcollina approved these changes
@benjamingr benjamingr benjamingr approved these changes
@RaisinTen RaisinTen RaisinTen approved these changes
+1 more reviewer
@Mesteery Mesteery Mesteery left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. experimental Issues and PRs related to experimental features. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. semver-minor PRs that contain new features and should be released in the next minor version. timers Issues and PRs related to timers, setImmediate(), setInterval(), and setTimeout().

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@jasnell @benjamingr @devsnek @Mesteery @nodejs-github-bot @RaisinTen @mcollina @aduh95
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.