You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vpx: watch reports for vpx --watch, and vpx watch on oxc-node's watcher #3141
Follow-up to #2936. vpx --watch is Node.js watch mode with the script loader. It restarts when an imported file changes, but not in two common cases, which tsx watch misses as well:
A tsconfig edit, such as a new paths mapping.
A file an import is waiting for, created after the first run (import "./later.js", then later.ts is added).
It also has none of tsx watch's options: include and exclude globs, clearing the screen, rerunning on Enter, a kill timeout, or polling for Docker, WSL, and network drives.
Dependency reports. With enable_watch_report on, the binding records the tsconfig files it reads and the paths a failed resolve looked for. @oxc-node/core's loader sends them as { "watch:import": [url] } over IPC, the message Node.js's own watcher already reads, so node --watch restarts on them.
oxnode watch. A tsx-style watcher, about 2,500 lines of TypeScript on Node.js built-ins.
Plan
Reports for vpx --watch. Forward enable_watch_report and take_watch_dependencies in packages/cli/binding/src/oxc_node.rs. Port the relay into vpx's loader: the preload reports on the in-thread path, and the off-thread hooks send through a channel to the main thread. It is on only when WATCH_REPORT_DEPENDENCIES is set. vpx --watch then restarts on tsconfig edits and created files, with no new process.
Signal ack. Port the child's side of OXNODE_SIGNAL_ACK into the preload, so the watcher does not deliver Ctrl+C twice when it runs in a pipe or the background.
Done in #3164 and #3167, with one change to the plan:
Reports and signal ack (steps 1 and 2) shipped as planned in feat(vpx): run vpx --watch on oxc-node's watcher #3164: vpx --watch restarts on tsconfig edits, including a file it extends, and on a file a failed import looked for once it is created, and a Ctrl+C reaches the script once when the watcher is not the terminal's foreground job.
The watcher runs as vpx --watch, not vpx watch (step 3). vpx --watch now runs oxc-node's watcher with the vpx loader instead of Node.js' own watch mode, and takes tsx watch's options (--include, --exclude, --clear-screen, --kill-timeout, --rerun-on-enter, --poll, …). vpx watch stays package mode and still runs the npm package watch, so the subcommand in the notes above did not happen. Through vpx, Node.js' --watch-path (use --include) and --test --watch are errors now.
The vp migrate rule moves to a separate follow-up that migrates tsx scripts as a whole (Node.js range check, every tsx invocation, removing the devDependency) instead of rewriting only tsx watch.
Activity
docs(vpx): bring the RFC up to date
feat(vpx): restart `vpx --watch` on tsconfig edits and created files
feat(vpx): add `vpx watch` on oxc-node's watcher
feat(vpx): restart `vpx --watch` on tsconfig edits and created files
feat(vpx): add `vpx watch` on oxc-node's watcher
feat(vpx): run `vpx --watch` on oxc-node's watcher (#3164)
fengmk2 commentedon Oct 21, 2026
Done in #3164 and #3167, with one change to the plan:
vpx --watchon oxc-node's watcher #3164:vpx --watchrestarts on tsconfig edits, including a file itextends, and on a file a failed import looked for once it is created, and a Ctrl+C reaches the script once when the watcher is not the terminal's foreground job.vpx --watch, notvpx watch(step 3).vpx --watchnow runs oxc-node's watcher with the vpx loader instead of Node.js' own watch mode, and takestsx watch's options (--include,--exclude,--clear-screen,--kill-timeout,--rerun-on-enter,--poll, …).vpx watchstays package mode and still runs the npm packagewatch, so the subcommand in the notes above did not happen. Throughvpx, Node.js'--watch-path(use--include) and--test --watchare errors now.--experimental-config-fileand Windows Ctrl+C #3167 fixed script detection for a bare--experimental-config-file, and made the globalvpxandvp runon Windows wait for the script's own Ctrl+C cleanup.Not done here:
vp migraterule moves to a separate follow-up that migrates tsx scripts as a whole (Node.js range check, everytsxinvocation, removing the devDependency) instead of rewriting onlytsx watch.oxnode watchrestart leaves processes the app started running, so a port stays busy oxc-project/oxc-node#875 (a restart stops the script's process only, so a server it started in a subprocess can keep its port;tsx watchandnode --watchbehave the same) and An explicit.jsentry, and./x.jsimported from JavaScript, run a sibling.tsfile oxc-project/oxc-node#878 (an explicit.jsentry runs a sibling.tsfile).oxnode watch --tsconfigis overridden byTS_NODE_PROJECTfrom--env-fileoxc-project/oxc-node#876 is fixed upstream and never affectedvpx, which passes--tsconfigto the loader itself.