Skip to content

Tighten computed projection typing#817

Merged
patroza merged 2 commits into
mainfrom
t3code/project-computed-type-safety
Jul 4, 2026
Merged

Tighten computed projection typing#817
patroza merged 2 commits into
mainfrom
t3code/project-computed-type-safety

Conversation

@patroza

@patroza patroza commented Jul 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Tighten projectComputed typing so projection schemas must match encoded repo fields and computed output types.
  • Add typed computed projection outputs for relation helpers like count, any, collect, and collectFields.
  • Support union projection schemas by collecting keys from every encoded object variant, including computed keys present on only one variant.
  • Keep runtime validation for missing or extra computed keys, with invalid construction sites now locked by @ts-expect-error.

Testing

  • pnpm lint-fix
  • pnpm check

- constrain `projectComputed` schema keys to encoded fields and computed outputs
- add type-level coverage for invalid projection and computed key shapes
@pkg-pr-new

pkg-pr-new Bot commented Jul 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

@effect-app/cli

npm i https://pkg.pr.new/effect-app/libs/@effect-app/cli@817

effect-app

npm i https://pkg.pr.new/effect-app/libs/effect-app@817

@effect-app/eslint-codegen-model

npm i https://pkg.pr.new/effect-app/libs/@effect-app/eslint-codegen-model@817

@effect-app/eslint-shared-config

npm i https://pkg.pr.new/effect-app/libs/@effect-app/eslint-shared-config@817

@effect-app/infra

npm i https://pkg.pr.new/effect-app/libs/@effect-app/infra@817

@effect-app/vue

npm i https://pkg.pr.new/effect-app/libs/@effect-app/vue@817

@effect-app/vue-components

npm i https://pkg.pr.new/effect-app/libs/@effect-app/vue-components@817

commit: 96c83ff

@patroza patroza merged commit d1c15d3 into main Jul 4, 2026
4 of 5 checks passed
@patroza patroza deleted the t3code/project-computed-type-safety branch July 4, 2026 15:56
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