From 6e4de5d4a4e709ab8e66bfa23c2ff8f205534046 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 4 Oct 2026 15:23:02 +0000 Subject: [PATCH 1/3] fix(types): Require TypeScript 4.0; remove broken TS 3.x declarations 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) Claude-Session: https://claude.ai/code/session_0112vdfv1WoJN5LqwMkiksab --- .changeset/drop-typescript-3.md | 19 +++ .cursor/rules/ci-config.mdc | 2 +- docs/core/getting-started/installation.md | 4 +- package.json | 2 +- packages/core/package.json | 16 -- packages/core/tsconfig.compile.json | 2 +- packages/endpoint/.gitignore | 1 - packages/endpoint/package.json | 13 +- .../endpoint/src-3.4-types/endpointTypes.d.ts | 153 ------------------ packages/endpoint/tsconfig.compile.json | 2 +- packages/graphql/package.json | 10 -- packages/graphql/tsconfig.compile.json | 2 +- packages/img/package.json | 10 -- packages/img/tsconfig.compile.json | 2 +- packages/normalizr/.gitignore | 1 - packages/normalizr/package.json | 13 +- packages/normalizr/tsconfig.compile.json | 2 +- packages/react/package.json | 22 --- packages/react/tsconfig.compile.json | 2 +- packages/rest/tsconfig.compile.json | 2 +- packages/test/package.json | 13 -- packages/test/tsconfig.compile.json | 2 +- packages/vue/tsconfig.compile.json | 2 +- scripts/build-legacy-types.sh | 11 +- tsconfig-base.json | 1 - 25 files changed, 38 insertions(+), 271 deletions(-) create mode 100644 .changeset/drop-typescript-3.md delete mode 100644 packages/endpoint/src-3.4-types/endpointTypes.d.ts diff --git a/.changeset/drop-typescript-3.md b/.changeset/drop-typescript-3.md new file mode 100644 index 000000000000..c35770a331bd --- /dev/null +++ b/.changeset/drop-typescript-3.md @@ -0,0 +1,19 @@ +--- +'@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 +--- + +BREAKING: Require TypeScript 4.0 or later + +The TypeScript 3.x type declarations are removed. They no longer type-checked on any TypeScript 3.x version, and +`@data-client/rest` already required TypeScript 4.0. Upgrade TypeScript to 4.0 or later. + +```diff title="package.json" +- "typescript": "^3.9.0" ++ "typescript": "^4.0.0" +``` diff --git a/.cursor/rules/ci-config.mdc b/.cursor/rules/ci-config.mdc index 4b743b6e8a04..e03efed20698 100644 --- a/.cursor/rules/ci-config.mdc +++ b/.cursor/rules/ci-config.mdc @@ -14,7 +14,7 @@ alwaysApply: false - `tests` (lint, typecheck, unit_tests, node_matrix): false only when every changed path is docs/website/tooling (`website/`, `docs/`, `.changeset/`, `.cursor/`, `.agents/`, `.claude/`, `.github/`, root `*.md`), except `website/src/components/Playground/` (has unit tests). When both flags are false, `setup` halts before install. - Legacy TS types (`ci:build:legacy-types`, consumed by `esmodule-types`): - Built inside `setup` (`ci:build:setup:esmodule`) only when the esmodule flag is set; there is no separate job, to keep a job hop off the critical path. - - In CI only endpoint/normalizr/rest outputs for TS >= 4.0 are built (`LEGACY_MIN_TS=4.0`, the oldest TS in the `esmodule-types` matrix); release builds (`build:types`) still emit every version. + - Only endpoint, normalizr and rest have legacy outputs, all for TS >= 4.0 (the minimum supported TS, and the oldest in the `esmodule-types` matrix). - `scripts/build-legacy-types.sh` builds each TS version concurrently; each `ts/` gets the downleveled `lib` (with `abstract new` rewritten to `new` below 4.2, which `downlevel-dts` misses), then every newer version's `src-*-types` overlay, then its own. Keep overlays to small single-purpose modules (like `NoInfer.ts`, `tupleTypes.ts`) so whole-file copies can't go stale. - `esmodule-types` also runs `examples/todo-app/tsconfig.typetest-libcheck.json` (`skipLibCheck: false`, `types: []`) so errors inside the legacy outputs fail CI, and `esmodule-types-latest` runs it with `--moduleResolution bundler` (TS 7 removed `node`) to cover `lib/`; the other typetests use `skipLibCheck: true`. - Any change to legacy types building must leave `ts*/` output byte-identical to master (diff it) unless it intentionally changes published types (then add a changeset). diff --git a/docs/core/getting-started/installation.md b/docs/core/getting-started/installation.md index 2cf100592601..4d3dc742fb88 100644 --- a/docs/core/getting-started/installation.md +++ b/docs/core/getting-started/installation.md @@ -57,9 +57,9 @@ Install the [Vue plugin](https://vuejs.org/guide/reusability/plugins.html) when ## Supported Tools
-TypeScript 3.7+ +TypeScript 4.0+ -TypeScript is optional, but requires at least version [3.7](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#more-recursive-type-aliases) and [strictNullChecks](https://www.typescriptlang.org/tsconfig#strictNullChecks) for full type enforcement. +TypeScript is optional, but requires at least version [4.0](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#variadic-tuple-types) and [strictNullChecks](https://www.typescriptlang.org/tsconfig#strictNullChecks) for full type enforcement.
diff --git a/package.json b/package.json index 9fd4a1e05f08..c286b8b7b73c 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "ci:build:setup:esmodule": "run-p ci:build:types-and-legacy ci:build-test-lib", "ci:build:types-and-legacy": "yarn ci:build:types && yarn ci:build:legacy-types", "ci:build:types": "yarn build:copy:ambient && tsc --build --builders 1", - "ci:build:legacy-types": "LEGACY_MIN_TS=4.0 yarn workspaces foreach -Wpiv --include @data-client/endpoint --include @data-client/normalizr --include @data-client/rest run build:legacy-types", + "ci:build:legacy-types": "yarn workspaces foreach -Wpiv --include @data-client/endpoint --include @data-client/normalizr --include @data-client/rest run build:legacy-types", "ci:build-test-lib": "yarn workspace @data-client/core run build:lib && yarn workspace @data-client/test run build:lib && yarn workspace @data-client/test run build:bundle", "ci:build:esmodule": "yarn workspaces foreach -WptivR --from @data-client/react --from @data-client/rest --from @data-client/graphql run build:lib && yarn workspace @data-client/normalizr run build:js:node && yarn workspace @data-client/endpoint run build:js:node", "ci:build:bundlesize": "yarn workspaces foreach -Wptiv --no-private run build:lib && yarn workspace test-bundlesize run build:sizecompare", diff --git a/packages/core/package.json b/packages/core/package.json index 8bf63eb44bff..a59e09906151 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -22,20 +22,6 @@ "*": [ "lib/index.d.ts" ] - }, - ">=3.4": { - "": [ - "ts3.4/index.d.ts" - ], - "next": [ - "ts3.4/next/index.d.ts" - ], - "mock": [ - "ts3.4/mock/index.d.ts" - ], - "*": [ - "ts3.4/index.d.ts" - ] } }, "exports": { @@ -70,7 +56,6 @@ "src", "dist", "lib", - "ts3.4", "node.mjs", "legacy", "LICENSE", @@ -83,7 +68,6 @@ "build:js:browser": "BROWSERSLIST_ENV=legacy yarn g:rollup", "build:bundle": "yarn g:runs build:js:\\* && echo '{\"type\":\"commonjs\"}' > dist/package.json", "build:clean": "yarn g:clean ./index.d.ts", - "build:legacy-types": "yarn g:downtypes lib ts3.4", "build": "run build:lib && run build:legacy:lib && run build:bundle", "dev": "run build:lib -w", "prepare": "run build:lib", diff --git a/packages/core/tsconfig.compile.json b/packages/core/tsconfig.compile.json index 00f33ec80bd9..23b1e1ebeae8 100644 --- a/packages/core/tsconfig.compile.json +++ b/packages/core/tsconfig.compile.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig", - "exclude": ["node_modules", "dist", "lib", "legacy", "ts3.4", "src-legacy-types", "**/__tests__"] + "exclude": ["node_modules", "dist", "lib", "legacy", "src-legacy-types", "**/__tests__"] } diff --git a/packages/endpoint/.gitignore b/packages/endpoint/.gitignore index 724ae6235148..5dbd67b737fb 100644 --- a/packages/endpoint/.gitignore +++ b/packages/endpoint/.gitignore @@ -2,7 +2,6 @@ /dist /legacy /index.d.ts -/ts3.4 /ts4.0 /ts4.2 /ts4.8 \ No newline at end of file diff --git a/packages/endpoint/package.json b/packages/endpoint/package.json index 9c8a8269cd28..c4e8b6f114cd 100644 --- a/packages/endpoint/package.json +++ b/packages/endpoint/package.json @@ -68,14 +68,6 @@ "*": [ "ts4.0/index.d.ts" ] - }, - ">=3.4": { - "": [ - "ts3.4/index.d.ts" - ], - "*": [ - "ts3.4/index.d.ts" - ] } }, "exports": { @@ -101,7 +93,6 @@ "ts4.8", "ts4.2", "ts4.0", - "ts3.4", "node.mjs", "legacy", "LICENSE", @@ -113,9 +104,9 @@ "build:js:node": "BROWSERSLIST_ENV=node12 yarn g:rollup && echo '{\"type\":\"commonjs\"}' > dist/package.json", "build:js:browser": "BROWSERSLIST_ENV=legacy yarn g:rollup", "build:bundle": "yarn g:runs build:js:\\*", - "build:clean": "yarn g:clean ts3.4 ts4.0 ts4.2 ts4.8", + "build:clean": "yarn g:clean ts4.0 ts4.2 ts4.8", "build": "run build:lib && run build:legacy:lib && run build:bundle", - "build:legacy-types": "yarn g:legacy-types 4.8 4.2 4.0 3.4", + "build:legacy-types": "yarn g:legacy-types 4.8 4.2 4.0", "dev": "run build:lib -w", "prepare": "run build:lib", "prepack": "run prepare && run build:bundle && run build:legacy:lib", diff --git a/packages/endpoint/src-3.4-types/endpointTypes.d.ts b/packages/endpoint/src-3.4-types/endpointTypes.d.ts deleted file mode 100644 index e863d160fade..000000000000 --- a/packages/endpoint/src-3.4-types/endpointTypes.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -// had to remove all [...T], which included importing PartialParameters from types -// also relaxed constraints on call,apply,bind *this* - -/* eslint-disable @typescript-eslint/ban-types */ -import type { EndpointInterface, Schema } from './interface.js'; -import type { EndpointExtraOptions, FetchFunction } from './types.js'; -export interface EndpointOptions< - F extends FetchFunction = FetchFunction, - S extends Schema | undefined = undefined, - M extends boolean | undefined = false, -> extends EndpointExtraOptions { - key?: (...args: Parameters) => string; - sideEffect?: M; - schema?: S; - [k: string]: any; -} -export interface EndpointExtendOptions< - F extends FetchFunction = FetchFunction, - S extends Schema | undefined = Schema | undefined, - M extends boolean | undefined = boolean | undefined, -> extends EndpointOptions { - fetch?: FetchFunction; -} -export type ParamFromFetch = - F extends (params: infer P, body?: any) => Promise ? P : never; -export type KeyofEndpointInstance = keyof EndpointInstance; -export type ExtendedEndpoint< - O extends EndpointExtendOptions, - E extends EndpointInstance< - FetchFunction, - Schema | undefined, - boolean | undefined - >, - F extends FetchFunction, -> = EndpointInstance< - 'fetch' extends keyof O ? Exclude : E['fetch'], - 'schema' extends keyof O ? O['schema'] : E['schema'], - 'sideEffect' extends keyof O ? O['sideEffect'] : E['sideEffect'] -> & - Omit & - Omit; -/** - * Defines an async data source. - * @see https://dataclient.io/docs/api/Endpoint - */ -export interface EndpointInstance< - F extends (...args: any) => Promise = FetchFunction, - S extends Schema | undefined = Schema | undefined, - M extends boolean | undefined = boolean | undefined, -> extends EndpointInstanceInterface { - extend< - E extends EndpointInstance< - (...args: any) => Promise, - Schema | undefined, - boolean | undefined - >, - O extends EndpointExtendOptions & - Partial>> & - Record, - >( - this: E, - options: Readonly, - ): ExtendedEndpoint; -} -/** - * Defines an async data source. - * @see https://dataclient.io/docs/api/Endpoint - */ -export interface EndpointInstanceInterface< - F extends FetchFunction = FetchFunction, - S extends Schema | undefined = Schema | undefined, - M extends boolean | undefined = boolean | undefined, -> extends EndpointInterface { - constructor: EndpointConstructor; - /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. - * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. - */ - apply( - this: E, - thisArg: any, - argArray?: Parameters, - ): ReturnType; - /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. - */ - call( - this: E, - thisArg: any, - ...argArray: Parameters - ): ReturnType; - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. - */ - bind>( - this: E, - thisArg: any, - ...args: P - ): EndpointInstance<() => ReturnType, S, M> & - Omit>; - /** Returns a string representation of a function. */ - toString(): string; - prototype: any; - readonly length: number; - arguments: any; - caller: F; - key(...args: Parameters): string; - readonly sideEffect: M; - readonly schema: S; - fetch: F; - /** @see https://dataclient.io/rest/api/Endpoint#testKey */ - testKey(key: string): boolean; -} -export interface EndpointConstructor { - new < - F extends ( - this: EndpointInstance & E, - params?: any, - body?: any, - ) => Promise, - S extends Schema | undefined = undefined, - M extends boolean | undefined = false, - E extends Record = {}, - >( - fetchFunction: F, - options?: EndpointOptions & E, - ): EndpointInstance & E; - readonly prototype: Function; -} -export interface ExtendableEndpointConstructor { - new < - F extends ( - this: EndpointInstanceInterface & E, - params?: any, - body?: any, - ) => Promise, - S extends Schema | undefined = undefined, - M extends boolean | undefined = false, - E extends Record = {}, - >( - RestFetch: F, - options?: Readonly> & E, - ): EndpointInstanceInterface & E; - readonly prototype: Function; -} -export {}; -//# sourceMappingURL=endpointTypes.d.ts.map diff --git a/packages/endpoint/tsconfig.compile.json b/packages/endpoint/tsconfig.compile.json index 9a6930f4f9ea..248feb19bc9b 100644 --- a/packages/endpoint/tsconfig.compile.json +++ b/packages/endpoint/tsconfig.compile.json @@ -4,5 +4,5 @@ "skipLibCheck": true }, "include": ["src"], - "exclude": ["node_modules", "dist", "lib", "legacy", "ts3.4", "**/__tests__"] + "exclude": ["node_modules", "dist", "lib", "legacy", "**/__tests__"] } diff --git a/packages/graphql/package.json b/packages/graphql/package.json index d54c9fcb7193..7fa643ea7f62 100644 --- a/packages/graphql/package.json +++ b/packages/graphql/package.json @@ -54,14 +54,6 @@ "*": [ "lib/index.d.ts" ] - }, - ">=3.4": { - "": [ - "ts3.4/index.d.ts" - ], - "*": [ - "ts3.4/index.d.ts" - ] } }, "exports": { @@ -86,7 +78,6 @@ "lib", "node.mjs", "legacy", - "ts3.4", "LICENSE", "README.md" ], @@ -97,7 +88,6 @@ "build:js:browser": "BROWSERSLIST_ENV=legacy yarn g:rollup", "build:bundle": "yarn g:runs build:js:\\* && echo '{\"type\":\"commonjs\"}' > dist/package.json", "build:clean": "yarn g:clean index.d.ts", - "build:legacy-types": "yarn g:downtypes lib ts3.4", "build": "run build:lib && run build:legacy:lib && run build:bundle", "dev": "run build:lib -w", "prepare": "run build:lib", diff --git a/packages/graphql/tsconfig.compile.json b/packages/graphql/tsconfig.compile.json index 4b3ba5033bd1..443848d1e98d 100644 --- a/packages/graphql/tsconfig.compile.json +++ b/packages/graphql/tsconfig.compile.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig", - "exclude": ["node_modules", "dist", "lib", "legacy", "ts3.4", "**/__tests__"] + "exclude": ["node_modules", "dist", "lib", "legacy", "**/__tests__"] } diff --git a/packages/img/package.json b/packages/img/package.json index 6dfb4df261c2..224d30fb876c 100644 --- a/packages/img/package.json +++ b/packages/img/package.json @@ -36,14 +36,6 @@ "*": [ "lib/index.d.ts" ] - }, - ">=3.4": { - "": [ - "ts3.4/index.d.ts" - ], - "*": [ - "ts3.4/index.d.ts" - ] } }, "type": "module", @@ -54,7 +46,6 @@ "src", "dist", "lib", - "ts3.4", "LICENSE", "README.md" ], @@ -64,7 +55,6 @@ "build:js:browser": "BROWSERSLIST_ENV=legacy yarn g:rollup", "build:bundle": "yarn g:runs build:js:\\* && echo '{\"type\":\"commonjs\"}' > dist/package.json", "build:clean": "yarn g:clean", - "build:legacy-types": "yarn g:downtypes lib ts3.4", "build": "run build:lib && run build:bundle", "dev": "run build:lib -w", "prepare": "run build:lib", diff --git a/packages/img/tsconfig.compile.json b/packages/img/tsconfig.compile.json index 9ef243d3e144..348d608312ad 100644 --- a/packages/img/tsconfig.compile.json +++ b/packages/img/tsconfig.compile.json @@ -5,5 +5,5 @@ "@data-client/img/*": ["./src/*"] } }, - "exclude": ["node_modules", "dist", "lib", "ts3.4", "**/__tests__"] + "exclude": ["node_modules", "dist", "lib", "**/__tests__"] } diff --git a/packages/normalizr/.gitignore b/packages/normalizr/.gitignore index b147f2f0df4b..81742836bcb1 100644 --- a/packages/normalizr/.gitignore +++ b/packages/normalizr/.gitignore @@ -2,6 +2,5 @@ /dist /legacy /index.d.ts -/ts3.4 /ts4.0 /ts4.1 \ No newline at end of file diff --git a/packages/normalizr/package.json b/packages/normalizr/package.json index e25c1fff654e..b63cc8897c64 100644 --- a/packages/normalizr/package.json +++ b/packages/normalizr/package.json @@ -53,14 +53,6 @@ "*": [ "ts4.0/index.d.ts" ] - }, - ">=3.4": { - "": [ - "ts3.4/index.d.ts" - ], - "*": [ - "ts3.4/index.d.ts" - ] } }, "exports": { @@ -91,7 +83,6 @@ "legacy", "ts4.1", "ts4.0", - "ts3.4", "LICENSE", "README.md" ], @@ -103,8 +94,8 @@ "build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' POLYFILL_TARGETS='chrome>88,safari>14' yarn g:babel --out-dir lib", "build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' POLYFILL_TARGETS='chrome>80,safari>13,firefox>72' yarn g:babel --out-dir legacy", "build:bundle": "yarn g:runs build:js:\\*", - "build:clean": "yarn g:clean ts3.4 ts4.0 ts4.1", - "build:legacy-types": "yarn g:legacy-types 4.1 4.0 3.4", + "build:clean": "yarn g:clean ts4.0 ts4.1", + "build:legacy-types": "yarn g:legacy-types 4.1 4.0", "prepublishOnly": "run build" }, "author": "Nathaniel Tucker (https://github.com/ntucker)", diff --git a/packages/normalizr/tsconfig.compile.json b/packages/normalizr/tsconfig.compile.json index 4b3ba5033bd1..443848d1e98d 100644 --- a/packages/normalizr/tsconfig.compile.json +++ b/packages/normalizr/tsconfig.compile.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig", - "exclude": ["node_modules", "dist", "lib", "legacy", "ts3.4", "**/__tests__"] + "exclude": ["node_modules", "dist", "lib", "legacy", "**/__tests__"] } diff --git a/packages/react/package.json b/packages/react/package.json index 7a99917a1a76..e8312e505bd3 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -84,26 +84,6 @@ "*": [ "lib/index.d.ts" ] - }, - ">=3.4": { - "": [ - "ts3.4/index.d.ts" - ], - "next": [ - "ts3.4/next/index.d.ts" - ], - "ssr": [ - "ts3.4/server/index.d.ts" - ], - "redux": [ - "ts3.4/server/redux/index.d.ts" - ], - "mock": [ - "ts3.4/mock/index.d.ts" - ], - "*": [ - "ts3.4/index.d.ts" - ] } }, "exports": { @@ -156,7 +136,6 @@ "lib", "legacy", "native", - "ts3.4", "node.mjs", "LICENSE", "README.md" @@ -169,7 +148,6 @@ "build:js:browser": "BROWSERSLIST_ENV=legacy yarn g:rollup", "build:bundle": "yarn g:runs build:js:\\* && echo '{\"type\":\"commonjs\"}' > dist/package.json", "build:clean": "yarn g:clean index.d.ts next.d.ts native", - "build:legacy-types": "yarn g:downtypes lib ts3.4", "build": "run build:lib && run build:legacy:lib && run build:native:lib && run build:bundle", "dev": "run build:lib -w", "prepare": "run build:lib", diff --git a/packages/react/tsconfig.compile.json b/packages/react/tsconfig.compile.json index 00f33ec80bd9..23b1e1ebeae8 100644 --- a/packages/react/tsconfig.compile.json +++ b/packages/react/tsconfig.compile.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig", - "exclude": ["node_modules", "dist", "lib", "legacy", "ts3.4", "src-legacy-types", "**/__tests__"] + "exclude": ["node_modules", "dist", "lib", "legacy", "src-legacy-types", "**/__tests__"] } diff --git a/packages/rest/tsconfig.compile.json b/packages/rest/tsconfig.compile.json index 9fc5d778f935..0a2b4f6d1ad7 100644 --- a/packages/rest/tsconfig.compile.json +++ b/packages/rest/tsconfig.compile.json @@ -1,5 +1,5 @@ { "extends": "./tsconfig", "include": ["src"], - "exclude": ["node_modules", "dist", "lib", "legacy", "ts3.4", "**/__tests__"] + "exclude": ["node_modules", "dist", "lib", "legacy", "**/__tests__"] } diff --git a/packages/test/package.json b/packages/test/package.json index 3010470ee6d1..39ed66dd506a 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -48,17 +48,6 @@ "*": [ "lib/index.d.ts" ] - }, - ">=3.4": { - "": [ - "ts3.4/index.d.ts" - ], - "browser": [ - "ts3.4/browser.d.ts" - ], - "*": [ - "ts3.4/index.d.ts" - ] } }, "exports": { @@ -90,7 +79,6 @@ "src", "dist", "lib", - "ts3.4", "node.mjs", "legacy", "native", @@ -107,7 +95,6 @@ "build:legacy:lib:cjs": "BABEL_MODULES=cjs BROWSERSLIST_ENV='2018' POLYFILL_TARGETS='chrome>80,safari>13,firefox>72' yarn g:babel-lite --out-dir legacy --extensions '.cts' && mv ./legacy/makeRenderDataClient/renderHook.js ./legacy/makeRenderDataClient/renderHook.cjs && mv ./legacy/makeRenderDataClient/use18.js ./legacy/makeRenderDataClient/use18.cjs && mv ./legacy/makeRenderDataClient/use18.native.js ./legacy/makeRenderDataClient/use18.native.cjs", "build:bundle": "BROWSERSLIST_ENV=node12 yarn g:rollup && COMPILE_TARGET=native BROWSERSLIST_ENV=hermes12 yarn g:rollup && echo '{\"type\":\"commonjs\"}' > dist/package.json", "build:clean": "yarn g:clean native", - "build:legacy-types": "yarn g:downtypes lib ts3.4", "build": "run build:lib && run build:legacy:lib && run build:native:esm && run build:bundle", "dev": "run build:lib:esm -w & run build:lib:cjs -w && fg", "prepare": "run build:lib", diff --git a/packages/test/tsconfig.compile.json b/packages/test/tsconfig.compile.json index ea6de6637d7f..313bfff3527c 100644 --- a/packages/test/tsconfig.compile.json +++ b/packages/test/tsconfig.compile.json @@ -3,5 +3,5 @@ "compilerOptions": { "exactOptionalPropertyTypes": true }, - "exclude": ["node_modules", "dist", "lib", "ts3.4", "legacy", "**/__tests__"] + "exclude": ["node_modules", "dist", "lib", "legacy", "**/__tests__"] } diff --git a/packages/vue/tsconfig.compile.json b/packages/vue/tsconfig.compile.json index 49d8cca7e64b..0b3a2337b596 100644 --- a/packages/vue/tsconfig.compile.json +++ b/packages/vue/tsconfig.compile.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig", - "exclude": ["node_modules", "dist", "lib", "ts3.4", "src-legacy-types", "**/__tests__"] + "exclude": ["node_modules", "dist", "lib", "src-legacy-types", "**/__tests__"] } \ No newline at end of file diff --git a/scripts/build-legacy-types.sh b/scripts/build-legacy-types.sh index 6a4b1c560f10..09456bde3ea8 100755 --- a/scripts/build-legacy-types.sh +++ b/scripts/build-legacy-types.sh @@ -48,19 +48,12 @@ build_version() { copy_types "./src-$version-types" "./ts$version" } -# LEGACY_MIN_TS skips outputs no consumer reads (CI's oldest tested TS). -below_min() { - [ -n "$LEGACY_MIN_TS" ] && version_lt "$1" "$LEGACY_MIN_TS" -} - pids=() earlier=() for version in "$@" do - if ! below_min "$version"; then - build_version "$version" "${earlier[@]}" & - pids+=($!) - fi + build_version "$version" "${earlier[@]}" & + pids+=($!) earlier+=("$version") done diff --git a/tsconfig-base.json b/tsconfig-base.json index 8d5cc5582df9..cc7da7e61bb1 100644 --- a/tsconfig-base.json +++ b/tsconfig-base.json @@ -65,7 +65,6 @@ "node_modules", "dist", "lib", - "ts3.4", "coverage" ] } From 057981a6f8fa051097b3aada2d183bb81509d130 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 4 Oct 2026 15:23:49 +0000 Subject: [PATCH 2/3] docs(blog): Note TypeScript 4.0 requirement in v0.19 Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0112vdfv1WoJN5LqwMkiksab --- website/blog/2026-10-03-v0.19-batch-set.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/blog/2026-10-03-v0.19-batch-set.md b/website/blog/2026-10-03-v0.19-batch-set.md index 69facc0d487c..7de98039988c 100644 --- a/website/blog/2026-10-03-v0.19-batch-set.md +++ b/website/blog/2026-10-03-v0.19-batch-set.md @@ -22,6 +22,10 @@ import StackBlitz from '@site/src/components/StackBlitz'; - Fix `Cannot find name 'NoInfer'` and `export type` errors on TypeScript 4.x with `skipLibCheck` off ([#4138](https://github.com/reactive/data-client/pull/4138)) - Fix `Entity`, `Endpoint`, `Union` and `RestEndpoint` type errors on TypeScript 4.0–4.5 with `skipLibCheck` off ([#4140](https://github.com/reactive/data-client/pull/4140)) +**Breaking Changes:** + +- TypeScript 4.0 or later is required; the TypeScript 3.x declarations are removed ([#4151](https://github.com/reactive/data-client/pull/4151)) + {/* truncate */} ## Batch Controller.set() {#batch-set} From ede4059087f0f56b6ce9c1a733614ca6dd2b5e1c Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 4 Oct 2026 15:26:25 +0000 Subject: [PATCH 3/3] internal: Drop dead TS 3.x build leftovers Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0112vdfv1WoJN5LqwMkiksab --- .cursor/rules/ci-config.mdc | 2 +- packages/core/tsconfig.compile.json | 2 +- packages/endpoint/package.json | 4 ++-- packages/react/tsconfig.compile.json | 2 +- packages/vue/tsconfig.compile.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.cursor/rules/ci-config.mdc b/.cursor/rules/ci-config.mdc index e03efed20698..10f951be8a12 100644 --- a/.cursor/rules/ci-config.mdc +++ b/.cursor/rules/ci-config.mdc @@ -14,7 +14,7 @@ alwaysApply: false - `tests` (lint, typecheck, unit_tests, node_matrix): false only when every changed path is docs/website/tooling (`website/`, `docs/`, `.changeset/`, `.cursor/`, `.agents/`, `.claude/`, `.github/`, root `*.md`), except `website/src/components/Playground/` (has unit tests). When both flags are false, `setup` halts before install. - Legacy TS types (`ci:build:legacy-types`, consumed by `esmodule-types`): - Built inside `setup` (`ci:build:setup:esmodule`) only when the esmodule flag is set; there is no separate job, to keep a job hop off the critical path. - - Only endpoint, normalizr and rest have legacy outputs, all for TS >= 4.0 (the minimum supported TS, and the oldest in the `esmodule-types` matrix). + - CI builds the endpoint, normalizr and rest legacy outputs, all for TS >= 4.0 (the minimum supported TS, and the oldest in the `esmodule-types` matrix). `use-enhanced-reducer` still ships a `ts3.4` build in release builds (`build:types`). - `scripts/build-legacy-types.sh` builds each TS version concurrently; each `ts/` gets the downleveled `lib` (with `abstract new` rewritten to `new` below 4.2, which `downlevel-dts` misses), then every newer version's `src-*-types` overlay, then its own. Keep overlays to small single-purpose modules (like `NoInfer.ts`, `tupleTypes.ts`) so whole-file copies can't go stale. - `esmodule-types` also runs `examples/todo-app/tsconfig.typetest-libcheck.json` (`skipLibCheck: false`, `types: []`) so errors inside the legacy outputs fail CI, and `esmodule-types-latest` runs it with `--moduleResolution bundler` (TS 7 removed `node`) to cover `lib/`; the other typetests use `skipLibCheck: true`. - Any change to legacy types building must leave `ts*/` output byte-identical to master (diff it) unless it intentionally changes published types (then add a changeset). diff --git a/packages/core/tsconfig.compile.json b/packages/core/tsconfig.compile.json index 23b1e1ebeae8..443848d1e98d 100644 --- a/packages/core/tsconfig.compile.json +++ b/packages/core/tsconfig.compile.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig", - "exclude": ["node_modules", "dist", "lib", "legacy", "src-legacy-types", "**/__tests__"] + "exclude": ["node_modules", "dist", "lib", "legacy", "**/__tests__"] } diff --git a/packages/endpoint/package.json b/packages/endpoint/package.json index c4e8b6f114cd..edcdbd88c8e0 100644 --- a/packages/endpoint/package.json +++ b/packages/endpoint/package.json @@ -99,8 +99,8 @@ "README.md" ], "scripts": { - "build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' POLYFILL_TARGETS='chrome>88,safari>14' yarn g:babel --out-dir lib --ignore 'src/schemas-3.7'", - "build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' POLYFILL_TARGETS='chrome>80,safari>13,firefox>72' yarn g:babel --out-dir legacy --ignore 'src/schemas-3.7'", + "build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' POLYFILL_TARGETS='chrome>88,safari>14' yarn g:babel --out-dir lib", + "build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' POLYFILL_TARGETS='chrome>80,safari>13,firefox>72' yarn g:babel --out-dir legacy", "build:js:node": "BROWSERSLIST_ENV=node12 yarn g:rollup && echo '{\"type\":\"commonjs\"}' > dist/package.json", "build:js:browser": "BROWSERSLIST_ENV=legacy yarn g:rollup", "build:bundle": "yarn g:runs build:js:\\*", diff --git a/packages/react/tsconfig.compile.json b/packages/react/tsconfig.compile.json index 23b1e1ebeae8..443848d1e98d 100644 --- a/packages/react/tsconfig.compile.json +++ b/packages/react/tsconfig.compile.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig", - "exclude": ["node_modules", "dist", "lib", "legacy", "src-legacy-types", "**/__tests__"] + "exclude": ["node_modules", "dist", "lib", "legacy", "**/__tests__"] } diff --git a/packages/vue/tsconfig.compile.json b/packages/vue/tsconfig.compile.json index 0b3a2337b596..ed4a3c599468 100644 --- a/packages/vue/tsconfig.compile.json +++ b/packages/vue/tsconfig.compile.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig", - "exclude": ["node_modules", "dist", "lib", "src-legacy-types", "**/__tests__"] + "exclude": ["node_modules", "dist", "lib", "**/__tests__"] } \ No newline at end of file