Title: --watch should monitor replaced files · Issue #51621 · nodejs/node · GitHub
Open Graph Title: --watch should monitor replaced files · Issue #51621 · nodejs/node
X Title: --watch should monitor replaced files · Issue #51621 · nodejs/node
Description: What is the problem this feature will solve? Currently, --watch watches an inode and not necessarily what the user might consider a "file". This can cause confusion on systems that write to disk by deleting the old file and then creating...
Open Graph Description: What is the problem this feature will solve? Currently, --watch watches an inode and not necessarily what the user might consider a "file". This can cause confusion on systems that write to disk by...
X Description: What is the problem this feature will solve? Currently, --watch watches an inode and not necessarily what the user might consider a "file". This can cause confusion on systems that write ...
Opengraph URL: https://github.com/nodejs/node/issues/51621
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"--watch should monitor replaced files","articleBody":"### What is the problem this feature will solve?\r\n\r\nCurrently, `--watch` watches an [inode](https://nodejs.org/docs/latest/api/fs.html#inodes) and not necessarily what the user might consider a \"file\". This can cause confusion on systems that write to disk by deleting the old file and then creating a new one.\r\n\r\nFor example, when using Docker Compose's [`watch`](https://docs.docker.com/compose/file-watch/) mode, the watched file is first deleted. When a new file is created Node currently fails to restart on file changes, as node is still watching the inode of the deleted file, and doesn't react to the new file being created.\r\n\r\n### What is the feature you are proposing to solve the problem?\r\n\r\nWhile this behavior makes sense for the lower-level and more \"raw\" `fs.watch()`, perhaps the more general `--watch` behavior can be expanded to be smarter about detecting replaced files. Alternatively, a new flag can be introduced with this behavior.\r\n\r\n### What alternatives have you considered?\r\n\r\nOther alternatives require using one of the different file watcher libs. That seems like a step down from the otherwise awesome native `watch` feature.\r\n\r\n\r\nDocker Compose Issue: [[BUG] Compose Watch With “node –watch” Only Reloads First Time](https://github.com/docker/compose/issues/11090)\r\nDocker Issue: [node --watch doesn't work well within a container](https://github.com/moby/moby/issues/47061)","author":{"url":"https://github.com/mbrevda","@type":"Person","name":"mbrevda"},"datePublished":"2024-01-31T17:07:56Z","url":"https://github.com/nodejs/node/issues/51621"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ceb47b8c-50ea-52cf-812b-d0bacb16558d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 892E:2F339D:7730BF:9ED338:6AED24A6 |
| html-safe-nonce | 62520b4214a6511b3490be89aabf2c5f63812e1044aaf0fd474709fccfcdd93e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTJFOjJGMzM5RDo3NzMwQkY6OUVEMzM4OjZBRUQyNEE2IiwidmlzaXRvcl9pZCI6IjM2NTM4MzA4MjM0MTMzNTk3ODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0dc892dc8fd31b55589031b50c1cbc471f0947c77ceda5458bb1795e69b80583 |
| hovercard-subject-tag | issue:2110574191 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/51621/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dfe21e7caefec892d60e98de7e2da21d9099f05602ecabc182a55df4b68fcd27/nodejs/node/issues/51621 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dfe21e7caefec892d60e98de7e2da21d9099f05602ecabc182a55df4b68fcd27/nodejs/node/issues/51621 |
| og:image:alt | What is the problem this feature will solve? Currently, --watch watches an inode and not necessarily what the user might consider a "file". This can cause confusion on systems that write to disk by... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mbrevda |
| hostname | github.com |
| expected-hostname | github.com |
| None | e3e0f7f63e50c6fe879198a93a0a023a648ecc0a5e9bc3b5e033ac57172237e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 707a24b346ac8a82878b9c084efaa38a997660cb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width