Skip to content

Start a library of shared web code, and move the time axis, the canvas helper and failure descriptions into it - #6924

Merged
max-sixty merged 4 commits into
mainfrom
agent-a7b5e59401b2980da
Nov 24, 2026
Merged

max-sixty merged 4 commits into
mainfrom
agent-a7b5e59401b2980da

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

One step of the package-interface redesign: shared web code, which holds none of the page's state and reaches none of Leaf's, leaves the package API for a library a module imports by path. It starts at browser/runtime/lib/, served as /runtime/lib/<module>.js, with the time axis, textWidth, canvas2D and exception.js. lf-sample, lf-diff and lf-file-editor call describeFailure again, so a failure line lists an AggregateError's members. The package API goes from 215 names to 207.

What the diff doesn't show:

  • Home. A directory under runtime/ is served, exported and bundled with nothing new; one beside it joins every list of the layer's directories.
  • Boundary. Lint holds it; dependency-cruiser's graph leaves out /runtime/framework.js and JSON.
  • References. "Time axes" is deleted: a library module's header documents it. No instruction change was scored.
  • Wider than asked. exception.js moved whole, and lf-shot takes canvas2D back.

Max approved the redesign and asked for small steps; he hasn't read this diff, which a fresh agent reviewed.

Tests: pnpm run check, pre-commit, 47 browser tests by node id, and leaf-dev probe --base on a timeline, a trace and a failing sample, where the arms agree.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 4 commits November 23, 2026 16:32
…for a thrown value

One step of the package-interface redesign: web code that holds none of the
page's state and reaches none of Leaf's leaves the package API for a library
a module imports by path, as it imports Lit.

The library is browser/runtime/lib/, served at /runtime/lib/<module>.js. A
directory under runtime/ needs nothing new to be served, exported, type-checked
or bundled; a directory beside it would need a new member in every list of the
layer's browser directories. Each module is listed in the kernel registry's
$public-modules, which admission, lint and the kernel build already read, and
a test holds that list to the directory. Lint holds the boundary: a library
module imports only /vendor/ bundles and the modules beside it.

Moved, with every caller and no re-export left in widget-api.js or
portable-api.js: the time axis (time-axis.js), textWidth into a module of its
own, since a text document uses it with no axis, and exception.js whole, whose
describeFailure the sample, the diff and the file editor call again in place
of the expression each carried, so a failure line lists an AggregateError's
members again. textWidth writes the browser's getContext call where it called
the runtime's canvas2D.

The package references name the library's directory and describe none of its
functions, so the "Time axes" section goes and its markup contract moves into
the module's header.

Co-Authored-By: Claude <[email protected]>
… by lint

A fresh review of the first commit found a rule the prose stated and nothing
checked, and two rules that would stop the next moves.

The canvas guard had four copies, so canvas.js joins the library, and the text
width, the shot and the image difference call it again. Nothing re-exports
the library now: the render checks import it by path, check-api.js passes none
of it on, and lint refuses a re-export of a library module anywhere in the
runtime and a barrel inside the library. A runtime primitive and a render
check may import a library module, and an exact closure in the import graph's
check may reach one unlisted.

The kernel build groups the library with the modules that load in any
document, so a library module the boot reaches is no extra file: the compiled
boot is the base's 17 files, and each library path only re-exports.
…t missed

A second review found the prose claiming more than lint holds. The no
re-export rule covers the runtime, a render check's import is admitted by
lint and not by $public-modules, and a prepared installation loads the whole
library with every page, so a library module imports lazily any vendor bundle
the boot does not already load. The specifier rules refuse a percent-encoded
`..` and a backslash. The axis stylesheet's comment says which element states
each custom property, which a cold read of the references asked for.
# Conflicts:
#	packages/playwright/widgets/timeline.js
@max-sixty
max-sixty merged commit 687f8ba into main Nov 24, 2026
6 checks passed
@max-sixty
max-sixty deleted the agent-a7b5e59401b2980da branch November 24, 2026 01:31
max-sixty added a commit that referenced this pull request Nov 24, 2026
The runtime half of the check named every child of browser/runtime in its order,
so each refactor that adds, moves or removes a runtime file had to edit that
order too. #6924's move of three files into browser/runtime/lib/ was the first
such collision. While the package-interface refactors move runtime files, the
dependency-cruiser config, its hook and browser/AGENTS.md go back to main's, and
.config/dependency-cruiser-known.json goes. The runtime's order gets rebuilt from
main once those refactors land.

max-sixty chose this on the deslop-please page ("Merge the src/leaf half now").
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