Repository navigation
Stack method chains in the Effect UI examples - #11389
Merged
Merged
Conversation
|
effect-bot
force-pushed
the
agent/nelson-effect-bot/c0162ae1b3c2
branch
4 times, most recently
from
December 2, 2026 23:22
e15c1c1 to
606a78b
Compare
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
UI Bundle SizeVite 8.4.0/Rolldown, production, default Oxc minification, es2023, ES modules, gzip level 9 per chunk. effect 4.2.0, Node v26.12.1. Effect-only client: 27528 B gzip (Δ 0 B vs base).
|
effect-bot
force-pushed
the
agent/nelson-effect-bot/c0162ae1b3c2
branch
2 times, most recently
from
December 3, 2026 01:38
4826018 to
18fcc74
Compare
effect-bot
force-pushed
the
agent/nelson-effect-bot/c0162ae1b3c2
branch
from
December 3, 2026 14:16
18fcc74 to
2ef7b8d
Compare
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.
Closes EFF-5017
Adds a small dprint formatter for the Effect UI examples in
examples/ui. In a chain with two or more method calls, the element (h.div) or other start of the chain stays on the first line and each method call goes on its own line below it, so a view reads as a tree. The script knows no names, so HTML, terminal and native views, kit parts and builders are all handled the same way.The PR has two commits:
scripts/stack-chains.mjs, the dprint config, therolldowndev dependency, a fixture test and a README note.dprint fmtoverexamples/ui(76 files, +4,822 / -3,791). Nothing outsideexamples/uichanges.Before and after (
examples/ui/counter/src/Counter.ts)The rule
Button(h, ...)), a name with its properties (h.div,AppNavigation.Issue), or the first method call when the chain opens with one ($.evolve(...),Effect.gen(...),scene.fire(a))..class(⏎ BUTTON_CLASS ⏎).Chains with a single call after the start are left as written:
h.header.children(...),expect(x).toBe(y),Effect.gen(...).pipe(...)andHtml.component({...}).make({...}). Gaps that contain a comment are also left as written.Review guide
dprint.jsonruns the exec plugin before the TypeScript plugin on**/examples/ui/**/*.{ts,tsx}. A path relative to the config (examples/ui/**) didn't match any files, so the pattern starts with**/. The TypeScript plugin needs explicitassociationsso that both plugins run on the same file. Test files (*.test.ts(x)) are excluded through the plugin-levelassociations, because a stacked.expect(a)⏎.toExist()splits each assertion in two. They keep ordinary dprint formatting. The exec plugin only accepts negated globs at the plugin level, not per command.examples/ui/launch/dprint.json(line width 70) gets the same block, withcwdpointing at the repository root. It can'textendsthe root config, because dprint rejects the root'sincludesandincrementalin a nested config.incrementalis nowtrue, andcacheKeyFilesreformats everything when the script changes. CI starts cold, so it pays for one node process per example file (about 200).rolldown@1.3.4was already in the lockfile through Vite. The lockfile diff only adds the root importer entry.Blame
Please rebase-merge this PR so the reformat stays its own commit. GitHub rewrites SHAs on merge, so the
.git-blame-ignore-revsentry has to come in a follow-up that uses the reformat commit's SHA onmain.Verification
dprint check --incremental=falseis clean right afterdprint fmt, includinglaunch.oxlintandpnpm checkpass.pnpm vitest run --project 'examples/ui*' --project scripts: 51 files and 154 tests pass.No changeset: the examples are private and nothing published changes.