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

util: add MIME utilities #21128

Merged
merged 13 commits into from
Oct 19, 2022
Merged

util: add MIME utilities #21128

merged 13 commits into from
Oct 19, 2022

Conversation

bmeck
Copy link
Member

@bmeck bmeck commented Jun 4, 2018

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

This adds a new module for handling MIME types. It is standalone based upon the WHATWG MIME standards , but is more intended to open up APIs that wish to use MIME for coordinating content types. I have left out the various sniffing for content bodies until a future date as I believe that is a longer discussion than just parsing and serializing. The API is based upon URL and URLSearchParams and intentionally allows us to expand MIMEParams for dealing with multiple parameters with the same name (.getAll / .append etc.).

This PR does not introduce any MIME databases for file paths.

The MIMEParams are not exposed as a string getter / setter, unlike url.search. These manipulations can be done using the map interface provided, and accessors can be added in a follow on if seen as desirable.

Test cases were pulled from web platform tests , but we don't have a well documented process for keeping such fixtures in sync so I have not done anything except vendor them for now, similar to https://github.com/nodejs/node/blob/master/test/fixtures/url-tests.js .

@bmeck bmeck requested a review from jasnell June 4, 2018 21:43
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Jun 4, 2018
@bmeck bmeck added the module Issues and PRs related to the module subsystem. label Jun 4, 2018
@bmeck bmeck requested a review from MylesBorins June 4, 2018 21:44
@addaleax
Copy link
Member

addaleax commented Jun 4, 2018

Did you reach out to the owners of http://npm.im/mime?

@bmeck
Copy link
Member Author

bmeck commented Jun 4, 2018

@addaleax nope, I don't plan to merge this immediately and think all the names on npm cause problems. Kind of leaning on nodejs/TSC#389 , but am also open to changing the name, all simple ones seem to conflict though.

@devsnek
Copy link
Member

devsnek commented Jun 4, 2018

this looks pretty sweet :D

you'll need to modify the type parser and add MIMEParams

doc/api/mime.md Outdated Show resolved Hide resolved
lib/mime.js Outdated Show resolved Hide resolved
lib/mime.js Outdated Show resolved Hide resolved
lib/mime.js Outdated Show resolved Hide resolved
src/node_mime.h Outdated Show resolved Hide resolved
src/node_mime.cc Outdated Show resolved Hide resolved
src/node_mime.cc Outdated Show resolved Hide resolved
src/node_mime.cc Outdated Show resolved Hide resolved
src/node_mime.cc Outdated Show resolved Hide resolved
src/node_mime.cc Outdated Show resolved Hide resolved
lib/mime.js Outdated Show resolved Hide resolved
@vsemozhetbyt

This comment has been minimized.

@jdalton
Copy link
Member

jdalton commented Jun 5, 2018

Possibly related work (and contributors) https://github.com/jsdom/whatwg-mimetype.

@Trott
Copy link
Member

Trott commented Jun 5, 2018

I hate to do this (and if other people think it's the wrong thing to do, go ahead and undo it), but I'm going to add the blocked label on this because, as alluded above, we're going to want to get resolution on nodejs/TSC#389 before landing this, if at all possible.

@Trott Trott added the blocked PRs that are blocked by other issues or PRs. label Jun 5, 2018
@jdalton
Copy link
Member

jdalton commented Jun 5, 2018

In addition, with this functionality covered by user-land and something that isn't a standardized constructor (like WHATWG URL) I think there needs to be more thought on whether this belongs in core.

@jasnell
Copy link
Member

jasnell commented Jun 5, 2018

@bradleymeck ... Can you please go into some of the motivation behind this? It's been something that you and I have spoken about but others would benefit from the context.

I think that a new top level module for this likely is not the best approach. Dropping this off util would work, I think... And would allow it to side step the module namespacing issue.

@targos
Copy link
Member

targos commented Jun 5, 2018

What are the reasons for implementing this in C++ instead of JS?

@bmeck
Copy link
Member Author

bmeck commented Jun 5, 2018

@targos C++ is easier to put robust code into and this has potential usage for things like http server header parsing where things need a bit more scrutiny I believe as there can be vulnerable to DOS.

@jdalton Lack of an standard API is exactly why this is being proposed. If there was a standard API, we could follow it. I've had brief talks in the past about standardizing a MIME JS API, but do not see WHATWG as a place that I've had success standardizing things. Even if this module is overtaken by a WHATWG API, I will still see this PR as a success. If you will note, the package you linked is not currently on standards track and there are also a variety of other modules with similar purpose. I'd note that the package you have chosen as an example has a design extremely similar to this API, and I have done some digging to see what other packages provide as well. If you don't think this API is valid without a standard, would Node creating a separate standards document be sufficient?

@jasnell This PR has many motivations:

  • HTTP header parsing
  • Enabling implementing APIs that use MIMEs, particularly: Blob and potentially Response
    • The usage of these APIs is increasingly important to me as Service Workers are seeing increased usage and writing code between them and Node has a lot of friction.
  • Allow exploring a more robust path for ESM than a custom one off format type
    • One less format is probably a good thing and matches web loading
  • Allow adding the MIME sniffing algorithms once we can decide on and API to expose for those
    • This would allow simpler integrations for uploads seeking to obtain MIMEs for the various formats
  • Allow exploring MIME database integrations for file paths. Even though MIME Sniffing does not use file extensions, browsers do however and are called out in handling of files for input.

This PR just introduces the base structure for those and is not trying to overburden itself by trying to satisfy all those use case workflows at once. This allows those workflows to be explored based upon an API rooted in the concepts of URL and written in a web compatible way using getters etc. I am also following the same convention of adding it as a module. I do not think hanging it off util is appropriate as the use cases grow.

@apapirovski
Copy link
Member

C++ is easier to put robust code into and this has potential usage for things like http server header parsing where things need a bit more scrutiny I believe as there can be vulnerable to DOS.

This might not be the PR for this conversation but I would really like to have a discussion at some point re: choices being made for C++ vs JS implementations. There are upsides to C++ without a doubt but it's incredibly hard to get contributors that cover all 3 of domain expertise, JS and C++. IMO that is something that sort of gets ignored when we add new C++ code.

If our goal is to have the project be sustainable in the long-term then the right balance needs to be found. Otherwise we're making it more and more difficult for a large portion of the ecosystem to contribute anything back.

@bmeck
Copy link
Member Author

bmeck commented Jun 5, 2018

@apapirovski I'd agree. This PR mostly requires a non-flexible parsing algorithm be exposed. I think keeping as much as possible in JS is fine, but still requires more effort than C++ in order to achieve robust code that doesn't suffer from things like prototype pollution or reflection to get to internals. If you have specific comments about this PR I will do my best to address them, but would not like to discuss that topic as a whole in this PR.

@bmeck
Copy link
Member Author

bmeck commented Jun 5, 2018

@annevk on IRC has noted that in https://tools.ietf.org/html/rfc2045#section-5 the parameters are called a set, so we should not expose a .getAll in the future. This PR currently does not expose duplicates to users and does not need to be changed.

@jdalton
Copy link
Member

jdalton commented Jun 5, 2018

@bmeck

I do not think hanging it off util is appropriate as the use cases grow.

I'm with @jasnell that it might be easier with it off something like util or was even just internal for now. Since this does exist in user-land and Node's small core preference I would tend to favor punting in core until it's explicitly needed and then maybe landing it as an internal helper first.

@bmeck
Copy link
Member Author

bmeck commented Jun 5, 2018

@jdalton in order to expose any of the use cases I listed above we can't have it be entirely internal.

Per hanging off util it does not seem that hanging classes of util has a well defined meaning because this is a general purpose data structure, not just some utility functionality. We could claim that everything could be hung off util, but I don't think adding discrete classes around standards makes sense. We wouldn't add things like http to util either.

Per userland solutions, as you pointed to there are some, but the most popular one is not the one you pointed to and this is a means to define a singular point for solutions using MIMEs to rely on and we can gather input as we move forward such that the reasons for all the differing implementations can be alleviated. The fact that there are so many downloads and so many implementations makes this area ripe for standardizing on a solution so that people can reliably use the same APIs. An API spaced with millions of downloads a day seems like something we should look at providing out of the box, especially since it relates to other parts of core such as http headers.

In addition, per my comment above, there are many things that could be implemented using this. Punting it until we have a specific use case doesn't make sense to me as we would design the API specifically for a use case rather than implement a generic low level solution that can be used by all use cases. I do not want to conflate this with other use cases as it is valuable as a lower level primitive on its own. We should design this around being a reusable primitive rather than trying to carve out a primitive from a specific use case only.

@jdalton
Copy link
Member

jdalton commented Jun 5, 2018

Per userland solutions, as you pointed to there are some, but the most popular one is not the one you pointed to and this is a means to define a singular point for solutions using MIMEs to rely on

There's always choices in user-land and that hasn't stopped Node from deferring to user-land. Popular solutions tend to shake out. We're now aware of the API (or similar) so if the need comes as part of some Node feature down the line then we'll be able to revisit and decide on internal or external, builtin module or bolted on some place else. At the moment though it feels like we're getting into these discussions a bit early.

@bmeck
Copy link
Member Author

bmeck commented Jun 5, 2018

@jdalton I only brought up those discussions in response to yours. I'm not sure why you think this use case of providing the standardized parser for MIMEs is invalid on its own. I can only address the reasons why this is a valid API to alleviate concerns given the current framing. I don't think there is wiggle room on the parsing aspect of this, and would appreciate explanation of why we should not provide the parser primitives to JS.

@jdalton
Copy link
Member

jdalton commented Jun 5, 2018

When prioritizing scenarios this may be needed for I'm OK deferring those that can be handled with user-land packages to user-land (so lower priority) and moving those that would require core integration higher. I'm fine with an internal helper to enable whatever scenario it's needed for at the time it's needed. I'm not okay adding a new built-in for a bunch of maybe-might-be scenarios esp. when you've shown resistance to bolting it on anywhere else. If you're not open to internal or bolting it on somewhere else I feel like the PR is going to get nixed.

@bmeck
Copy link
Member Author

bmeck commented Jun 5, 2018

@jdalton I cannot have it be internal for any of those uses, which I don't see being claimed as invalid. I also am unclear on why bolting it onto util makes it somehow better, can you explain why putting it on util makes it more valuable? Also, can you explain why allowing users to create solutions using this and using user land to explore expanding this primitive to other parts of Core APIs makes it less appealing? I do not understand the resistance to the functionality being provided in your comments, and do not understand if you are against any new primitives being added to Node given that your comments seem to apply to all possible features in general that can be built upon rather than providing a specific use case that is deemed worthy of a PR. I generally approach APIs by building upon primitives rather than trying to carve primitives out of monolithic solutions.

@annevk
Copy link

annevk commented Jun 5, 2018

FWIW, as I noted to @bmeck on IRC, there is interest in adding a standardized API that also works for Node.js. I've previously pinged @jasnell about this: whatwg/mimesniff#43.

RafaelGSS pushed a commit that referenced this pull request Nov 1, 2022
Co-authored-by: Rich Trott <rtrott@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #21128
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS added a commit that referenced this pull request Nov 1, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)

PR-URL: TBD
@RafaelGSS RafaelGSS mentioned this pull request Nov 1, 2022
RafaelGSS added a commit that referenced this pull request Nov 1, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)

PR-URL: #45269
RafaelGSS added a commit that referenced this pull request Nov 1, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)

PR-URL: #45269
RafaelGSS added a commit that referenced this pull request Nov 1, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)

PR-URL: #45269
RafaelGSS pushed a commit that referenced this pull request Nov 10, 2022
Co-authored-by: Rich Trott <rtrott@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #21128
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS added a commit that referenced this pull request Nov 10, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)

PR-URL: #45269
RafaelGSS added a commit that referenced this pull request Nov 10, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* lib:
  * drop fetch experimental warning (Matteo Collina) [#45287](#45287)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)
  * improve textdecoder decode performance (Yagiz Nizipli) [#45294](#45294)

PR-URL: #45269
RafaelGSS added a commit that referenced this pull request Nov 10, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* lib:
  * drop fetch experimental warning (Matteo Collina) [#45287](#45287)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)
  * improve textdecoder decode performance (Yagiz Nizipli) [#45294](#45294)

PR-URL: #45269
RafaelGSS added a commit that referenced this pull request Nov 11, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* lib:
  * drop fetch experimental warning (Matteo Collina) [#45287](#45287)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)
  * improve textdecoder decode performance (Yagiz Nizipli) [#45294](#45294)

PR-URL: #45269
RafaelGSS added a commit that referenced this pull request Nov 11, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* lib:
  * drop fetch experimental warning (Matteo Collina) [#45287](#45287)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)
  * improve textdecoder decode performance (Yagiz Nizipli) [#45294](#45294)

PR-URL: #45269
RafaelGSS added a commit that referenced this pull request Nov 11, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* lib:
  * drop fetch experimental warning (Matteo Collina) [#45287](#45287)
* test_runner:
  * support function mocking (Colin Ihrig) [#45326](#45326)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)
  * improve textdecoder decode performance (Yagiz Nizipli) [#45294](#45294)

PR-URL: #45269
RafaelGSS added a commit that referenced this pull request Nov 14, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* lib:
  * drop fetch experimental warning (Matteo Collina) [#45287](#45287)
* test_runner:
  * support function mocking (Colin Ihrig) [#45326](#45326)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)
  * improve textdecoder decode performance (Yagiz Nizipli) [#45294](#45294)

PR-URL: #45269
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
Co-authored-by: Rich Trott <rtrott@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #21128
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
danielleadams added a commit that referenced this pull request Dec 30, 2022
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

fs.watch recursive support on Linux:

`fs.watch` supports recursive watch using the `recursive: true` option.

```js
const watcher = fs.watch(testDirectory, { recursive: true });
watcher.on('change', function(event, filename) {
});
```

Contributed by Yagiz Nizipli in #45098

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

buffer:
  * (SEMVER-MINOR) introduce File (Khafra) #45139
build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: TBD
danielleadams added a commit that referenced this pull request Dec 30, 2022
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

fs.watch recursive support on Linux:

`fs.watch` supports recursive watch using the `recursive: true` option.

```js
const watcher = fs.watch(testDirectory, { recursive: true });
watcher.on('change', function(event, filename) {
});
```

Contributed by Yagiz Nizipli in #45098

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

buffer:
  * (SEMVER-MINOR) introduce File (Khafra) #45139
build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: #46025
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
Co-authored-by: Rich Trott <rtrott@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #21128
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
danielleadams added a commit that referenced this pull request Dec 30, 2022
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

fs.watch recursive support on Linux:

`fs.watch` supports recursive watch using the `recursive: true` option.

```js
const watcher = fs.watch(testDirectory, { recursive: true });
watcher.on('change', function(event, filename) {
});
```

Contributed by Yagiz Nizipli in #45098

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

buffer:
  * (SEMVER-MINOR) introduce File (Khafra) #45139
build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: #46025
danielleadams added a commit that referenced this pull request Dec 31, 2022
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

Introduce `File`:

The File class is part of the [FileAPI](https://w3c.github.io/FileAPI/).
It can be used anywhere a Blob can, for example in `URL.createObjectURL`
and `FormData`. It contains two properties that Blobs do not have: `lastModified`,
the last time the file was modified in ms, and `name`, the name of the file.

Contributed by Khafra in #45139

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: #46025
danielleadams added a commit that referenced this pull request Dec 31, 2022
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

Introduce `File`:

The File class is part of the [FileAPI](https://w3c.github.io/FileAPI/).
It can be used anywhere a Blob can, for example in `URL.createObjectURL`
and `FormData`. It contains two properties that Blobs do not have: `lastModified`,
the last time the file was modified in ms, and `name`, the name of the file.

Contributed by Khafra in #45139

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: #46025
danielleadams pushed a commit that referenced this pull request Jan 3, 2023
Co-authored-by: Rich Trott <rtrott@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #21128
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
danielleadams added a commit that referenced this pull request Jan 3, 2023
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

Introduce `File`:

The File class is part of the [FileAPI](https://w3c.github.io/FileAPI/).
It can be used anywhere a Blob can, for example in `URL.createObjectURL`
and `FormData`. It contains two properties that Blobs do not have: `lastModified`,
the last time the file was modified in ms, and `name`, the name of the file.

Contributed by Khafra in #45139

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: #46025
danielleadams added a commit that referenced this pull request Jan 4, 2023
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

Introduce `File`:

The File class is part of the [FileAPI](https://w3c.github.io/FileAPI/).
It can be used anywhere a Blob can, for example in `URL.createObjectURL`
and `FormData`. It contains two properties that Blobs do not have: `lastModified`,
the last time the file was modified in ms, and `name`, the name of the file.

Contributed by Khafra in #45139

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: #46025
danielleadams added a commit that referenced this pull request Jan 4, 2023
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

Introduce `File`:

The File class is part of the [FileAPI](https://w3c.github.io/FileAPI/).
It can be used anywhere a Blob can, for example in `URL.createObjectURL`
and `FormData`. It contains two properties that Blobs do not have: `lastModified`,
the last time the file was modified in ms, and `name`, the name of the file.

Contributed by Khafra in #45139

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: #46025
danielleadams added a commit that referenced this pull request Jan 5, 2023
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

Introduce `File`:

The File class is part of the [FileAPI](https://w3c.github.io/FileAPI/).
It can be used anywhere a Blob can, for example in `URL.createObjectURL`
and `FormData`. It contains two properties that Blobs do not have: `lastModified`,
the last time the file was modified in ms, and `name`, the name of the file.

Contributed by Khafra in #45139

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: #46025
danielleadams added a commit that referenced this pull request Jan 5, 2023
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

Introduce `File`:

The File class is part of the [FileAPI](https://w3c.github.io/FileAPI/).
It can be used anywhere a Blob can, for example in `URL.createObjectURL`
and `FormData`. It contains two properties that Blobs do not have: `lastModified`,
the last time the file was modified in ms, and `name`, the name of the file.

Contributed by Khafra in #45139

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: #46025
danielleadams added a commit that referenced this pull request Jan 5, 2023
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

Introduce `File`:

The File class is part of the [FileAPI](https://w3c.github.io/FileAPI/).
It can be used anywhere a Blob can, for example in `URL.createObjectURL`
and `FormData`. It contains two properties that Blobs do not have: `lastModified`,
the last time the file was modified in ms, and `name`, the name of the file.

Contributed by Khafra in #45139

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: #46025
danielleadams added a commit that referenced this pull request Jan 6, 2023
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

Introduce `File`:

The File class is part of the [FileAPI](https://w3c.github.io/FileAPI/).
It can be used anywhere a Blob can, for example in `URL.createObjectURL`
and `FormData`. It contains two properties that Blobs do not have: `lastModified`,
the last time the file was modified in ms, and `name`, the name of the file.

Contributed by Khafra in #45139

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: #46025
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. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. lib / src Issues and PRs related to general changes in the lib or src directory. module Issues and PRs related to the module subsystem. notable-change PRs with changes that should be highlighted in changelogs. review wanted PRs that need reviews. 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.