Repository navigation
Delete the controller and watchData paint routes LeafElement replaced - #2919
Merged
Merged
Conversation
Every widget draws as a LeafElement since #2912, so the widget controller's subscribe/renderState route and data.js's watchData go, leaving one way for a widget to draw what it reads. The controller keeps read, dispatch, defer (for a LeafElement) and present; the render check replays through redraw(); the package starter scaffolds a LeafElement; module-state.md and module-authoring.md teach it, building in setup(). LeafElement's fail-soft box now stands after what it drew and stays for a repeated failure, a rejected drawing() names the widget, and a widget that leaves while its last drawing() is unfinished draws again on return (behaviour the deleted watchData return test protected; a runtime test holds it now). The widget-controller-lifetime eval judges LeafElement render reads. TODO.md records the TC39 signals assessment. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Before the first state read answers, a widget's reading is its authored state with every declared verb, so LeafElement's incomplete-reading gate does not hold it at startup; the header named startup as the gate's case, and now names a revision's replacement before its document is adopted. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 15, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 15, 2026
Remove the exact JavaScript template assertion from the `package init` journey. The starter changed in #2919, and the scheduled test failed on its source text even though the generated widget remained usable. The journey still checks the generated registry and package, vendors the module into a page, and passes `page check --render`. Verified locally: `uv run pytest tests/journeys/test_interact_layer.py::test_package_init_starts_one_checked_upgraded_widget -q -n0` (1 passed). --------- Co-authored-by: leaf-agent <[email protected]>
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.
Deletes the widget paint routes
LeafElementreplaced: the controller'ssubscribeand therenderStateit called, andwatchData. Every widget draws as aLeafElementsince #2912, so this leaves one way for a widget to draw what it reads.Runtime
widget-controller.jskeepsread,dispatch,deferandpresent. Its subscriptions, total render, render region andreadingPaintroute go.defer()holds aLeafElement's drawing and refuses any other owner; an ancestor's remount refreshes theLeafElements around it.data.jsloseswatchDataand its per-subscription presentation; the data version waits on the regionsLeafElements join (joinDataDelivery).render-checks/replay.js) replays throughredraw()alone, and its findings namerender().leaf package newscaffolds a widget as aLeafElement.LeafElementputs its fail-soft box after what it drew, so nothing it drew moves for the box, and keeps the box when the same failure repeats. Adrawing()that rejects reports a failure naming the widget. A widget that leaves while adrawing()is unfinished draws again on return, as awatchDatasubscriber whose paint was cut short did; before this, the return stamped its region and data version with the drawing still pending.Docs
module-state.mdandmodule-authoring.mdteachLeafElementas the way a widget draws:this.state,this.data(input),drawing(),updated(). The Upgrade and connection recipes build a widget insetup()and keeponce()for other custom elements. Registry descriptions and the event-log page sayrender()andthis.datawhere they saidrenderStateandwatchData.Tests
The runtime tests of
watchDatamove toLeafElementwidgets where they protect behaviour a widget still has (its own binding, a superseded asynchronous draw not stamping the newer data version, an unchanged source waiting for its drawing, an asynchronous projection keeping its captured provenance); the ones aboutwatchData's own lifecycle go. A new runtime test holds the unfinished-drawing return (it failed before the fix, drawing once instead of twice). A browser test holds the first state read and checks that a widget's reading is already its whole authored state, soLeafElement's incomplete-reading gate does not hold it at startup (the header had named startup as that gate's case; it is a revision's replacement before its document is adopted). The browser tests' inline widgets draw asLeafElements. Thewidget-controller-lifetimeeval's first two rubrics judgeLeafElementrender reads in place ofsubscribeandwatchData.TODO.md's TC39 signals item records the assessment now that there is one class: adopting Lit'sSignalWatcherwould save about fifteen lines of#followbut has no hook for claiming the widget's region, and the projection and version paints still read Preact signals, so it waits on a new trigger.