Repository navigation
Return the runtime's TypeScript modules to JSDoc, so an edit reaches pages and tests without a build - #4780
Merged
Conversation
…pages and tests without a build #4725 to #4757 wrote seven runtime modules in TypeScript and committed a generated .js beside each. Pages and runtime tests read only the generated file, so an edit to a .ts changed nothing until pnpm run build:browser ran, and every probe and test passed on the old code: the failure #4112 described and #4184 fixed. The conversion bought no stricter checking, since the same strict program checks JSDoc under // @ts-check, and about the same length. The seven modules are authored JavaScript again, each starting with // @ts-check in the strict program, with the same executable code. The build refuses a .ts under browser/runtime/ and names #4112. This deletes the compile and orphan-cleanup mechanism (build/runtime-sources.mjs) and the checker-derived esbuild options only it needed. The export audit (tests/js_facts.mjs) now reads JSDoc @import tags. Also removes #4743's type-checking of the dev probes, keeping its five lint rules, and returns #4737's spawn forwarder to its three-argument form.
leaf-agent
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#4725 to #4757 wrote seven runtime modules in TypeScript (
semantic-state,rendering,queued-work,exceptionand the framework'sapplication,presentationandsnapshot) and committed a generated.jsbeside each. Pages and runtime tests read only the generated file. The kernel's freshness check hashes.jsfiles, andtests/runtime/dom.mjsresolves the committed.js. So an edit to a.tschanged nothing untilpnpm run build:browserran, and every probe and test passed on the old code. That is the failure #4112 described and #4184 fixed. The conversion bought no stricter checking, since the same strict program checks JSDoc under// @ts-check, and the files came out about the same length.The seven modules are authored JavaScript again. Each starts with
// @ts-checkin the strict program and keeps every flag the campaign added (strictFunctionTypes,noImplicitThis,useUnknownInCatchVariables). The executable code is unchanged: run through esbuild and compared as ASTs, each new module matches the generated file it replaces, and the kernel diff is only variable renames and input hashes.semantic-statesemantic-state.tssemantic-state.jsWith the framework's
applicationmodule made to throw as it loads,framework-application.test.mjspasses on main (55 of 55, since it imports the generated file) and fails on this branch.What it deletes
build/runtime-sources.mjs, the compile and orphan-cleanup logic inbuild/browser/build.mjs, and its tests..github/scripts/dependency-bundles.mjs,.dependency-cruiser.mjs,tests/js_facts.mjsandtests/journeys/test_unused_exports.py.build/esbuild.mjs, which only the TypeScript emission needed. It returns totsconfigRaw: "{}".The build now refuses any
.tsother than.d.tsunderbrowser/runtime/, naming the file and #4112. The pragma guard is back to #4184's form, covering framework modules only.browser/AGENTS.mdagain describes the runtime as JavaScript a page runs as written.Other changes
@importtags.tests/js_facts.mjsnow reads those as it readsimport("…").Name; without that, the audit reportedLocalMessageandPendingProjectionindomain.d.tsas unread.dev/tests/test_js_facts.pyreplaces its tests of the output mapping with tests of the tag.main_thread.js,startup.js,bench_latency.js,verify_site_browser.js) anddev/browser-globals.d.ts. It found nothing, and a mistake there fails as soon as the probe runs. Check developer browser probes and add focused correctness lints #4743's five ESLint rules stay.dev/leaf_dev/pi_watch_observer.mjsreturns to its three-argument form. Check JavaScript tooling against dependency APIs #4737's tools program rejects that form's arity againstspawn's overloads, so one@typecast wraps it in place ofReflect.applyand two casts.Tests
pnpm run check:hooks,check:tools,check:framework(29 build tests) andcheck:browserafter merging main.pnpm run check, run before these last edits: 708 runtime and 88 Worker tests.uv run pytest tests/model -k "kernel or runtime_selection or distribution or js_facts"(19 passed) anddev/tests/test_js_facts.py(6 passed).Build tests that changed: the test that a renamed TypeScript owner's output is refused is gone with the mechanism. New tests cover the
.tsrefusal and the framework pragma guard.tests/journeys/test_unused_exports.pystill fails on six exports, each in a file this change doesn't touch and no removed.tsfile read:check-api.jsruntimeRootState,content-layout.jsreadDocumentHeaders,framework.jsDirective,widget-elements.jsselectableOfferElement,toc-view.jsoutlineDocument, andlayout.jscontainedSpace. This PR's edit to the test makes CI run it.