Repository navigation
fix(pages): include .dev and .prod pages only in their environment - #595
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ment Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… body Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…erver Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfe3c3da63
ℹ️ 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".
…pair A .dev + .prod pair is a union of two page shapes in PageActionMap. ActionUrl tested the whole union at once, so a pair with different named actions, or with `action` in one page and `actions` in the other, lost URLs such as `/contact?save`, and useForm rejected them. Read each shape on its own, in void/routes and in the generated copy, and check the useForm URL constraint with tsc. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bea2f7d8c9
ℹ️ 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".
…has named actions For a .dev + .prod pair where one page exports `action` and the other `actions`, the bare URL's body type also took the named-actions shape's untyped fallback, so any body passed. Read the body only from shapes that have one, and fall back to an untyped body only when none does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Fixes #558.
Pages stripped
.devand.prodfrom the URL but kept the page in every environment. Sodebug.dev.tsxshipped to production, and ahome.dev.tsx+home.prod.tsxpair failed as a duplicate route. Pages now follow the same rule asroutes/.vp devhome.tsx/homedebug.dev.tsx/debugstats.prod.tsx/statshome.dev.tsx+home.prod.tsx/homehome.tsx+home.dev.tsx/home)home.tsx/homehome.tsx+home.prod.tsxhome.tsx/homeRules:
.island:chart.dev.island.tsx.home.dev.tsxpairs withhome.dev.server.ts. A dropped page's companion is never read.home.dev,home.prod), so the two pages of a pair never share an id.Every way a
.devpage could reach production, and what closes itFramework apps that own
pages/(Nuxt and others) are unchanged.Generated types
.dev+.prodpair,void preparewrites onePageActionMapentry per URL as a union,{ dev shape } | { prod shape }. So each page's form body type-checks even when the two bodies differ.ResolveActionBodyandActionUrlinvoid/routes(and their generated copies) now read each half of that union on its own. SouseFormaccepts each page's URLs and body, even when one page hasactionand the other hasactions, or the two have different named actions. A page with only named actions no longer loosens the other page's bare-URL body. For a single page the result is the same as before.Tests
pages-scan.test.ts:.devpage;.dev+.prodpair; plain +.devand plain +.prodclashes, per environment and unfiltered; shadow warnings per environment;.dev.island; a broken companion of a dropped page is never parsed;index.dev; layouts; apageFileEnvironmenttable checked against the scanner.scan.test.ts,route-types.test.ts,plugin-routing.test.ts,pages-islands-rescan.test.ts,plugin-inference.test.ts(including a Nuxt app, whose bindings are not filtered).pages/created after the dev server starts.@void/md: serve listsdebug.dev.mdas/debug; a build leaves it and its script out.tsx-server.test.tsruns a realvp devandvp build./debuggives 200 in dev and 404 in prod,/greetingshows each environment's page, and the production types and module graphs have no.devpage.page-action-types-typecheck.test.tsrunstscon generated pair types through the sameU extends ActionUrlconstraint the adapters'useFormuses.isDevmove, the islands helpers, the type join,ResolveActionBody, the inference filter, the md filter). Each break made a test fail.vp fmt,vp lint, the void/react/vue/svelte/solid/md typechecks,vp run testand one fullvp test runpass.A separate review built real apps and found no trace of
.devfiles in any production output: bundles, manifests, prerender output,_headers, wrangler bindings or types. It also checkedvp preview, adding and removing pages whilevp devruns, andvoid prepare.Choices to check
.void/routes.d.tsfor their own environment, asroutes/already does, andvoid preparewrites both. So whilevp devruns, a.prodpage that usesuseFormshows a type error in the editor (and the other way round aftervp build). Fixing that would need a second page scan just for types, which would have to parse dev-only files during a production build. The docs say this plainly.home.tsx+home.prod.tsxerrors only at build orvoid prepare, not on the dev server, because only one page runs in dev. The same goes forroutes/..devpages (pages/_db.ts,src/db.ts) still add their bindings to production. Binding inference reads each file on its own and doesn't follow imports, as withroutes/.chart.island.dev.tsx) gets no new error. It is a dev-only regular page at/chart.island. The docs say the suffix goes first, as inchat.dev.ws.tsfor WebSocket routes.<script>is.devgets an empty client chunk in production. No page code ships.🤖 Generated with Claude Code