Skip to content

Fix incremental source scanning in WASM builds - #20487

Open
kkrausse wants to merge 2 commits into
tailwindlabs:mainfrom
kkrausse:fix/wasm-incremental-scanning
Open

Fix incremental source scanning in WASM builds#20487
kkrausse wants to merge 2 commits into
tailwindlabs:mainfrom
kkrausse:fix/wasm-incremental-scanning

Conversation

@kkrausse

Copy link
Copy Markdown

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 an unsupported platform error 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 (unix and windows), 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 Scanner across an initial scan, an unchanged scan, and an mtime-advanced source edit. The test verifies candidate discovery as well as the files and scannedFiles state.

[ci-all]

Test plan

  • pnpm test
    • All Rust tests and doc-tests passed.
    • 5,497 TypeScript tests passed; one existing test was skipped.
  • CARGO_PROFILE_RELEASE_LTO=off pnpm run build
  • pnpm run test:integrations ./integrations/oxide/wasm.test.ts -t "discovers changes across incremental scans"
    • Passed locally with the file's Linux-only platform guard temporarily bypassed on macOS; it runs without that override in Linux CI.
  • cargo test -p tailwindcss-oxide

@kkrausse
kkrausse requested a review from a team as a code owner September 12, 2026 03:27
@greptile-apps

greptile-apps Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the platform fallback aligns with the walker implementations and the integration test covers the reported incremental-scan failure.

Reviews (1) · Last reviewed commit: "Use synchronous source walking for WASM ..."

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 75ed9a41-ec46-483c-82ad-2a37583e5db2

📥 Commits

Reviewing files that changed from the base of the PR and between 41d9cae and 11050dd.

📒 Files selected for processing (2)
  • crates/oxide/src/scanner/mod.rs
  • integrations/oxide/wasm.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

The 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 11050

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)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the WASM incremental scanning bug, the platform-specific walker change, and the added regression test. It directly matches the changeset and objectives.
Title check ✅ Passed The title clearly and concisely identifies the main change: fixing incremental source scanning in WASM builds.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant