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: add import.meta.dirname and import.meta.filename #48740

Merged
merged 12 commits into from
Oct 31, 2023

Conversation

jsumners
Copy link
Contributor

@jsumners jsumners commented Jul 11, 2023

This PR adds import.meta.dirname and import.meta.filename for ECMAScript Modules that are loaded from the local filesystem. In my view, these properties don’t make any sense for modules loaded from the network, but they are very desired for local modules. At least one recent issue (#47756) wanted them, and there exists at least two ecosystem modules to solve for them:

The Problem

As it stands, to determine the containing directory of a script we must write code like:

import url from 'url'
import path from 'path'
const dirname = path.dirname(url.fileURLToPath(import.meta.url))

Of course, this needs to be repeated in every script that needs the information. With this PR, the code is reduced to:

const dirname = import.meta.__dirname

The developer doesn’t need to remember how to convert the file URL to a path and then resolve the directory from that.

External Discussion

The impetus for this PR is a recent Twitter discussion – https://twitter.com/jasnell/status/1677335322978295809

Notable change

In file:-based ES modules, new properties import.meta.filename and import.meta.dirname provide equivalents to CommonJS __filename and __dirname. In particular, import.meta.filename provides the full absolute path (as a file path, not URL) to the module; and import.meta.dirname provides the full absolute path to the module’s containing folder. These properties are missing for non-file:-based ES modules, such as those loaded from data: or https: URLs.

@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 Jul 11, 2023
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

@mcollina mcollina added 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. labels Jul 11, 2023
@github-actions
Copy link
Contributor

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

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.

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 11, 2023
doc/api/esm.md Outdated Show resolved Hide resolved
doc/api/esm.md Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 11, 2023
@mscdex
Copy link
Contributor

mscdex commented Jul 11, 2023

This was suggested before in #39147. Has anything changed since then?

doc/api/esm.md Outdated Show resolved Hide resolved
doc/api/esm.md Outdated Show resolved Hide resolved
@mcollina
Copy link
Member

This was suggested before in #39147. Has anything changed since then?

I think it is less controversial now. Everybody migrating to ESM needs to figure this out and it requires way too many steps to get those values.

@jsumners jsumners force-pushed the esm-dir-file branch 2 times, most recently from dac12b1 to cf0841f Compare July 12, 2023 12:36
@jcbhmr
Copy link
Contributor

jcbhmr commented Jul 12, 2023

This may be of no concern, but Bun appears to use import.meta.dir and import.meta.path for these values: https://bun.sh/docs/api/import-meta idk if that's relevant tho. 🤷‍♂️

Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

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

I don't think it's a good idea to introduce this, we should move away from paths IMO.

lib/internal/modules/esm/initialize_import_meta.js Outdated Show resolved Hide resolved
test/es-module/test-esm-import-meta.mjs Outdated Show resolved Hide resolved
test/es-module/test-esm-import-meta.mjs Outdated Show resolved Hide resolved
test/es-module/test-esm-import-meta.mjs Outdated Show resolved Hide resolved
lib/internal/modules/esm/initialize_import_meta.js Outdated Show resolved Hide resolved
lib/internal/modules/esm/initialize_import_meta.js Outdated Show resolved Hide resolved
@aduh95
Copy link
Contributor

aduh95 commented Jul 12, 2023

Everybody migrating to ESM needs to figure this out and it requires way too many steps to get those values.

Why do you need paths though? It shouldn't be necessary, URL should get you covered.

@mcollina
Copy link
Member

Why do you need paths though? It shouldn't be necessary, URL should get you covered.

Most APIs from fs and path do not work well with URLs. Reading files relative to the current one is something everybody does all the time for all sorts of purposes. Currently, it takes quite a few lines of code to get the path for a file in the same directory:

import { fileURLToPath } from 'url'
import { dirname, join } from 'path'

const __dirname = dirname(url.fileURLToPath(import.meta.url))
const toAccess = join(__dirname, 'another_file')

@aduh95
Copy link
Contributor

aduh95 commented Jul 13, 2023

Most APIs from fs

That's wrong I think, all node:fs APIs works with either. If you see issues with node:fs and URL, please open an issue, that'd be a bug.

and path

That's kinda obvious, node:path is for paths, not URLs.

Reading files relative to the current one is something everybody does all the time for all sorts of purposes.

That's my point, you should be using URL for that. The equivalent to your code snippet would be:

const toAccess = new URL('./another_file', import.meta.url);

aduh95
aduh95 previously requested changes Jul 13, 2023
Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

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

Adding an explicit -1 on this because it already has an approval and I don't want it to land without some extensive discussion first.

I think this goes in the wrong direction. I'm happy to be proven wrong, but I guess there's also an ideological problem: I think using paths in ESM is a faux-pas, if one goes ESM, they should let paths be a relic of the past, and embrace URLs. I can see it can certainly be useful to have the proposed properties to convert a CJS module to ESM, but someone writing ESM from scratch should never need it, and it would be confusing to add something that works only on file: protocol, when I would prefer to see Node.js go in the direction of being more protocol agnostic.

@MoLow
Copy link
Member

MoLow commented Jul 13, 2023

I think this goes in the wrong direction. I'm happy to be proven wrong, but I guess there's also an ideological problem: I think using paths in ESM is a faux-pas, if one goes ESM, they should let paths be a relic of the past, and embrace URLs. I can see it can certainly be useful to have the proposed properties to convert a CJS module to ESM, but someone writing ESM from scratch should never need it, and it would be confusing to add something that works only on file: protocol, when I would prefer to see Node.js go in the direction of being more protocol agnostic.

We should also consider if it will help the adoption of ESM and make migration easier / less painful.
even if there is an ideological issue - it is not very pragmatic to only provide a solution for "someone writing ESM from scratch".
even if one can argue it will never be needed, avoiding such utilities/helpers because they seem redundant can have a negative effect on the ecosystem.

Copy link
Member

@gengjiawen gengjiawen left a comment

Choose a reason for hiding this comment

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

Almost shed tears, thank you

@gengjiawen
Copy link
Member

if one goes ESM, they should let paths be a relic of the past, and embrace URLs.

It's like a muscle memory even can trace from python. It can avoid many mental burden from using esm, this is my mosted missed feature in esm.

Also many people trapped on this. lots of libs goto full esm have this info everywhere.

It's a good move in the long run, and way friendly for users back then when only cjs exists.

@gengjiawen
Copy link
Member

I will share some my work experience, we used js almost everywhere, some are cjs, some are esm. When it comes to script job in CI and linux server, it's always have been cjs module. because __dirname and __filename used everywhere just like python. Esm equivalence is way verbose and less instinctive.

@mcollina
Copy link
Member

@aduh95 The vast majority of the modules on npm only accept paths, not URLs. Therefore it adds quite a bit of a mental burden to do that. The recommendation you have is for all modules on NPM to start accepting file:// URLs as well as paths, or even only URLs. I don't think that's feasible.

Even modules that went all-in on ESM only use paths everywhere and not URLs, as an example take a look at https://vitest.dev/guide/#workspaces-support.

Overall I think adding __filename and __dirname will help the adoption of ESM.

martenrichter pushed a commit to martenrichter/node that referenced this pull request Nov 26, 2023
Notable changes:

doc:
  * add MrJithil to collaborators (Jithil P Ponnan) nodejs#50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) nodejs#50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) nodejs#48740
fs:
  * add stacktrace to fs/promises (翠 / green) nodejs#49849
lib:
  * (SEMVER-MINOR) add `--no-experimental-global-navigator` CLI flag (Antoine du Hamel) nodejs#50562
  * (SEMVER-MINOR) add navigator.language & navigator.languages (Aras Abbasi) nodejs#50303
  * (SEMVER-MINOR) add navigator.platform (Aras Abbasi) nodejs#50385
stream:
  * (SEMVER-MINOR) add support for `deflate-raw` format to webstreams compression (Damian Krzeminski) nodejs#50097
  * use Array for Readable buffer (Robert Nagy) nodejs#50341
  * optimize creation (Robert Nagy) nodejs#50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) nodejs#50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) nodejs#48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) nodejs#50443

PR-URL: nodejs#50681
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
PR-URL: #48740
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
This removes a source file that got re-added via a rebase.
It seems somewhere around change set
178dff2
`entry_point.c` was removed, and rebase
0b6e16f
added it back. The review of #48740
overlooked this and the file got re-committed.

PR-URL: #50528
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Vladimir Morozov <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
UlisesGascon added a commit that referenced this pull request Dec 12, 2023
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) #50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) #50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) #48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655
stream:
  * use Array for Readable buffer (Robert Nagy) #50341
  * optimize creation (Robert Nagy) #50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) #50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) #48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) #50443

PR-URL: TODO
@UlisesGascon UlisesGascon mentioned this pull request Dec 12, 2023
UlisesGascon added a commit that referenced this pull request Dec 12, 2023
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) #50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) #50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) #48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655
stream:
  * use Array for Readable buffer (Robert Nagy) #50341
  * optimize creation (Robert Nagy) #50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) #50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) #48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) #50443

PR-URL: #51124
UlisesGascon added a commit that referenced this pull request Dec 13, 2023
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) #50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) #50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) #48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655
stream:
  * use Array for Readable buffer (Robert Nagy) #50341
  * optimize creation (Robert Nagy) #50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) #50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) #48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) #50443

PR-URL: #51124
UlisesGascon added a commit that referenced this pull request Dec 15, 2023
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) #50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) #50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) #48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655
  * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) #48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655
stream:
  * use Array for Readable buffer (Robert Nagy) #50341
  * optimize creation (Robert Nagy) #50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) #50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) #48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) #50443

PR-URL: #51124
UlisesGascon added a commit that referenced this pull request Dec 15, 2023
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) #50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) #50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) #48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655
  * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) #48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655
stream:
  * use Array for Readable buffer (Robert Nagy) #50341
  * optimize creation (Robert Nagy) #50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) #50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) #48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) #50443

PR-URL: #51124
UlisesGascon added a commit that referenced this pull request Dec 20, 2023
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) #50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) #50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) #48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655
  * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) #48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655
stream:
  * use Array for Readable buffer (Robert Nagy) #50341
  * optimize creation (Robert Nagy) #50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) #50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) #48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) #50443

PR-URL: #51124
UlisesGascon added a commit that referenced this pull request Jan 3, 2024
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) #50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) #50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) #48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655
  * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) #48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655
stream:
  * use Array for Readable buffer (Robert Nagy) #50341
  * optimize creation (Robert Nagy) #50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) #50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) #48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) #50443

PR-URL: #51124
UlisesGascon added a commit that referenced this pull request Jan 4, 2024
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) #50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) #50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) #48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655
  * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) #48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655
stream:
  * use Array for Readable buffer (Robert Nagy) #50341
  * optimize creation (Robert Nagy) #50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) #50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) #48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) #50443

PR-URL: #51124
UlisesGascon added a commit that referenced this pull request Jan 9, 2024
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) #50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) #50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) #48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655
  * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) #48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655
stream:
  * use Array for Readable buffer (Robert Nagy) #50341
  * optimize creation (Robert Nagy) #50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) #50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) #48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) #50443

PR-URL: #51124
UlisesGascon added a commit that referenced this pull request Jan 9, 2024
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) #50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) #50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) #48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655
  * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) #48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655
stream:
  * use Array for Readable buffer (Robert Nagy) #50341
  * optimize creation (Robert Nagy) #50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) #50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) #48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) #50443

PR-URL: #51124
marco-ippolito pushed a commit to marco-ippolito/node that referenced this pull request Jan 12, 2024
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) nodejs#50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) nodejs#50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) nodejs#50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) nodejs#48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) nodejs#49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) nodejs#48655
  * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) nodejs#48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) nodejs#50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) nodejs#48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) nodejs#48655
stream:
  * use Array for Readable buffer (Robert Nagy) nodejs#50341
  * optimize creation (Robert Nagy) nodejs#50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) nodejs#50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) nodejs#48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) nodejs#50443

PR-URL: nodejs#51124
@GeoffreyBooth
Copy link
Member

FYI, Bun has also added import.meta.dirname and import.meta.filename: oven-sh/bun#8127

Medhansh404 pushed a commit to Medhansh404/node that referenced this pull request Jan 19, 2024
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) nodejs#50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) nodejs#50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) nodejs#50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) nodejs#48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) nodejs#49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) nodejs#48655
  * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) nodejs#48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) nodejs#50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) nodejs#48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) nodejs#48655
stream:
  * use Array for Readable buffer (Robert Nagy) nodejs#50341
  * optimize creation (Robert Nagy) nodejs#50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) nodejs#50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) nodejs#48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) nodejs#50443

PR-URL: nodejs#51124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. esm Issues and PRs related to the ECMAScript Modules implementation. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.