Repository navigation
fix(types): Fix endpoint/rest legacy type errors with skipLibCheck off - #4140
Merged
ntucker merged 8 commits intoOct 4, 2026
Merged
Conversation
endpoint and normalizr legacy outputs (ts4.2, ts4.0, ts3.4) now inherit every newer version's src-*-types overlay, as rest already did. This replaces the TS 5.4 NoInfer builtin with the NI<T> = T fallback for TS < 4.8 consumers. normalizr re-exports memo types by name instead of `export type *` (TS 5.0 syntax that downlevel-dts leaves as is). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MpCgcZt8G8R5KARZ7z5CKE
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MpCgcZt8G8R5KARZ7z5CKE
- TS 4.0: unroll RemoveArray and approximate PartialArray (recursive conditional types need 4.1) in new src-4.0-types overlays - TS <4.2: rewrite `abstract new` to `new` in the downleveled output and drop the stale src-4.0-types Entity/EntityTypes copies - TS 4.2: ConstructorInstance<> replaces InstanceType<> on abstract TBase - TS 4.2-4.4: UnionInstance Args is unconstrained - TS 4.0-4.5: rest getPage narrows paginationField with Extract<> - CI: esmodule-types also typechecks a skipLibCheck: false consumer Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki
🦋 Changeset detectedLatest commit: ac19e20 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## claude/project-thread-bw2hx0 #4140 +/- ##
=============================================================
Coverage 97.87% 97.87%
=============================================================
Files 156 156
Lines 3057 3057
Branches 612 612
=============================================================
Hits 2992 2992
Misses 18 18
Partials 47 47 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ntucker
marked this pull request as ready for review
October 4, 2026 03:04
Base automatically changed from
claude/project-thread-mdbtb1
to
claude/project-thread-bw2hx0
October 4, 2026 03:17
…one small file - RemoveArray and PartialArray move to tupleTypes.ts; the src-4.0-types overlay replaces only that module instead of copying endpointTypes/utility - Legacy build only rewrites files that contain `abstract new (` - libcheck typetest skips TypeScript's own lib checks - Split the legacy types bullet in ci-config.mdc Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki
…to claude/project-thread-g6z5kd # Conflicts: # .cursor/rules/ci-config.mdc # scripts/build-legacy-types.sh # website/blog/2026-10-03-v0.19-batch-set.md
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki
ntucker
added a commit
that referenced
this pull request
Oct 4, 2026
#4140) * fix(types): Apply newer legacy type overlays to older TS outputs endpoint and normalizr legacy outputs (ts4.2, ts4.0, ts3.4) now inherit every newer version's src-*-types overlay, as rest already did. This replaces the TS 5.4 NoInfer builtin with the NI<T> = T fallback for TS < 4.8 consumers. normalizr re-exports memo types by name instead of `export type *` (TS 5.0 syntax that downlevel-dts leaves as is). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MpCgcZt8G8R5KARZ7z5CKE * docs(blog): Note legacy TypeScript types fix Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MpCgcZt8G8R5KARZ7z5CKE * fix(types): Fix endpoint/rest legacy type errors with skipLibCheck off - TS 4.0: unroll RemoveArray and approximate PartialArray (recursive conditional types need 4.1) in new src-4.0-types overlays - TS <4.2: rewrite `abstract new` to `new` in the downleveled output and drop the stale src-4.0-types Entity/EntityTypes copies - TS 4.2: ConstructorInstance<> replaces InstanceType<> on abstract TBase - TS 4.2-4.4: UnionInstance Args is unconstrained - TS 4.0-4.5: rest getPage narrows paginationField with Extract<> - CI: esmodule-types also typechecks a skipLibCheck: false consumer Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki * docs(blog): Link #4140 in v0.19 notes Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki * refactor(types): Isolate recursive tuple types so the 4.0 overlay is one small file - RemoveArray and PartialArray move to tupleTypes.ts; the src-4.0-types overlay replaces only that module instead of copying endpointTypes/utility - Legacy build only rewrites files that contain `abstract new (` - libcheck typetest skips TypeScript's own lib checks - Split the legacy types bullet in ci-config.mdc Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki * internal: Resolve leftover merge conflict in ci-config rule Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki * internal: Resolve leftover merge conflict in build-legacy-types.sh Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki --------- Co-authored-by: Claude <noreply@anthropic.com>
ntucker
added a commit
that referenced
this pull request
Oct 4, 2026
…i): fail-open esmodule relevance, faster rest legacy types (#4122) * internal(ci): Fail open on esmodule relevance and speed up rest legacy types The esmodule relevance flag now uses a denylist of provably irrelevant paths, so new inputs run the esmodule jobs by default. rest's legacy types build uses scripts/build-legacy-types.sh (direct downlevel-dts, d.ts-only copies) with --newer-overlays-last to keep its overlay order; ts4.0/ts4.1 output is byte-identical (8.6s -> 4.5s locally). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EEcQdob4nGVuMq91oUHC2V * internal(ci): Simplify legacy types overlay order and share docs-only paths Downlevel always runs first; --inherit-newer-overlays (rest) then applies earlier versions' custom types. Without the flag those copies were always overwritten by downlevel-dts, so endpoint/normalizr output is unchanged (ts*/ byte-identical). The esmodule and tests relevance checks now share one DOCS_ONLY path list. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EEcQdob4nGVuMq91oUHC2V * fix(types): Apply newer legacy type overlays to older TS outputs (#4138) * fix(types): Apply newer legacy type overlays to older TS outputs endpoint and normalizr legacy outputs (ts4.2, ts4.0, ts3.4) now inherit every newer version's src-*-types overlay, as rest already did. This replaces the TS 5.4 NoInfer builtin with the NI<T> = T fallback for TS < 4.8 consumers. normalizr re-exports memo types by name instead of `export type *` (TS 5.0 syntax that downlevel-dts leaves as is). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MpCgcZt8G8R5KARZ7z5CKE * docs(blog): Note legacy TypeScript types fix Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MpCgcZt8G8R5KARZ7z5CKE --------- Co-authored-by: Claude <noreply@anthropic.com> * fix(types): Fix endpoint/rest legacy type errors with skipLibCheck off (#4140) * fix(types): Apply newer legacy type overlays to older TS outputs endpoint and normalizr legacy outputs (ts4.2, ts4.0, ts3.4) now inherit every newer version's src-*-types overlay, as rest already did. This replaces the TS 5.4 NoInfer builtin with the NI<T> = T fallback for TS < 4.8 consumers. normalizr re-exports memo types by name instead of `export type *` (TS 5.0 syntax that downlevel-dts leaves as is). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MpCgcZt8G8R5KARZ7z5CKE * docs(blog): Note legacy TypeScript types fix Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MpCgcZt8G8R5KARZ7z5CKE * fix(types): Fix endpoint/rest legacy type errors with skipLibCheck off - TS 4.0: unroll RemoveArray and approximate PartialArray (recursive conditional types need 4.1) in new src-4.0-types overlays - TS <4.2: rewrite `abstract new` to `new` in the downleveled output and drop the stale src-4.0-types Entity/EntityTypes copies - TS 4.2: ConstructorInstance<> replaces InstanceType<> on abstract TBase - TS 4.2-4.4: UnionInstance Args is unconstrained - TS 4.0-4.5: rest getPage narrows paginationField with Extract<> - CI: esmodule-types also typechecks a skipLibCheck: false consumer Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki * docs(blog): Link #4140 in v0.19 notes Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki * refactor(types): Isolate recursive tuple types so the 4.0 overlay is one small file - RemoveArray and PartialArray move to tupleTypes.ts; the src-4.0-types overlay replaces only that module instead of copying endpointTypes/utility - Legacy build only rewrites files that contain `abstract new (` - libcheck typetest skips TypeScript's own lib checks - Split the legacy types bullet in ci-config.mdc Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki * internal: Resolve leftover merge conflict in ci-config rule Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki * internal: Resolve leftover merge conflict in build-legacy-types.sh Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki --------- Co-authored-by: Claude <noreply@anthropic.com> * internal(ci): Harden legacy types script and libcheck lib/ on latest TS version_lt compares major.minor in bash instead of relying on sort -V (a missing -V silently skipped the abstract new rewrite), and the abstract new grep no longer fails the build under pipefail when nothing matches. esmodule-types-latest also runs the skipLibCheck: false typetest so lib/ is checked on the newest compiler. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EEcQdob4nGVuMq91oUHC2V --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Nathaniel · project thread
Follow-up from #4138 (based on #4122's branch; retargets to
masteronce #4122 merges).Motivation
Before: with
skipLibCheck: false,@data-client/endpointand@data-client/restdeclarations reported errors on TypeScript 4.0–4.5, and on 4.0/4.1 anEntitycouldn't be anEndpointschema (stale 4.0 overlays). CI never noticed because every typetest usesskipLibCheck: true.After: no errors on 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.7, 4.8, 4.9, 5.0, 5.3, 5.4, and CI now fails if a legacy output regresses.
Solution
RemoveArrayandPartialArraymove to their owntupleTypes.tsmodule (PartialArrayis still re-exported fromutility), so the 4.0 overlaysrc-4.0-types/tupleTypes.d.tsreplaces just those two types, likeNoInfer.tsdoes.RemoveArrayis unrolled up to 3 bound args (bind()still types the remaining params);PartialArrayis approximated withPartial.src-4.0-types/schemas/{Entity,EntityTypes}.d.tswere hand copies whose only change wasabstract new→new, and had drifted (oldnormalize/denormalizesignatures).build-legacy-types.shnow does that rewrite on the downleveled output for versions below 4.2 (downlevel-dtsmisses it, 0.11 included), so those copies are deleted and can't go stale again. ts3.4 output improves too.InstanceTypeonly accepts concretenew):EntityTypes/EntityMixinuse a new internalConstructorInstance<>, identical to the 4.3+ libInstanceType. (AbstractInstanceType<>isn't a drop-in: it resolves constructor type aliases toany.)UnionInstance'sArgsdrops itsEntityFieldsconstraint (only used forqueryKeyargs; the default is unchanged).RestEndpoint.getPagepassesExtract<O['paginationField'], string>, since those versions don't narrowO['paginationField']in the true branch.esmodule-types(4.0, 4.1, 4.3, 4.8, 5.3) also runsexamples/todo-app/tsconfig.typetest-libcheck.json, a standalone consumer of endpoint/normalizr/rest withskipLibCheck: falseandtypes: [](so@types/reactetc. stay out of it). Checked that it fails on fix(types): Apply newer legacy type overlays to older TS outputs #4138's outputs (4.0, 4.1, 4.3) and passes here.ci-config.mdcupdated.Validated: root
tsc --project tsconfig.test.json, lint, endpoint/rest/normalizr/graphql unit tests (oneEntityMixin.test.ts@ts-expect-errorplacement fails locally with and without this change; CI is green).Open questions
TS 3.x (
ts3.4/, untested in CI) still reports pre-existingSnapshotInterface.d.tsrest-element errors; not addressed here.🤖 Generated with Claude Code
https://claude.ai/code/session_01AMEHZGboXdMFRkF4D2ktki