Skip to content

Write the rest of the runtime outside the widget port in TypeScript - #7433

Merged
max-sixty merged 1 commit into
mainfrom
claude/project-thread-aoeudz
Nov 27, 2026
Merged

max-sixty merged 1 commit into
mainfrom
claude/project-thread-aoeudz

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Requested by Maximilian · project thread

Converts the rest of the runtime that the Effect UI port doesn't hold to TypeScript, following #7429:

  • dom, readings, records, features, host and annotations
  • the top-level modules age, bootstrap, check-api, prepaint, stage-integration, validation and widget-api

These stay JavaScript:

What runs doesn't change. With comments ignored, each compiled .js parses to the same program as the JavaScript it replaces on main, apart from two modules:

  • records/thread/address.js: claim is now an arrow, which carries the type a JSDoc @type gave the function. Nothing calls it before its definition.
  • host/state-application.js: the copy-on-write of the authored and descriptor maps goes through one writable helper. It copies on a reading's first write to a map, as before.

Other changes:

Checks run:

  • tsc over browser/types/tsconfig.json and both Worker projects
  • check:browser, test:runtime (1199 pass), test:browser, test:worker
  • tests/model: all pass except the bound-file permission test, which fails when the suite runs as root
  • every pre-commit hook on the changed files

An independent review of the conversion found no behaviour change, and its type-level and doc-comment findings are fixed here.


Generated by Claude Code

Converts dom, readings, records, features, host and annotations, and the
top-level runtime modules (age, bootstrap, check-api, prepaint,
stage-integration, validation, widget-api), to TypeScript beside the
JavaScript the layer serves. The modules the Effect UI port holds stay
JavaScript: dom/box-motion, dom/css-anchors and
annotations/annotation-overlay.

- A class declares each field it assigns, as `declare x: T`, with the type
  TypeScript inferred from the JavaScript, so the served code is the same.
- Each compiled module parses to the program it replaces, except two:
  records/thread/address.js's `claim` is an arrow, which carries the type
  a JSDoc @type gave the function, and host/state-application.js copies
  a map on a reading's first write to it through one helper.
- A type is exported only where another module imports it, in this batch
  and in the modules converted before it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V22NWabEKzt7s5HiW4koa7
@max-sixty max-sixty self-assigned this Nov 27, 2026
@max-sixty
max-sixty merged commit d077394 into main Nov 27, 2026
6 checks passed
@max-sixty
max-sixty deleted the claude/project-thread-aoeudz branch November 27, 2026 20:29
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.

3 participants