Repository navigation
Build Effect UI for production, and settle when its widgets' Commands and member sets draw - #7434
Merged
Merged
Conversation
The vendored Effect UI bundle resolved its `#dev` and `#hot` imports to the development builds, since `build/vendor.mjs` set no `production` condition, so every page with an Effect UI widget shipped the hot-reload and devtools code, and each mount read `sessionStorage` and scanned every live root. The row now builds with `conditions: ["production"]`: `/vendor/effect-ui.js` goes from 595,034 to 580,769 bytes (196,227 to 190,967 gzipped) with `Scheduler` added to its exports. A Command a gesture issues ran in the gesture's task only because the adapter mounts with `Effect.runSync`, whose private synchronous scheduler stays in each root's context and keeps Effect UI from installing its time-sliced HtmlScheduler. A probe mounting the same root with `runFork` ran the Command eleven tasks later behind 50 ms of other roots' work, past the next frame. `defineWidget` now provides `Scheduler.Scheduler` itself, a synchronous `MixedScheduler` that runs on microtasks of the asking task, so the timing is the adapter's choice. Behaviour is unchanged: the runtime tests (1,199) and the tally, timeline and motion browser tests pass.
leaf-agent
previously approved these changes
Nov 27, 2026
`defineWidget`'s member setter sent its message to the root only when one stood, so a set before the element connected was dropped, and a set before the tag was defined left an own property hiding the accessor. On `lf-motion`, a page that set `currentTime` before the study connected lost the seek. The adapter now holds a member's message while no root stands and sends it to the next root, and moves a member's pre-upgrade own value through its accessor, as it already did for `properties`. Two runtime tests fail without the change and pass with it.
leaf-agent
previously approved these changes
Nov 27, 2026
… a frame A member set sent its message to the root, whose redraw lands in Effect UI's next flush, but announced no `pending-task` and no `lf-commands` after it, and a set held for a root's mount announced `lf-commands` before the held value had drawn. A member set now goes the way a set of props does: the drawing settles a `pending-task`, and `lf-commands` follows it. The runtime test of a held set checks what the host sees when `lf-commands` fires. `lf-motion`'s registry entry told authors that assigning `renderFrame` draws the current frame at once and that every seek calls it synchronously. Since the widget moved to Effect UI (#7397) it draws a microtask later, before the next frame, which nothing that seeks relies on; the entry now says that.
Two seeks in one task draw only the second time's frame, since the widget draws in Effect UI's next flush, so the entry now says the widget draws the latest time's frame before the next frame after an assignment, a seek or a playback step.
leaf-agent
approved these changes
Nov 27, 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.
Four fixes to the Effect UI adapter's foundations, found while reviewing the Effect UI work.
build/vendor.mjsset noproductioncondition, so@effect/ui's#devand#hotimports resolved to its development builds: every page with an Effect UI widget shipped the hot-reload and devtools code, and each mount readsessionStorageand scanned every live root. The row now builds withconditions: ["production"]./vendor/effect-ui.jsdrops from 595,034 to 580,769 bytes (196,227 to 190,967 gzipped), withScheduleradded to its exports.Effect.runSynccreates for each mount stays in the root's context, which keeps Effect UI from installing its time-slicedHtmlScheduler. Mounted withrunFork, a probe's Command ran eleven tasks later behind 50 ms of other roots' work.defineWidgetnow provides a synchronousMixedScheduleritself, so the timing is the adapter's choice (BrowserHost.mountEffect's docs name this as supported).lf-motion'scurrentTimebefore the study connected lost the seek. The adapter now holds the message for the next root, as it already kept earlyproperties. A member set also announced nopending-taskorlf-commandsfor the redraw it causes; it now draws the way a set of props does. On a shadow widget,lf-commandsstill leaves from the shadow root, where Leaf ignores it; Port lf-options to Effect UI as the first decorating widget #7417 moves it onto the element, so this leaves that line alone.lf-motion's entry promised that a seek draws its frame synchronously, which the widget's port (Draw lf-motion as an Effect UI component #7397) stopped doing. Nothing that seeks relies on it, so the entry now says the widget draws the latest time's frame before the next frame.Nothing a user sees changes. #7417 also edits
effect-widget.js, in other lines.Tests:
pnpm run test:runtime(1,201 pass; the two new member tests fail without the fix),pnpm run check:browser, and the tally (test_a_tally_counts_its_regions_obligations_and_walks_them), timeline and motion browser and journey tests. Codex reviewed each commit; its findings are folded in.