chore(8.0): ES2023 target + drop DOM lib + downlevelIteration (config truth-up)
Make the compiler config honestly describe a Node 22 / Bun 1.1+ / Deno library: target ES2020 -> ES2023, lib [DOM, ESNext, DOM.Asynciterable] -> [ES2023], drop the now-inert downlevelIteration. 8.0 dropped the browser path, so the DOM lib was misleading (it implied web APIs the package no longer supports). No ES2021-2023 syntax is used anywhere, so .js emit is effectively unchanged — this is hygiene, not a perf/behavior change. The one real consequence of dropping DOM: the Cloudflare-Workers edge probe read globalThis.caches from the DOM lib — declared `caches?: unknown` locally on the runtime-globals intersection alongside Deno/Bun/HTMLRewriter. .d.ts is shape-stable (TS-5.x-parseable preserved — no cor coordination). Gates: typecheck 0, cli-tsconfig 0, typecheck-tsconfig (the .d.ts contract surface) 0, build 0, test:unit 1753/1753, test:bun 8/8.
This commit is contained in:
parent
b5bc73fb17
commit
cf74c25d90
2 changed files with 6 additions and 5 deletions
|
|
@ -83,6 +83,10 @@ export function detectEnvironment(): RuntimeEnvironment {
|
||||||
Deno?: unknown
|
Deno?: unknown
|
||||||
Bun?: unknown
|
Bun?: unknown
|
||||||
HTMLRewriter?: unknown
|
HTMLRewriter?: unknown
|
||||||
|
// `caches` (Cloudflare Workers / ServiceWorker global) is no longer in `lib`
|
||||||
|
// now that DOM is dropped (8.0 is Node/Bun/Deno-only) — declare it locally so
|
||||||
|
// the edge-runtime probe below still type-checks.
|
||||||
|
caches?: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deno
|
// Deno
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2020",
|
"target": "ES2023",
|
||||||
"module": "NodeNext",
|
"module": "NodeNext",
|
||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "NodeNext",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
|
@ -10,16 +10,13 @@
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"lib": [
|
"lib": [
|
||||||
"DOM",
|
"ES2023"
|
||||||
"ESNext",
|
|
||||||
"DOM.Asynciterable"
|
|
||||||
],
|
],
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"noEmit": false,
|
"noEmit": false,
|
||||||
"preserveConstEnums": true,
|
"preserveConstEnums": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"downlevelIteration": true,
|
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"noImplicitOverride": true
|
"noImplicitOverride": true
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue