Skip to content

Commit 7a49317

Browse files
Bump dependencies again (#682)
* yarn up eslint rollup * Upgrade typescript-eslint * yarn up --recursive '**' * Upgrade TypeScript to v6. Breaks tests. * Set "types" in tsconfig.json as suggested by https://www.typescriptlang.org/docs/handbook/release-notes/typescript-6-0.html#up-front-adjustments. Fixes build failure * Improve tsconfig * Improve comment * yarn up '*' && yarn up --recursive '**'
1 parent afe5aec commit 7a49317

3 files changed

Lines changed: 392 additions & 361 deletions

File tree

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,24 @@
9090
"@colors/colors": "^1.6.0",
9191
"@eslint/js": "^10.0.1",
9292
"babel-loader": "^10.1.1",
93-
"babel-plugin-istanbul": "^7.0.1",
93+
"babel-plugin-istanbul": "8.0.0",
9494
"chai": "^6.2.2",
9595
"cross-env": "^10.1.0",
96-
"eslint": "^10.1.0",
97-
"globals": "^17.4.0",
96+
"eslint": "^10.2.0",
97+
"globals": "^17.5.0",
9898
"karma": "^6.4.4",
9999
"karma-mocha": "^2.0.1",
100100
"karma-mocha-reporter": "^2.2.5",
101101
"karma-sourcemap-loader": "^0.4.0",
102102
"karma-webpack": "^5.0.1",
103103
"mocha": "^11.7.5",
104104
"nyc": "^18.0.0",
105-
"rollup": "^4.60.0",
105+
"rollup": "^4.60.1",
106106
"tsd": "^0.33.0",
107-
"typescript": "^5.9.3",
108-
"typescript-eslint": "^8.57.1",
107+
"typescript": "^6.0.2",
108+
"typescript-eslint": "^8.58.1",
109109
"uglify-js": "^3.19.3",
110-
"webpack": "^5.105.4",
110+
"webpack": "^5.106.1",
111111
"webpack-dev-server": "^5.2.3"
112112
},
113113
"nyc": {

tsconfig.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,38 @@
33
"compilerOptions": {
44
"rootDir": "src/",
55
"target": "es6",
6+
7+
// What we would IDEALLY like to do is compile against type declarations corresponding to
8+
// precisely what is available in BOTH the "Widely Available" Baseline
9+
// (https://web.dev/baseline) AND the latest Node.js LTS, since jsdiff supports both.
10+
// Alas, there is no way to do this. As of configuring the settings below (7th
11+
// April 2026)...
12+
// 1. there is simply no way to tell TypeScript to use the intersection of two sets of
13+
// global type declarations (i.e. to only let us use stuff supported by both
14+
// environments). At best, we can minimise how many global type declarations we include
15+
// by keeping the "lib" and "types" arrays below minimal, and ideally avoiding including
16+
// anything in them that is either browser-specific or Node-specific.
17+
// 2. jsdiff actually uses some stuff that is both "Widely Available" and available in Node,
18+
// but not part of *any* ECMAScript spec. These include `TextDecoder`, which has its own
19+
// dedicated spec, and `setTimeout`, which is (weirdly!) part of the HTML standard, not
20+
// the ECMAScript spec (although Node has its own, identical-ish implementation).
21+
// Consequently setting `"lib": ["esnext"]` will not suffice to let jsdiff compile; to
22+
// get to a tsconfig that actually works, we MUST include "dom" in the "lib" array
23+
// and/or use the @types/node type declaration module by including "node" in the
24+
// "types" array.
25+
// Obviously, both available solutions to point 2 above are unsatisfactory, due to point 1.
26+
// If we include "dom" in the "lib" array, then if we use browser-specific features in our
27+
// TypeScript code (that won't work in Node), TypeScript will not warn us about it at
28+
// compilation time. If we instead use `types: ["node"]`, the converse problem will exist.
29+
//
30+
// Faced with two unsatisfactory options, we reluctantly choose one. But it means we
31+
// absolutely cannot rely on TypeScript to catch if we use a global that isn't actually
32+
// available in all our supported environments, and so must rely on tests and vigilance.
633
"lib": [
7-
"es2022"
34+
"es2023", "dom"
835
],
36+
"types": [],
37+
938
"declaration": true,
1039
"skipLibCheck": true,
1140

0 commit comments

Comments
 (0)