Skip to content

Preserve tuple types in typed fetch responses - #840

Merged
cpojer merged 3 commits into
mainfrom
codex/fix-typed-fetch-tuples
Nov 16, 2026
Merged

cpojer merged 3 commits into
mainfrom
codex/fix-typed-fetch-tuples

Conversation

@yangshun

@yangshun yangshun commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Preserves tuples in typed fetch responses and correctly types JSON nulls and omitted object properties. Branded arrays retain their array methods, and readonly arrays remain readonly.

Fixes #839.

Verified a sample app against its actual generated .void/routes.d.ts with strict and exactOptionalPropertyTypes:

const typedPairs: [number, number][] = pairs.pairs; // compiles without a response cast
  • Compiler regression coverage checks exact inferred types and invalid usage. It reproduced the old number[][] assignment error before the fix.
  • Sample app: production build passed; 8/8 browser/API checks passed twice in both dev and production, with no console errors or failed requests.
  • Updated revision: full builds, workspace typechecks, formatting, lint, and 17,011 local tests passed. The compiler regressions cover Zod brands, readonly arrays, and additional array properties.

All applicable GitHub CI checks pass on the updated revision, including both integration shards and npm/pnpm prepublish checks.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://codex-fix-typed-fetch-tuples-void-cloud.voidzero-docs.workers.dev (commit dc5e3a6)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9192bd55-void-cloud.voidzero-docs.workers.dev dc5e3a6 2026-11-16T00:04:30.760Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://6ca4cd59-void-cloud.voidzero-docs.workers.dev 27a0fdf 2026-11-15T23:58:08.785Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://52dc37de-void-cloud.voidzero-docs.workers.dev 0683b03 2026-11-15T23:15:21.104Z Visit the dashboard ↗

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@cpojer
cpojer merged commit fa1683d into main Nov 16, 2026
19 checks passed
@cpojer
cpojer deleted the codex/fix-typed-fetch-tuples branch November 16, 2026 00:12
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.

Typed fetch widens tuples in route responses to plain arrays

2 participants