Skip to content

adopt resolved server.watch.ignored from vite config - #350

Merged
raphamorim merged 3 commits into
oscar/start-watch-app-rootfrom
rapha/adopt-watch-ignored
Oct 10, 2026
Merged

raphamorim merged 3 commits into
oscar/start-watch-app-rootfrom
rapha/adopt-watch-ignored

Conversation

@raphamorim

@raphamorim raphamorim commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #345. Vite parity for server.watch.ignored, plus the diagnostics that root-caused the wasm-playground CI failures on this stack. It does NOT green that test by itself; see below.

Resolved server.watch.ignored now reaches the watcher. oj built its ignore globs from the config file's own server.watch.ignored, but plugin config hooks can add entries that exist only in the RESOLVED config, and Vite's chokidar is configured from the resolved value. The extractor already runs vite.resolveConfig with plugin config hooks, so it now emits the string globs as watchIgnored and the adopter merges them into server.watch.ignored. Unlike the fill-if-unset fields this one unions, since Vite's mergeConfig concatenates ignore arrays and a user list must not displace plugin entries. RegExp and function matchers cannot cross the bridge and are dropped, as oj's WatchConfig already documents.

What the wasm-playground failures actually are. The diagnostics here (the e2e dumps the server log tail and logs page loads on failure; the Start watcher names the paths that trip each rebuild) pinned it on CI: the page reloads every ~1.8s from first connect, and every cycle is rebuilding for www/.wrangler/state/v3/observability/miniflare-wobs-trace-store/<hash>.sqlite-wal. miniflare writes its state under .wrangler/ during workerd activity; pre-#345 the Start watcher only heard src/, with #345 it rides the full root feed, and pre-gate Start answers ANY relevant event with a rebundle and a reload, so workerd activity feeds itself. vite-plugin-cloudflare does not exclude .wrangler from watching (its **/.wrangler/** entry is server.fs.deny, the serve deny list), so Vite receives these same events and stays quiet for a different reason: it reacts through the module graph, and these paths are in no graph. That module-graph-shaped reaction is exactly the #349 gate, which is why wasm-playground passes on #349 and on nothing earlier in the stack. #345 and #346 stay red on that step until the gate lands.

Test

Unit: extraction emits watchIgnored string globs only; the merge unions with an existing user list without duplicating and fills when unset. Live-checked on a cloudflare Start app: the extraction carries the field and the resolved list is empty there, matching what Vite's chokidar gets for that plugin.

@raphamorim
raphamorim requested a review from a team as a code owner October 10, 2026 08:02
@raphamorim
raphamorim merged commit 402b079 into oscar/start-watch-app-root Oct 10, 2026
6 of 7 checks passed
@raphamorim
raphamorim deleted the rapha/adopt-watch-ignored branch October 10, 2026 09:15
raphamorim added a commit that referenced this pull request Oct 10, 2026
* start dev: invalidate the worker for edits outside src/

Start mode ran a second file watcher on <root>/src only, and the worker
invalidation, the lazy runner's dirty flag and the client rebundle hung off
it. An edit outside src/ reached the browser through oj_server's watcher but
never the worker, which kept rendering the old module until a restart.

The Start watcher thread now subscribes to oj_server's watcher (WatchFeed),
published from the notify callback so it adds no debounce and never waits on
the watcher thread's plugin-hook RPCs. watch_relevant also skips the route
generator's .tanstack/ temp files and declaration files, which a root-wide
watch now sees.

* adopt resolved server.watch.ignored from vite config (#350)

* adopt resolved server.watch.ignored from vite config

* dump server log and page loads on playground failure

* log which paths trigger a start rebuild

* watch new top-level entries, skip relocated cache dir (#346)

* watch new top-level entries, skip relocated cache dir

* exclude Vite config-loader temp files from watching

* adopt dirs renamed into the root, not just created

* gate Start rebundle and reload on served module graphs (#349)

---------

Co-authored-by: Raphael Amorim <rapha850@gmail.com>
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