watch: track worker thread entry files in --watch mode#62368
watch: track worker thread entry files in --watch mode#62368SudhansuBandha wants to merge 7 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 |
634a756 to
5486d3f
Compare
|
@aduh95 As suggested I have removed tests from |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62368 +/- ##
==========================================
- Coverage 91.43% 89.62% -1.82%
==========================================
Files 356 706 +350
Lines 150580 219244 +68664
Branches 23602 42007 +18405
==========================================
+ Hits 137686 196496 +58810
- Misses 12625 14660 +2035
- Partials 269 8088 +7819
🚀 New features to boost your workflow:
|
9a661cd to
f7a05a3
Compare
|
/cc @nodejs/fs |
f7a05a3 to
e56a31c
Compare
|
Thank you @aduh95 for your support so far in making necessary updates to the PR and running the CI pipeline. |
|
Can we add label fs to the PR? |
|
I can confirm this solves my issue, but this does cause additional userland messages to be sent on the |
|
Hi @avivkeller @lpinca and @geeksilva97 When you have a moment, could you please take a look at this PR and share your feedback? Thank you so much! |
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 watch mode, ensuring restarts when worker files change. Fixes: nodejs#62275 Signed-off-by: SudhansuBandha <[email protected]>
… and nested dependencies
e56a31c to
a48176d
Compare
|
@MoLow Thank you for your approval. I have rebased my branch with main. If possible please do re run the CI pipeline. |
|
@MoLow Thank you for the re run. Since it is passing all the checks, is it good to be merged? |
|
@SudhansuBandha ci failures might be related and allwys fail the same tests, can you kindly investigate? |
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