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

refactor(jest-worker)!: allow only absolute workerPath #12343

Merged
merged 2 commits into from
Feb 9, 2022
Merged

refactor(jest-worker)!: allow only absolute workerPath #12343

merged 2 commits into from
Feb 9, 2022

Conversation

mrazauskas
Copy link
Contributor

Summary

jest-worker continued.

It might be good idea to accept only absolute workerPath.

Right now the BaseWorkerPool class if trying to resolve relative workerPath from node_modules/jest-worker/build/base/BaseWorkerPool.js. Seems like this might break if jest-worker's build is bundled. Or I missed something?

More over the main Worker class is requiring the same workerPath to be able detect exposed methods: https://github.com/facebook/jest/blob/b89a1bbe3652a3f5a8969ce768f3b74298ca021d/packages/jest-worker/src/index.ts#L31-L33

Can the same relative path work in both of the classes, which live in different directories? Not sure. With absolute workerPath all is clear and simple.

Test plan

Tests should pass.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this makes sense to do, thanks! 👍

@mrazauskas
Copy link
Contributor Author

Good. This came to my mind, just because you are doing lots of bundling refinements right now.

I would like to add more validation, e.g. if exposedMethods are really exposed. And finally to make it possible to load ESM worker modules. Draft is ready, but it is definitely too heavy for review. Moving forward step by step.

@SimenB SimenB merged commit d193e5e into jestjs:main Feb 9, 2022
@mrazauskas mrazauskas deleted the refactor-workerPath-always-absolute branch February 9, 2022 15:02
@github-actions
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants