Skip to content

types(tools/lib): the shared library is TypeScript, and JSDoc went inert - #522

Merged
oddharsh merged 1 commit into
mainfrom
types/tools-lib-ts
Aug 24, 2026
Merged

oddharsh merged 1 commit into
mainfrom
types/tools-lib-ts

Conversation

@oddharsh

Copy link
Copy Markdown
Owner

First slice of tools/. 13 files renamed, specifiers rewritten in 30 files. Node 26 runs .ts natively (measured), so the two perf tools pinned to node for gzip determinism still run.

The lesson cal just taught, again

TypeScript reads JSDoc types in .js files only. Renaming a JSDoc-annotated module to .ts does not convert it — it disarms it. Every @type, @param and @returns stopped meaning anything the moment the extension changed, silently.

It surfaced only because some were load-bearing:

annotation what broke
wrangler-bin's @returns {[cmd, argv]} every caller that spreads it — the same six errors I fixed this morning
html-markers' two @type {Array<[label, RegExp]>} perf-budget's marker.test() — also already fixed once

A rename can un-fix work. That's the part worth carrying into the remaining 92 files.

So they're real syntax now

makeResolver's four-property parameter, remainderHolder's active list, both marker tables, no-network's globals, and zstd-batch's worker result typed at its source rather than at the call site.

Two contract tests failed, and both were right to

They pin the exact preload path (--preload ./tools/lib/no-network.mjs) and the exact CSS-parser import — precisely the coupling that catches a rename. Updated, not loosened.

Verified

Byte-identical build — same digest before and after, since nothing outside tools/ moved. 353/353 under bun, 352 under node, four type programs clean, route oracle green, tools baseline still 0.

First slice of tools/. 13 files in tools/lib renamed, specifiers rewritten in 30
files, and node 26 runs .ts natively (measured: `node probe.ts` prints), so the
two perf tools pinned to node for gzip determinism still run.

THE LESSON IS THE SAME ONE cal JUST TAUGHT, and it is worth stating plainly
because it will keep happening: TypeScript reads JSDoc types in .js files ONLY.
Renaming a JSDoc-annotated module to .ts does not convert it, it DISARMS it.
Every `@type`, `@param` and `@returns` in these files stopped meaning anything
the moment the extension changed, silently, and the only reason it surfaced is
that some of those annotations were load-bearing:

  - wrangler-bin's `@returns {[cmd, argv]}` tuple went inert, so every caller
    that spreads it broke again — the same six errors I fixed this morning.
  - html-markers' two `@type {Array<[label, RegExp]>}` went inert, so
    perf-budget's `marker.test()` broke again.

Both were errors I had already fixed once. A rename can un-fix work.

So the annotations are real syntax now: makeResolver's four-property parameter,
remainderHolder's active list, both marker tables, no-network's globals, and
zstd-batch's worker result typed at its SOURCE rather than at the call.

Two contract tests failed and both were right to. They pin the exact preload
path (`--preload ./tools/lib/no-network.mjs`) and the exact CSS-parser import,
which is precisely the coupling that catches a rename. Updated, not loosened.

The build is BYTE-IDENTICAL: same digest before and after, since nothing outside
tools/ moved. 353/353 under bun, 352 under node, four type programs clean, route
oracle green, tools baseline still 0.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
aadhar-sh d2bafd5 Aug 24 2026, 12:41 AM

@github-actions

Copy link
Copy Markdown
Contributor

Wire-size diff vs merge base

6cd65f6 → 46c9664

Brotli q11, the quality the edge serves. Every number here is deterministic:
an unchanged file produces no row. Advisory — this check fails on nothing.

Client assets

No change. 22 files, 77.74 KiB Brotli total.

Pages

No change. 50 files, 531.35 KiB Brotli total.

Worker bundle

No change. 237.90 KiB gzip.

Dictionary deltas (pd/)

No change. 146 deltas, 486.79 KiB total.

@oddharsh
oddharsh merged commit 1cce2e0 into main Aug 24, 2026
7 checks passed
@oddharsh
oddharsh deleted the types/tools-lib-ts branch August 24, 2026 00:52
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.

1 participant