Skip to content

build(fathom-ts): add DOM to tsconfig lib for TypeScript 6 compat#92

Merged
krakennetworks merged 1 commit into
mainfrom
fix/ts-sdk-dom-lib
Jun 24, 2026
Merged

build(fathom-ts): add DOM to tsconfig lib for TypeScript 6 compat#92
krakennetworks merged 1 commit into
mainfrom
fix/ts-sdk-dom-lib

Conversation

@se-jo-ma

Copy link
Copy Markdown
Member

Problem

TypeScript 6 stops exposing the web/fetch globals (fetch, Response, Blob, FormData, Headers, RequestInit, AbortController, console, btoa) through @types/node's ambient shims when only the ES2020 lib is configured. The generated @hey-api client and hand-written src/client.ts use those standard APIs, so tsc and typedoc emit 23 TS2304/TS2584 errors under TS 6.

This blocks the typescript 5.9.3 → 6.0.3 Dependabot bump (#60), failing both ts-ci and the Python test_ts_sdk_docs.py test (which shells out to typedoc).

Fix

Add the DOM lib to packages/fathom-ts/tsconfig.json, restoring those globals from their canonical source.

-    "lib": ["ES2020"],
+    "lib": ["ES2020", "DOM"],

Why it's safe

  • Emit-neutrallib affects type-checking only; target/module unchanged, so dist/ output is byte-identical.
  • No conflicts — DOM + @types/node both declare these globals, but skipLibCheck: true (already set) suppresses the duplicate-identifier clash. Verified 0 errors on TS 5.9.3 and 6.0.3.
  • Semantically correct — this is an isomorphic fetch REST client; DOM is the canonical home of fetch/Response/Headers/Blob.

Verification

Config TS 6.0.3 TS 5.9.3
lib: ["ES2020"] (current) 23 errors 0
lib: ["ES2020","DOM"] (this PR) 0 0

Once merged, Dependabot will rebase #60 onto main and it goes green.

🤖 Generated with Claude Code

TypeScript 6 no longer exposes the web globals (fetch, Response, Blob,
FormData, Headers, RequestInit, AbortController, console, btoa) through
@types/node's ambient shims when only the ES2020 lib is configured. The
generated @hey-api client and hand-written client.ts reference these
standard fetch/web APIs, so tsc and typedoc fail with 23 TS2304/TS2584
errors under TS 6.

Adding the DOM lib restores those globals from their canonical source.
The change is type-check-only (target/module unchanged, so emitted JS is
identical) and conflict-free with @types/node thanks to skipLibCheck.
Unblocks the typescript 5.9.3 -> 6.0.3 Dependabot bump (#60), which fails
both ts-ci and the Python TS-SDK-docs test that shells out to typedoc.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YFbDHuyErPiiWNEGkEa4kG
@se-jo-ma se-jo-ma requested a review from krakennetworks June 24, 2026 18:19
@krakennetworks krakennetworks merged commit 96431f8 into main Jun 24, 2026
14 checks passed
@krakennetworks krakennetworks deleted the fix/ts-sdk-dom-lib branch June 24, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants