Skip to content
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

esm: mark import attributes and JSON module as stable #55333

Merged

Conversation

nicolo-ribaudo
Copy link
Contributor

@nicolo-ribaudo nicolo-ribaudo commented Oct 9, 2024

The two proposals reached stage 4 yesterday, at the October 2024 meeting. The Node.js implementation already matches exactly the semantics required by the proposals. This PR can/should be backported to 22 and 20 (and 18?).

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. labels Oct 9, 2024
doc/api/esm.md Outdated Show resolved Hide resolved
The two proposals reached stage 4 at the October 2024 meeting.
@richardlau richardlau added lts-watch-v18.x PRs that may need to be released in v18.x. lts-watch-v20.x PRs that may need to be released in v20.x notable-change PRs with changes that should be highlighted in changelogs. labels Oct 9, 2024
Copy link
Contributor

github-actions bot commented Oct 9, 2024

The notable-change PRs with changes that should be highlighted in changelogs. label has been added by @richardlau.

Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section.

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.40%. Comparing base (7178588) to head (9d6689a).
Report is 183 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55333      +/-   ##
==========================================
+ Coverage   88.38%   88.40%   +0.01%     
==========================================
  Files         652      652              
  Lines      186740   186739       -1     
  Branches    36036    36029       -7     
==========================================
+ Hits       165058   165078      +20     
+ Misses      14934    14925       -9     
+ Partials     6748     6736      -12     
Files with missing lines Coverage Δ
lib/internal/modules/esm/translators.js 93.09% <ø> (-0.02%) ⬇️

... and 20 files with indirect coverage changes

Comment on lines +19 to 27
it('should not print an experimental warning', async () => {
const { code, signal, stderr } = await spawnPromisified(execPath, [
fixtures.path('/es-modules/json-modules.mjs'),
]);

assert.match(stderr, /ExperimentalWarning: Importing JSON modules/);
assert.strictEqual(stderr, '');
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);
});
Copy link
Member

Choose a reason for hiding this comment

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

IMO this test case can just be removed, because there is no longer any code suggesting that an experimental emitting case.

@RedYetiDev RedYetiDev added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Oct 9, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 9, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@nicolo-ribaudo
Copy link
Contributor Author

Process question: what does it mean to get multiple approvals after a comment suggesting a change? Should I delete the test or not?

@marco-ippolito
Copy link
Member

Process question: what does it mean to get multiple approvals after a comment suggesting a change? Should I delete the test or not?

I think its fine to keep it

@aduh95 aduh95 added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Oct 11, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@mcollina mcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 12, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 12, 2024
@nodejs-github-bot nodejs-github-bot merged commit d881fcb into nodejs:main Oct 12, 2024
79 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in d881fcb

@nicolo-ribaudo nicolo-ribaudo deleted the json-modules-remove-warning branch October 12, 2024 12:47
marco-ippolito pushed a commit to marco-ippolito/node that referenced this pull request Oct 14, 2024
The two proposals reached stage 4 at the October 2024 meeting.

PR-URL: nodejs#55333
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request Oct 19, 2024
The two proposals reached stage 4 at the October 2024 meeting.

PR-URL: #55333
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 added a commit that referenced this pull request Oct 24, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make `assertion_error` use Myers diff algorithm (Giovanni Bucci) #54862
buffer:
  * (SEMVER-MINOR) make `Buffer` work with resizable `ArrayBuffer` (James M Snell) #55377
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333
lib:
  * (SEMVER-MINOR) add `UV_UDP_REUSEPORT` for udp (theanarkh) #55403
net:
  * (SEMVER-MINOR) add `UV_TCP_REUSEPORT` for tcp (theanarkh) #55408
test_runner:
  * mark `MockTimers` as stable (Erick Wendel) #55398

PR-URL: TODO
@aduh95 aduh95 mentioned this pull request Oct 24, 2024
aduh95 added a commit that referenced this pull request Oct 24, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make `assertion_error` use Myers diff algorithm (Giovanni Bucci) #54862
buffer:
  * (SEMVER-MINOR) make `Buffer` work with resizable `ArrayBuffer` (James M Snell) #55377
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333
lib:
  * (SEMVER-MINOR) add `UV_UDP_REUSEPORT` for udp (theanarkh) #55403
net:
  * (SEMVER-MINOR) add `UV_TCP_REUSEPORT` for tcp (theanarkh) #55408
test_runner:
  * mark `MockTimers` as stable (Erick Wendel) #55398

PR-URL: #55513
aduh95 added a commit that referenced this pull request Oct 24, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make `assertion_error` use Myers diff algorithm (Giovanni Bucci) #54862
buffer:
  * (SEMVER-MINOR) make `Buffer` work with resizable `ArrayBuffer` (James M Snell) #55377
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333
lib:
  * (SEMVER-MINOR) add `UV_UDP_REUSEPORT` for udp (theanarkh) #55403
net:
  * (SEMVER-MINOR) add `UV_TCP_REUSEPORT` for tcp (theanarkh) #55408
test_runner:
  * mark `MockTimers` as stable (Erick Wendel) #55398

PR-URL: #55513
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
The two proposals reached stage 4 at the October 2024 meeting.

PR-URL: nodejs#55333
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make `assertion_error` use Myers diff algorithm (Giovanni Bucci) nodejs#54862
buffer:
  * (SEMVER-MINOR) make `Buffer` work with resizable `ArrayBuffer` (James M Snell) nodejs#55377
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) nodejs#55333
lib:
  * (SEMVER-MINOR) add `UV_UDP_REUSEPORT` for udp (theanarkh) nodejs#55403
net:
  * (SEMVER-MINOR) add `UV_TCP_REUSEPORT` for tcp (theanarkh) nodejs#55408
test_runner:
  * mark `MockTimers` as stable (Erick Wendel) nodejs#55398

PR-URL: nodejs#55513
aduh95 pushed a commit that referenced this pull request Nov 2, 2024
The two proposals reached stage 4 at the October 2024 meeting.

PR-URL: #55333
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@aduh95 aduh95 added backported-to-v18.x PRs backported to the v18.x-staging branch. and removed lts-watch-v18.x PRs that may need to be released in v18.x. labels Nov 2, 2024
@viceice
Copy link

viceice commented Nov 7, 2024

Shouldn't this also backported to v22 ?

@aduh95
Copy link
Contributor

aduh95 commented Nov 7, 2024

Shouldn't this also backported to v22 ?

Patience young padawan

Node.js 22.x is an active LTS, backports there are implied for non-semver-major commits. It should be in the next release.

aduh95 added a commit that referenced this pull request Nov 7, 2024
Notable changes:

esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333

PR-URL: TODO
aduh95 added a commit that referenced this pull request Nov 7, 2024
Notable changes:

esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333

PR-URL: #55768
aduh95 added a commit that referenced this pull request Nov 12, 2024
Notable changes:

esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333

PR-URL: #55768
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. backported-to-v18.x PRs backported to the v18.x-staging branch. esm Issues and PRs related to the ECMAScript Modules implementation. lts-watch-v20.x PRs that may need to be released in v20.x needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.