ReviewOS

home-lang/home

fix(ts-watch): observe edits to transitive imported sources

#924
Closed glennmichael123 opened this 8 days ago ·
8 days ago

The CLI watch loop tracks only input_files, while Program.loadImportClosureParallel has already added transitive imported sources. Edits to imported files therefore never enter Watcher.tick, even though Program.updateSource/recompileChanged can invalidate importers. Track all loaded program paths (while retaining missing root paths), prove an imported-file edit is reported and recompiled, and keep file deletion semantics in #923. Parent #66; prerequisite to #923. No source substitution or test weakening.

8 days ago

Fixed on main in 40cfdba (fix(ts-watch): track transitive program sources (#924)). The CLI now retains root tracking and also tracks every file admitted by Program's initial import closure. A new real Program + virtual filesystem test changes only an imported dependency, observes the watch event, recompiles the importer, and checks that its prior TS2322 diagnostic clears. Test execution is forced in the build graph to avoid cached-pass claims. Guarded results under 3,840 MB: watch 20/20 and tsc_main 51/51 on both pinned Zig 0.17 and Zig 0.18; home-tsc Debug builds on both; observed peak 2,221 MB. Deletion/invalidation remains open in #923, and newly introduced imports after the initial closure are not claimed here.

Sign in to comment on this issue.