Skip to content

fix(types): Require TypeScript 4.0; remove broken TS 3.x declarations - #4151

Merged
ntucker merged 3 commits into
masterfrom
claude/project-thread-eqgyx0
Oct 4, 2026
Merged

ntucker merged 3 commits into
masterfrom
claude/project-thread-eqgyx0

Conversation

@ntucker

@ntucker ntucker commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Nathaniel · project thread

Follow-up from #4122 / #4140.

Motivation

Before: package.json typesVersions advertised ">=3.4", but the ts3.4/ declarations didn't type-check on any TypeScript 3.x (with skipLibCheck: false):

  • TS 3.4: endpoint/normalizr overlays use import type (TS 3.8+), and recursive type aliases need 3.7
  • TS 3.9: variadic tuple spreads (...args: readonly [...Parameters<E>]) in endpoint/normalizr SnapshotInterface, core Controller, and every react hook, plus React.JSX and default React imports
  • @data-client/rest never had a 3.x entry, so react + rest never worked on 3.x

After: TypeScript 4.0 is the minimum, matching rest and the oldest TS in the esmodule-types CI matrix.

- "typescript": "^3.9.0"
+ "typescript": "^4.0.0"

Solution

  • Remove the ">=3.4" typesVersions entry, ts3.4 from files, and the ts3.4 build from core, endpoint, normalizr, react, graphql, img and test; delete endpoint/src-3.4-types.
  • @data-client/use-enhanced-reducer keeps its ts3.4 output: it type-checks on TS 3.4 and 3.9, and it isn't version-linked.
  • LEGACY_MIN_TS is now a no-op (no outputs below 4.0), so it's removed from ci:build:legacy-types and build-legacy-types.sh.
  • Installation docs: "TypeScript 3.7+" → "TypeScript 4.0+". Minor changeset (breaking for 0.x).

Verified: ts4.* outputs for endpoint/normalizr/rest are byte-identical to master; yarn build:types passes; typetest-libcheck passes on TS 4.0.8.

🤖 Generated with Claude Code

https://claude.ai/code/session_0112vdfv1WoJN5LqwMkiksab


Generated by Claude Code


Note

Medium Risk
Breaking for consumers on TypeScript 3.x; runtime behavior is unchanged but published typings and minimum compiler version shift across multiple packages.

Overview
BREAKING: Published @data-client/* packages now require TypeScript 4.0+. The broken ts3.4 declaration trees and typesVersions ">=3.4" entries are removed from core, endpoint, normalizr, react, graphql, img, and test; endpoint’s src-3.4-types overlay is deleted.

Legacy type publishing is trimmed to TS ≥ 4.0 only: build:legacy-types no longer emits 3.4, LEGACY_MIN_TS is dropped from CI and build-legacy-types.sh, and endpoint drops the old schemas-3.7 babel ignore. @data-client/use-enhanced-reducer still ships ts3.4 (unchanged).

Docs and release notes state 4.0+; a minor changeset marks the break for the affected packages.

Reviewed by Cursor Bugbot for commit ede4059. Bugbot is set up for automated code reviews on this repo. Configure here.

The ts3.4 typesVersions outputs of endpoint, normalizr, core, react,
graphql, img and test did not type-check on any TypeScript 3.x, and rest
already required 4.0. use-enhanced-reducer keeps its ts3.4 output, which
still works on TS 3.4+.

With no outputs below 4.0 left, LEGACY_MIN_TS is a no-op, so it is removed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112vdfv1WoJN5LqwMkiksab
@changeset-bot

changeset-bot Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ede4059

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@data-client/core Minor
@data-client/endpoint Minor
@data-client/normalizr Minor
@data-client/react Minor
@data-client/graphql Minor
@data-client/img Minor
@data-client/test Minor
@data-client/vue Minor
example-benchmark Patch
example-benchmark-react Patch
@data-client/rest Minor
normalizr-github-example Patch
normalizr-redux-example Patch
normalizr-relationships Patch
test-bundlesize Patch
coinbase-lite Patch

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

@ntucker ntucker self-assigned this Oct 4, 2026
@vercel

vercel Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs-site Ignored Ignored Preview Oct 4, 2026 3:26pm UTC

Request Review

claude added 2 commits October 4, 2026 15:23
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112vdfv1WoJN5LqwMkiksab
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112vdfv1WoJN5LqwMkiksab
@ntucker
ntucker marked this pull request as ready for review October 4, 2026 15:26
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 103 kB

ℹ️ View Unchanged
Filename Size
examples/test-bundlesize/dist/App.js 1.46 kB
examples/test-bundlesize/dist/polyfill.js 307 B
examples/test-bundlesize/dist/rdcClient.js 10.9 kB
examples/test-bundlesize/dist/rdcEndpoint.js 8.07 kB
examples/test-bundlesize/dist/rdcNextjs.js 12.3 kB
examples/test-bundlesize/dist/rdcPipeableStream.js 9.63 kB
examples/test-bundlesize/dist/react.js 59.7 kB
examples/test-bundlesize/dist/webpack-runtime.js 784 B

compressed-size-action

@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.92%. Comparing base (b4b502d) to head (ede4059).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4151   +/-   ##
=======================================
  Coverage   97.92%   97.92%           
=======================================
  Files         158      158           
  Lines        3079     3079           
  Branches      616      616           
=======================================
  Hits         3015     3015           
  Misses         18       18           
  Partials       46       46           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ntucker
ntucker merged commit 4549122 into master Oct 4, 2026
27 checks passed
@ntucker
ntucker deleted the claude/project-thread-eqgyx0 branch October 4, 2026 15:39
@github-actions github-actions Bot mentioned this pull request Oct 4, 2026
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.

2 participants