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: backport dirname and filename to v20 #50502

Closed
wants to merge 2 commits into from

Conversation

jsumners
Copy link
Contributor

@jsumners jsumners commented Nov 1, 2023

This adds import.meta.dirname and import.meta.filename to the v20 release line. It is a backport of #48740.

This adds `import.meta.dirname` and `import.meta.filename` to
the v20 release line.
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/startup

@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. v20.x v20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch. labels Nov 1, 2023
Comment on lines +313 to +330
<!-- YAML
added: REPLACEME
-->

> Stability: 1.2 - Release candidate

* {string} The directory name of the current module. This is the same as the
[`path.dirname()`][] of the [`import.meta.filename`][].

> **Caveat**: only present on `file:` modules.

### `import.meta.filename`

<!-- YAML
added: REPLACEME
-->

> Stability: 1.2 - Release candidate
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not clear if I should be changing these YAML blocks, and what I should be altering them to if so.

Copy link

@Mifrill Mifrill Nov 1, 2023

Choose a reason for hiding this comment

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

@jsumners as I understand, the REPLACEME is placeholder for a version that should be a release version, like this:

<!-- YAML
added: 1.2.0
-->

Hence, this readme file should be updated on each release with the accorded version.

@targos
Copy link
Member

targos commented Nov 1, 2023

I appreciate the initiative, but there are two things to consider for LTS release lines:

  • The change must live at least two weeks on Current before we take it in
  • If the commit can be cherry-picked without conflicts, a backport PR usually isn't necessary

@GeoffreyBooth
Copy link
Member

@jsumners The release team generally takes care of backports, usually without a specific PR for each one unless a commit doesn’t land cleanly (without conflicts). If that happens they’ll leave a comment on the original PR requesting a backport PR.

@jsumners
Copy link
Contributor Author

jsumners commented Nov 2, 2023

To be clear: we should see the feature flow back to v20 and v18 without any further intervention from myself or another interested party?

@tniessen
Copy link
Member

tniessen commented Nov 2, 2023

@jsumners Yes, semver-minor changes are generally backported automatically to existing release lines. However, because Node.js 18 has reached its maintenance phase, only critical bug fixes and security updates are backported automatically, but "new features may be added at the discretion of the LTS team."

@jsumners jsumners closed this Nov 2, 2023
@jsumners jsumners deleted the v20-esm-dir-file branch November 2, 2023 12:36
@danielbayley
Copy link
Contributor

I was about to open another issue regarding backporting import.meta.dirname/.filename to Node 18 (and 19), as they don’t seem to be available, but would simplify a CI tool I am almost done building, and can see no downside/reason they shouldn’t be…

@jsumners Yes, semver-minor changes are generally backported automatically to existing release lines. However, because Node.js 18 has reached its maintenance phase, only critical bug fixes and security updates are backported automatically, but "new features may be added at the discretion of the LTS team."

@tniessen @jsumners Does this mean they will not be backported to Node 18/19?

@jsumners
Copy link
Contributor Author

🤷‍♂️ what you see in this thread is all the information I have. My original intention was to get it ported all the way back to 18. But I'm not willing to put in the effort any longer. At this point, it would probably take the remaining lifetime of 18 to get it there (review the original PR).

@tniessen
Copy link
Member

Does this mean they will not be backported to Node 18/19?

@danielbayley Node.js 18 is about half a year away from end-of-life status, and all users should be migrating to Node.js 20 or ideally to Node.js 22. Unless you can convince someone from the LTS team that this is super crucial for the last few months of Node.js 18's lifetime, this will not be backported.

Node.js 19 reached end-of-life status a while ago and should not be used at all. The same will be true for Node.js 18 in a few months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. v20.x v20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants