Skip to content

webviews: the gallery dev server pre-bundles its stages' deps up front - #35985

Merged
teamleaderleo merged 2 commits into
feat-cmux-nextfrom
lane/gallery-dev-prebundle
Nov 5, 2026
Merged

teamleaderleo merged 2 commits into
feat-cmux-nextfrom
lane/gallery-dev-prebundle

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The gallery dev server (vite.config.gallery-dev.ts, which the webviews test runner uses for its seed-gallery servers) now scans its pages' dependencies up front, so it never re-optimizes mid-run.

That config filters out the dev server's plugins, and with them the optimizeDeps entries the dev server's shell set. Its first scan then found only the gallery shell's dependencies. A stage that imported another one (a Base UI part, TanStack Virtual or Query, pretext) triggered a re-optimize that renamed the shared chunks under the open pages. In run 41942282745 (#34983), accent-glass-invariants-3 hit Pre-transform error: The file does not exist at .../vite/seed-gallery-1/deps/with-selector-CmGIwqRk.js, then newPage: Target page, context or browser has been closed, and timed out at 450 s.

The gallery's pages and the Monaco exclude are now one export, galleryOptimizeDeps in dev-server/plugins.ts, which both configs use.

Takes back #35312: not in effect. It added src/gallery/mock-app.html to the dev server's scan entries; that line moves into the shared galleryOptimizeDeps.entries, which the dev server still spreads into its list, so both servers now scan the mock app.

Test

bun test test/gallery-dev-prebundles-deps.test.ts (from webviews/) starts the gallery server on a fresh CMUX_VITE_CACHE_DIR, as the runner's warming file does, waits for the first scan, and checks that it contains dependencies only the stages import.

  • Base (test commit only): fails, @base-ui/react/dialog was not in the first scan.
  • Head: passes, 5/5 expects.

Observed / Not run

  • Ran the test above locally at base and at head, plus tsc --noEmit and oxlint on the changed files.
  • test/react-compiler-skips-optimized-deps.test.ts fails on this host at base and at head alike: its probe in a temp folder can't resolve vite. That's unrelated to this change.
  • Fleet red/green (run 41947967236): head passed 3/3, fix reverted passed 0/3.
  • Not run: the full accent-glass sweep; the mid-run re-optimize was intermittent.

Changelog

none

Agent session: agent session

🤖 Generated with Claude Code

teamleaderleo and others added 2 commits November 5, 2026 01:18
… deps

Red at base: @base-ui/react/dialog was not in the first scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-cb8b9969051e7411b140
vite.config.gallery-dev.ts filters out the dev server's plugins, and with them
the optimizeDeps entries the dev server's shell set. The gallery server's first
scan then missed every dependency below a stage's entry (Base UI parts, TanStack
Virtual and Query, pretext), so a stage that imported one re-optimized mid-run
and renamed the shared chunks under the open pages: accent-glass-invariants-3
lost its browser and timed out (run 41942282745, 'The file does not exist at
.../deps/with-selector-CmGIwqRk.js').

The gallery's pages and the Monaco exclude are now one export both configs use.

test/gallery-dev-prebundles-deps.test.ts: red at base (@base-ui/react/dialog
was not in the first scan), green here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-cb8b9969051e7411b140
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 0a15880: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr35985 -f ref=lane/gallery-dev-prebundle -f platform=macos -f backend_mode=local

Shipped in:

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 5, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Fleet red/green (run 41947967236, tested 0a15880): bun test test/gallery-dev-prebundles-deps.test.ts three times at head passed 3/3. With the fix reverted (git apply -R of the two source files) it passed 0/3, failing with @base-ui/react/dialog was not in the first scan.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 0a15880

Reviewer: codex gpt-6.1-sol xhigh, fast tier.

SHIP at 0a15880

Visual verdict: no images; Leo tries the build

Inspected the shared dependency configuration and fresh-cache probe; no actionable issues found.

Follow-ups: none

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves 0a15880: an independent review passed this exact head (router-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@teamleaderleo teamleaderleo added the risk:low Risk tier (docs/ci/risk-tiers.md) label Nov 5, 2026
@github-actions github-actions Bot removed the risk:low Risk tier (docs/ci/risk-tiers.md) label Nov 5, 2026
@teamleaderleo
teamleaderleo merged commit 62326c0 into feat-cmux-next Nov 5, 2026
234 of 250 checks passed
@teamleaderleo
teamleaderleo deleted the lane/gallery-dev-prebundle branch November 5, 2026 01:51

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 0a15880f Deployed Nov 5, 2026 by teamleaderleo via wait for same-key tree publisher #113680
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant