-
Notifications
You must be signed in to change notification settings - Fork 30k
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
util: add MIME utilities #21128
Conversation
Did you reach out to the owners of http://npm.im/mime? |
@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. |
this looks pretty sweet :D you'll need to modify the type parser and add MIMEParams |
This comment has been minimized.
This comment has been minimized.
Possibly related work (and contributors) https://github.com/jsdom/whatwg-mimetype. |
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 |
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. |
@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 |
What are the reasons for implementing this in C++ instead of JS? |
@targos C++ is easier to put robust code into and this has potential usage for things like @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:
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 |
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. |
@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. |
@annevk on IRC has noted that in https://tools.ietf.org/html/rfc2045#section-5 the parameters are called a |
I'm with @jasnell that it might be easier with it off something like |
@jdalton in order to expose any of the use cases I listed above we can't have it be entirely internal. Per hanging off 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 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. |
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. |
@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. |
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. |
@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 |
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. |
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>
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
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
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
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
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>
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
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
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
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
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
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
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
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>
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
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
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>
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
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
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
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>
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
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
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
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
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
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
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
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesThis 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, unlikeurl.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 .