Repository navigation
Start a library of shared web code, and move the time axis, the canvas helper and failure descriptions into it - #6924
Merged
Merged
Conversation
…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
leaf-agent
approved these changes
Nov 24, 2026
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").
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.
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,canvas2Dandexception.js.lf-sample,lf-diffandlf-file-editorcalldescribeFailureagain, so a failure line lists anAggregateError's members. The package API goes from 215 names to 207.What the diff doesn't show:
runtime/is served, exported and bundled with nothing new; one beside it joins every list of the layer's directories./runtime/framework.jsand JSON.exception.jsmoved whole, andlf-shottakescanvas2Dback.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, andleaf-dev probe --baseon a timeline, a trace and a failing sample, where the arms agree.