jest icon indicating copy to clipboard operation
jest copied to clipboard

feat(jest-worker)!: replace `Worker` class export with `createWorkerFarm()` factory function

Open mrazauskas opened this issue 3 years ago • 2 comments

Part of #12274

Summary

Here is an attempt to replace Worker class exported from jest-worker with an async createWorkerFarm() factory function. This is needed to allow worker modules in ESM syntax.

The createWorkerFarm() function is implemented – it simply does some validation and returns and instance of WorkerFarm class. I have spend some time to make TypeScript usage smoother.

I managed to reshape jest-worker's implementation in jest-reporters and jest-runner, but got stuck with jest-haste-map. Will try again, not giving up yet (;

Test plan

Unit tests and type tests are added. All must pass.

mrazauskas avatar Apr 16 '22 11:04 mrazauskas

@mrazauskas I'm planning to release 28 stable in the next few days (possibly this weekend). Just a heads up 🙂 I plan to have v29 come out when node 17 is EOL in June, so not too far into the future if you wanna wait. No rush either way 👍

SimenB avatar Apr 20 '22 11:04 SimenB

Sure. I moved forward with refactoring jest-haste-map. That is tricky case. Will figure it out slowly.

mrazauskas avatar Apr 20 '22 14:04 mrazauskas

Oh.. That’s to complicated to rebase and I can’t integrate it with haste module anyways. Leaving this for smarter than me (; Closing to have less noise around.

mrazauskas avatar Oct 19 '22 12:10 mrazauskas

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

github-actions[bot] avatar Nov 19 '22 00:11 github-actions[bot]