From cf74c25d90f3685b668b6e69890a0e9c58a4f119 Mon Sep 17 00:00:00 2001 From: David Snelling Date: Wed, 1 Jul 2026 10:58:04 -0700 Subject: [PATCH] chore(8.0): ES2023 target + drop DOM lib + downlevelIteration (config truth-up) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/integrations/core/IntegrationLoader.ts | 4 ++++ tsconfig.json | 7 ++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/integrations/core/IntegrationLoader.ts b/src/integrations/core/IntegrationLoader.ts index 519948b7..68aa84ba 100644 --- a/src/integrations/core/IntegrationLoader.ts +++ b/src/integrations/core/IntegrationLoader.ts @@ -83,6 +83,10 @@ export function detectEnvironment(): RuntimeEnvironment { Deno?: unknown Bun?: 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 diff --git a/tsconfig.json b/tsconfig.json index 6900d649..b1293663 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES2020", + "target": "ES2023", "module": "NodeNext", "moduleResolution": "NodeNext", "esModuleInterop": true, @@ -10,16 +10,13 @@ "outDir": "./dist", "rootDir": "./src", "lib": [ - "DOM", - "ESNext", - "DOM.Asynciterable" + "ES2023" ], "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "noEmit": false, "preserveConstEnums": true, "sourceMap": true, - "downlevelIteration": true, "isolatedModules": true, "noImplicitOverride": true },