Fix incremental source scanning in WASM builds - #20487
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe scanner now uses the parallel walker for repeated scans only on Unix and Windows targets. Other platforms always use the synchronous walker. A WASI integration test covers initial, unchanged, and modified scans. It verifies candidate results, scanned files, and file metadata updates. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to WASM incremental scans now retain discovered files and detect edited source files without changing native parallel scan behavior. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Oxide uses the synchronous filesystem walker for the initial source scan, then switches to the parallel walker for subsequent scans. The vendored parallel walker only implements directory entry construction on Unix and Windows; on other targets such as
wasm32-wasip1-threads, it returns anunsupported platformerror before walking any files.Because those walker errors are skipped, a reused WASM scanner clears its discovered file set on the second scan and cannot detect newly introduced candidates in edited source files.
This change uses the parallel walker for incremental scans only on platforms where it is implemented (
unixandwindows), falling back to the existing synchronous walker everywhere else. Native watch-mode behavior and its parallel scanning optimization remain unchanged.It also adds a WASI integration test that reuses one
Scanneracross an initial scan, an unchanged scan, and an mtime-advanced source edit. The test verifies candidate discovery as well as thefilesandscannedFilesstate.[ci-all]
Test plan
pnpm testCARGO_PROFILE_RELEASE_LTO=off pnpm run buildpnpm run test:integrations ./integrations/oxide/wasm.test.ts -t "discovers changes across incremental scans"cargo test -p tailwindcss-oxide