watch: track worker thread entry files in --watch mode#62368
watch: track worker thread entry files in --watch mode#62368SudhansuBandha wants to merge 4 commits intonodejs:mainfrom
Conversation
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
|
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.
|
@clemyan |
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