watch: track worker thread entry files in --watch mode#62368
watch: track worker thread entry files in --watch mode#62368SudhansuBandha wants to merge 6 commits intonodejs:mainfrom
Conversation
|
This solves the issue for the worker module itself, but not its dependencies. I.e. if a worker module imports/requires another module, modifying the latter still does not trigger re-run. |
|
I have updated changes to watch dependencies for worker as well, so changes in imported/required modules will now trigger a re-run. |
|
This is the wrong way to solve this, for a myriad of reasons: (based on a cursory glance of the code. Did not bother to actual test it)
Any solution must be integrated into Node's loading pipeline |
|
I will revert back these updates and work on the suggestions |
d26b727 to
ba11d26
Compare
franciscoarturorivera371-cyber
left a comment
There was a problem hiding this comment.
Submit the change.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
@clemyan |
|
The added test already passes on |
|
Sure!! @aduh95 I will update the tests for this. Thanks for your feedback!! |
d4e5305 to
634a756
Compare
|
@aduh95 Please do review the updated tests for the proposed changes based on behaviour of worker file and it's dependencies in --watch mode for both cjs and esm modules. |
|
Can you not put the tests in |
Currently, --watch mode only tracks dependencies from the main module graph (require/import). Worker thread entry points created via new Worker() are not included, so changes to worker files do not trigger restarts. This change hooks into Worker initialization and registers the worker entry file with the watch mode, ensuring restarts when worker files change. Fixes: nodejs#62275
… and nested dependencies
634a756 to
5486d3f
Compare
|
@aduh95 As suggested I have removed tests from |
Currently, --watch mode only tracks dependencies from the main module graph (require/import). Worker thread entry points created via new Worker() are not included, so changes to worker files do not trigger restarts.
This change hooks into Worker initialization and registers the worker entry file with the watch mode, ensuring restarts when worker files change.
Fixes: #62275