-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Proof of concept: Shared worker plugins #2478
Conversation
5a01bf5
to
d673850
Compare
Wow I think I got this working (let's see what CI says). There's a proof of concept here: https://github.com/avajs/ava/tree/shared-worker-plugins/test/shared-workers/proof-of-concept/fixtures But I'll try and build something real on top of this next. |
d4b5a96
to
8ff98cc
Compare
5bde5aa
to
ac8daf1
Compare
f19aa09
to
aba2021
Compare
I think I have full code coverage… will try and update my other proof-of-concept packages and then see if I can sneak this into a release. |
aba2021
to
f0d6f8b
Compare
58295c3
to
e610cac
Compare
Maybe it's the IPC changes, but they started to fail on Windows.
e610cac
to
1e85865
Compare
I'm looking to sneak this into a release, but I still have to update the issues, plan work, document things, and ship some example packages… |
"Shared workers" are code that runs in AVA's main process, that can communicate with test workers.
The idea is that a test file can require a module which registers itself as a plugin. The main process launches a worker thread (so this is a Node.js 12+ feature) which can communicate with all test files.
The worker thread would survive across watcher runs, under the assumption that the worker code came from a third-party and so doesn't need to be reloaded.
Advanced serialization is used for the communication between the test worker, main processes and worker thread. Consequently this requires Node.js 12.16. Though I'm also using some features introduced in Node.js 12.17.
This should give us the low-level primitives for #2048 and #1366.