GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — watch: add initial implementation for `node --watch` by MoLow · Pull Request #44366 · nodejs/node Conversation
|
|
Review requested:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
node --watch
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
2d1f1cb to
e8323f0
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
e8323f0 to
65d5f5b
Compare
There was an error while loading. Please reload this page.
a64b5c8 to
cfad875
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
fd9c710 to
e73ee24
Compare
e73ee24 to
e8c2d61
Compare
There was an error while loading. Please reload this page.
e8c2d61 to
f497852
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Oh, I see that the inspector tests are already moved to sequential in #44551, though unfortunately the flake is still here (e.g. https://ci.nodejs.org/job/node-test-commit-aix/42722/) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@joyeecheung out of these 6 failed runs, and here: however, I do see some flakes that seem to be related to the overall system load (i.e it looks like the failures happen when the program is not restarted and it should be): watch mode does include parts that relay on both CPU (file change throttling) & disk loads, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
After landing this into the v16.x branch, this test fails: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Watch mode seems wonderful but I need a way to say I really want to exit without a restart. Is there an API or an option on Exit? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
@BobFrankston can you kindly open an issue with an example describing your use case? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Since the documentation is sparse, I conflated **nodemon'**s automatic restart with the restart on change. I realize --watch may not only do a restart on change but not assure the program continues to run after failure. Both are useful but distinct. If it only restarts on change, then it's worth thinking about a --persist or related option. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Maybe it would be good to add the ability to handle multiple entry points? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I am experiencing an issue where on some restarts, it seems watch mode restarts constantly for up to about 60 seconds - Eventually it recovers and runs normally. I'm running on Windows 11 x64, Node v19.8.1 (not quite latest). Process Explorer confirmed that it was rapidly restarting and making 100s (or 1000s) of new processes that were dying quickly. My app does not modify local files. I believe my editor is also not repeatedly editing files. I'm not even sure where/how to start debugging this... I should probably make a new issue.Uuntil I pull all the details into a real issue, this will have to suffice ;) @mule-stand Running @BobFrankston You can add an infinite sleep at the end of your own program to keep |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cinderblock Please open an issue. This PR is not the right place to discuss such problems in depth. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@cinderblock Did you open an issue for this restart thing? I am facing the same issue with Win 11 and Node 20. I try to reproduce this with a small code example, but it is kinda random and I don't know what causing the issue. Edit: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| async function restart() { | ||
| process.stdout.write(`${clear}${green}Restarting ${kCommandStr}${white}\n`); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This "clear" should be at least configurable, as the --preserveWatchOutput option with tsc
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| $ node --watch-path=./src --watch-path=./tests index.js | ||
| ``` | ||
|
|
||
| This option is only supported on macOS and Windows. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What part of this is disabled or partially functional on Linux? fs.watch() has caveats but certainly doesn't advertise as limited to Windows and macOS.
Is there an open issue for making this supported on Linux?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
nodemon (or similar) in core
There was an error while loading. Please reload this page.