Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .changeset/drop-typescript-3.md
Original file line number Diff line number Diff line change
@@ -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"
```
2 changes: 1 addition & 1 deletion .cursor/rules/ci-config.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
- 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<version>/` 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).
Expand Down
4 changes: 2 additions & 2 deletions docs/core/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ Install the [Vue plugin](https://vuejs.org/guide/reusability/plugins.html) when
## Supported Tools

<details>
<summary><b>TypeScript 3.7+</b></summary>
<summary><b>TypeScript 4.0+</b></summary>

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.

</details>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 0 additions & 16 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -70,7 +56,6 @@
"src",
"dist",
"lib",
"ts3.4",
"node.mjs",
"legacy",
"LICENSE",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tsconfig.compile.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig",
"exclude": ["node_modules", "dist", "lib", "legacy", "ts3.4", "src-legacy-types", "**/__tests__"]
"exclude": ["node_modules", "dist", "lib", "legacy", "**/__tests__"]
}
1 change: 0 additions & 1 deletion packages/endpoint/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/dist
/legacy
/index.d.ts
/ts3.4
/ts4.0
/ts4.2
/ts4.8
17 changes: 4 additions & 13 deletions packages/endpoint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@
"*": [
"ts4.0/index.d.ts"
]
},
">=3.4": {
"": [
"ts3.4/index.d.ts"
],
"*": [
"ts3.4/index.d.ts"
]
}
},
"exports": {
Expand All @@ -101,21 +93,20 @@
"ts4.8",
"ts4.2",
"ts4.0",
"ts3.4",
"node.mjs",
"legacy",
"LICENSE",
"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:\\*",
"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",
Expand Down
153 changes: 0 additions & 153 deletions packages/endpoint/src-3.4-types/endpointTypes.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/endpoint/tsconfig.compile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["node_modules", "dist", "lib", "legacy", "ts3.4", "**/__tests__"]
"exclude": ["node_modules", "dist", "lib", "legacy", "**/__tests__"]
}
10 changes: 0 additions & 10 deletions packages/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@
"*": [
"lib/index.d.ts"
]
},
">=3.4": {
"": [
"ts3.4/index.d.ts"
],
"*": [
"ts3.4/index.d.ts"
]
}
},
"exports": {
Expand All @@ -86,7 +78,6 @@
"lib",
"node.mjs",
"legacy",
"ts3.4",
"LICENSE",
"README.md"
],
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/tsconfig.compile.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig",
"exclude": ["node_modules", "dist", "lib", "legacy", "ts3.4", "**/__tests__"]
"exclude": ["node_modules", "dist", "lib", "legacy", "**/__tests__"]
}
10 changes: 0 additions & 10 deletions packages/img/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@
"*": [
"lib/index.d.ts"
]
},
">=3.4": {
"": [
"ts3.4/index.d.ts"
],
"*": [
"ts3.4/index.d.ts"
]
}
},
"type": "module",
Expand All @@ -54,7 +46,6 @@
"src",
"dist",
"lib",
"ts3.4",
"LICENSE",
"README.md"
],
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/img/tsconfig.compile.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"@data-client/img/*": ["./src/*"]
}
},
"exclude": ["node_modules", "dist", "lib", "ts3.4", "**/__tests__"]
"exclude": ["node_modules", "dist", "lib", "**/__tests__"]
}
1 change: 0 additions & 1 deletion packages/normalizr/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
/dist
/legacy
/index.d.ts
/ts3.4
/ts4.0
/ts4.1
Loading
Loading