| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@addaleax build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/2800/pipeline |
Sorry, something went wrong.
|
/cc @nodejs/workers |
Sorry, something went wrong.
|
@chjj I’m not a 100 % sure but this might also make it easier to implement something closer to a “real” WebWorker-style Environment in Node.js, because you can control the global object and still have MessagePorts in it? |
Sorry, something went wrong.
Sorry, something went wrong.
|
Rebased, new CI: https://ci.nodejs.org/job/node-test-pull-request/21369/ |
Sorry, something went wrong.
|
/cc @nodejs/workers |
Sorry, something went wrong.
There was a problem hiding this comment.
The code generally LGTM but I have some questions
Sorry, something went wrong.
There was a problem hiding this comment.
Can we use context->GetExtrasBindingObject() to store these somehow instead of using v8 privates (which are...an experimental feature. Use at your own risk.)? V8 already puts isTraceCategoryEnabled and trace in there.
Sorry, something went wrong.
There was a problem hiding this comment.
We’ve been using V8 privates extensively for a while, I don’t think they’re going away (and if they did we’d have bigger problems, e.g. N-API relies on them as well).
But yes, if you prefer, we could use the extras binding object for that … I feel like that’s mostly intended for actual v8-extras, but in theory nothing stops us, and I don’t mind making the switch if you prefer.
Sorry, something went wrong.
There was a problem hiding this comment.
@addaleax I don't have very strong opinions about the choices here...although I wonder what does this look like in the heap snapshot? Do they show up?
BTW, we probably need to do something similar for the Environment persistent handles (save them temporarily to the global proxy) when we implement snapshots...
Sorry, something went wrong.
|
Rebased again, CI: https://ci.nodejs.org/job/node-test-pull-request/21464/ |
Sorry, something went wrong.
|
CI is green. I’ll land this tomorrow if there are no objections, but I’d appreciate another review from @nodejs/workers. |
Sorry, something went wrong.
|
@addaleax, yeah, that's a possibility. Someone could replicate the web worker scope exactly with vm I suppose. It's not something I'm personally interested in though since I think I'm more focused on making the browser behave like node.js instead of the other way around (though, my approach seems to be less popular these days). |
Sorry, something went wrong.
Create an `lib/internal/per_context/` directory that can host multiple files which we execute for each context. PR-URL: nodejs#26497 Reviewed-By: James M Snell <jasnell@gmail.com>
This allows using `DOMException` from Node.js code for any `vm.Context`. PR-URL: nodejs#26497 Reviewed-By: James M Snell <jasnell@gmail.com>
This enables using `MessagePort`s in different `vm.Context`s, aiding with the isolation that the `vm` module seeks to provide. Refs: ayojs/ayo#111 PR-URL: nodejs#26497 Reviewed-By: James M Snell <jasnell@gmail.com>
|
Sigh… Needed to update this because of test/parallel/test-bootstrap-modules.js. |
Sorry, something went wrong.
Create an `lib/internal/per_context/` directory that can host multiple files which we execute for each context. PR-URL: #26497 Reviewed-By: James M Snell <jasnell@gmail.com>
This allows using `DOMException` from Node.js code for any `vm.Context`. PR-URL: #26497 Reviewed-By: James M Snell <jasnell@gmail.com>
This enables using `MessagePort`s in different `vm.Context`s, aiding with the isolation that the `vm` module seeks to provide. Refs: ayojs/ayo#111 PR-URL: #26497 Reviewed-By: James M Snell <jasnell@gmail.com>
Create an `lib/internal/per_context/` directory that can host multiple files which we execute for each context. PR-URL: #26497 Reviewed-By: James M Snell <jasnell@gmail.com>
This allows using `DOMException` from Node.js code for any `vm.Context`. PR-URL: #26497 Reviewed-By: James M Snell <jasnell@gmail.com>
This enables using `MessagePort`s in different `vm.Context`s, aiding with the isolation that the `vm` module seeks to provide. Refs: ayojs/ayo#111 PR-URL: #26497 Reviewed-By: James M Snell <jasnell@gmail.com>
Notable changes:
* crypto
* Allow deriving public from private keys (Tobias Nießen)
[#26278](#26278).
* events
* Added a `once` function to use `EventEmitter` with promises
(Matteo Collina) [#26078](#26078).
* tty
* Added a `hasColors` method to `WriteStream` (Ruben Bridgewater)
[#26247](#26247).
* Added NO_COLOR and FORCE_COLOR support (Ruben Bridgewater)
[#26485](#26485).
* v8
* Added `v8.getHeapSnapshot` and `v8.writeHeapSnapshot` to generate snapshots
in the format used by tools such as Chrome DevTools (James M Snell)
[#26501](#26501).
* worker
* Added `worker.moveMessagePortToContext`. This enables using MessagePorts in
different vm.Contexts, aiding with the isolation that the vm module seeks to
provide (Anna Henningsen)
[#26497](#26497).
* C++ API
* `AddPromiseHook` is now deprecated. This API was added to fill an use case
that is served by `async_hooks`, since that has `Promise` support
(Anna Henningsen) [#26529](#26529).
* Added a `Stop` API to shut down Node.js while it is running
(Gireesh Punathil) [#21283](#21283).
* meta
* [Gireesh Punathil](https://github.com/gireeshpunathil) is now a member of
the Technical Steering Committee
[#26657](#26657).
* Added [Yongsheng Zhang](https://github.com/ZYSzys) to collaborators
[#26730](#26730).
PR-URL: #26949
Notable changes:
* crypto
* Allow deriving public from private keys (Tobias Nießen)
[#26278](#26278).
* events
* Added a `once` function to use `EventEmitter` with promises
(Matteo Collina) [#26078](#26078).
* tty
* Added a `hasColors` method to `WriteStream` (Ruben Bridgewater)
[#26247](#26247).
* Added NO_COLOR and FORCE_COLOR support (Ruben Bridgewater)
[#26485](#26485).
* v8
* Added `v8.getHeapSnapshot` and `v8.writeHeapSnapshot` to generate snapshots
in the format used by tools such as Chrome DevTools (James M Snell)
[#26501](#26501).
* worker
* Added `worker.moveMessagePortToContext`. This enables using MessagePorts in
different vm.Contexts, aiding with the isolation that the vm module seeks to
provide (Anna Henningsen)
[#26497](#26497).
* C++ API
* `AddPromiseHook` is now deprecated. This API was added to fill an use case
that is served by `async_hooks`, since that has `Promise` support
(Anna Henningsen) [#26529](#26529).
* Added a `Stop` API to shut down Node.js while it is running
(Gireesh Punathil) [#21283](#21283).
* meta
* [Gireesh Punathil](https://github.com/gireeshpunathil) is now a member of
the Technical Steering Committee
[#26657](#26657).
* Added [Yongsheng Zhang](https://github.com/ZYSzys) to collaborators
[#26730](#26730).
PR-URL: #26949
Notable changes:
* crypto
* Allow deriving public from private keys (Tobias Nießen)
[#26278](#26278).
* events
* Added a `once` function to use `EventEmitter` with promises
(Matteo Collina) [#26078](#26078).
* tty
* Added a `hasColors` method to `WriteStream` (Ruben Bridgewater)
[#26247](#26247).
* Added NO_COLOR and FORCE_COLOR support (Ruben Bridgewater)
[#26485](#26485).
* v8
* Added `v8.getHeapSnapshot` and `v8.writeHeapSnapshot` to generate snapshots
in the format used by tools such as Chrome DevTools (James M Snell)
[#26501](#26501).
* worker
* Added `worker.moveMessagePortToContext`. This enables using MessagePorts in
different vm.Contexts, aiding with the isolation that the vm module seeks to
provide (Anna Henningsen)
[#26497](#26497).
* C++ API
* `AddPromiseHook` is now deprecated. This API was added to fill an use case
that is served by `async_hooks`, since that has `Promise` support
(Anna Henningsen) [#26529](#26529).
* Added a `Stop` API to shut down Node.js while it is running
(Gireesh Punathil) [#21283](#21283).
* meta
* [Gireesh Punathil](https://github.com/gireeshpunathil) is now a member of
the Technical Steering Committee
[#26657](#26657).
* Added [Yongsheng Zhang](https://github.com/ZYSzys) to collaborators
[#26730](#26730).
PR-URL: #26949
| Back | FazBrowse Home | New Git URL |
src,lib: allow running multiple per-context files
Create an lib/internal/per_context/ directory that can
host multiple files which we execute for each context.
src,lib: make DOMException available in all Contexts
This allows using DOMException from Node.js code for any
vm.Context.
worker: implement worker.moveMessagePortToContext()
This enables using MessagePorts in different vm.Contexts,
aiding with the isolation that the vm module seeks to provide.
Checklist