Skip to content

fix(react): pre-scan client page deps in Pages dev - #620

Open
0froq wants to merge 2 commits into
voidzero-dev:mainfrom
0froq:cursor/fix-client-optimize-deps-34b5
Open

0froq wants to merge 2 commits into
voidzero-dev:mainfrom
0froq:cursor/fix-client-optimize-deps-34b5

Conversation

@0froq

@0froq 0froq commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #599

Summary

In @void/react Pages apps, the worker environment already crawls pages/** via optimizeDeps.entries, but the client environment only gets include: CLIENT_OPTIMIZE_DEPS. On a cold Vite cache the client scanner therefore finds no dependencies, discovers page imports (and the virtual void/pages-prefetch module) while serving the first page, and forces a full reload (optimized dependencies changed. reloading).

Changes

  • Set client optimizeDeps.entries to the same pages glob as the worker, excluding *.server.* companions.
  • Add void/pages-prefetch to client optimizeDeps.include (imported only from the virtual client entry, so the scanner cannot see it).

Testing

  • pnpm exec vp test run packages/react/test/unit/plugin-pages.test.ts (30 passed; asserts client entries + void/pages-prefetch include)

🐸

0froq and others added 2 commits October 30, 2026 13:52
Fixes voidzero-dev#599

## Summary

In `@void/react` Pages apps, the worker environment already crawls
`pages/**` via `optimizeDeps.entries`, but the client environment only
gets `include: CLIENT_OPTIMIZE_DEPS`. On a cold Vite cache the client
scanner therefore finds no dependencies, discovers page imports (and
the virtual `void/pages-prefetch` module) while serving the first page,
and forces a full reload (`optimized dependencies changed. reloading`).

## Changes

- Set client `optimizeDeps.entries` to the same pages glob as the
  worker, excluding `*.server.*` companions.
- Add `void/pages-prefetch` to client `optimizeDeps.include` (imported
  only from the virtual client entry, so the scanner cannot see it).

## Testing

- `pnpm exec vp test run packages/react/test/unit/plugin-pages.test.ts`
  (30 passed; asserts client entries + `void/pages-prefetch` include)
…iles

- Include void/pages-client, which only the virtual islands entry imports,
  so an island page does not reload on a cold first load.
- Leave island pages and __tests__ out of the client scan entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Brooooooklyn

Copy link
Copy Markdown
Member

@codex review

@Brooooooklyn
Brooooooklyn force-pushed the cursor/fix-client-optimize-deps-34b5 branch from 766bd4b to 08a1f46 Compare October 30, 2026 06:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-30T07:09:13.136188Z
We couldn’t complete this review. Comment @codex review to try again.
08a1f46 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Brooooooklyn

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
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.

@void/react: client environment has no optimizeDeps.entries for pages, causing a dev re-optimization reload on first load

2 participants