Big @foldkit release today: first-class Submodels and much faster rendering.
Rendering is now much faster. Fast enough for real production use. On par with unoptimized React 19. Details in thread.
Submodels are first-class. Cleaner encapsulation, less boilerplate, better DX.
Stateful Foldkit UI components now uniformly surface facts to the parent through OutMessage.
New reflect* idiom for conforming a Submodel to externally-sourced state.
New Command mapping helpers cut boilerplate.
(thread)
In most frontends, answering “what state does my application start in?” requires forensic analysis. When you use Foldkit, you just read the `init` function.
This Week in Effect:
@thdxr speaking at Effect Miami 🇺🇸 on May 28
@foldkit on Effect Office Hours 29 🔥
Crypto service, Stream.broadcastN, and more Effect v4 Beta updates 👇
https://t.co/6CPiE0450g
Performance improvements + first-class Submodels branch is almost ready to ship.
I've tested it on all Foldkit example applications as well as some private side projects and it's a big upgrade all around:
- Better DX around Submodels. The seam between parent and child is clear and principled.
- More intuitive interaction with Foldkit UI components (which are just Submodels). Foldkit UI components now use OutMessage to surface facts to the parent, like any other Submodel.
- Way better performance: 844ms → 403ms on the TodoMVC benchmark (Foldkit optimised).
I'm going to leave this PR open for a few more days. In my experience, if you point your agent at the PR and ask it to upgrade, it does a great job.
Feedback is greatly appreciated!
https://t.co/R9r2THkBQJ
Working branch for performance optimization and first-class Submodels. Foldkit programs feel more organized, principled, and ergonomic with this update. And performance is now very close to what I’d consider acceptable for v1.
Instructions in the PR description if you’d like to try it out. Probably won’t do a next/beta release because I expect this to hit main in the next few weeks. Feedback always welcome.
https://t.co/3PESoRSZff
Heads up: a few significant changes coming to @foldkit in the next stretch.
Performance Improvements
Rendering will become fully synchronous, reducing Effect overhead in the hot path. Submodel views will be memoizable by construction. Currently, they can't be cached because parents pass fresh callbacks each render. A handful of smaller wins will land alongside (faster dispatch hot path, leaner Submodel embedding).
First-Class Submodels
Beyond memoization, Submodels will gain real encapsulation and ergonomics wins. Submodel views will dispatch their own Messages directly; the wrap from child Message to parent Message will be defined once at the Submodel boundary.
Pre-1.0, we're breaking things freely to land the right shape. Migration guides and changesets will be detailed enough that an agent can drive the upgrade for you.
Thanks for rolling with the churn!
@teej_dv Rebuilt the Subscription API to reduce verbosity and support a canonical pattern for composing Subscriptions.
Release: https://t.co/WqipZ0cSZy
Docs: https://t.co/Hbsdxs4d6j
@aidenybai You need to solve UI architecture before you can solve UI testing.
Foldkit Scene tests are pure, fast, and test what you actually care about. No browser, no JSDOM, no mocks.
https://t.co/EzQqThm0nZ
Foldkit DevTools MCP now exposes the full schema of your app’s Message union to agents.
The agent can ask the running app: “what Messages are available to send?” and get back the supported Message variants, including their payload shapes.
Before this release, agents could inspect DevTools history and dispatch Messages, but they had to infer Message shapes from your application code. Now DevTools MCP can tell them directly.
Release notes: https://t.co/Ma4tajpuzK
`Mount.defineStream` is new in Foldkit.
Mount is the natural shape for wiring DOM events from a specific element into your program or declaring side effects that occur as a result of an element mounting.
`Mount.define` is for one-shot side effects that occur as a result of an element mounting, like portal-ing or instantiating a third-party library bound to an element. `Mount.defineStream` adds support for ongoing streams, for example listening to scroll events or running an IntersectionObserver.
Release notes: https://t.co/CFldun55Zl
I built the same pixel art editor in Foldkit (with @EffectTS_) and React.
Profiled both production builds. Rendering performance was identical.
Foldkit is significantly stronger across DX, auditability, side effect handling, testing, and scaling.
And it's not close.
Think this sounds overblown? Good. Go look at the comparison.
https://t.co/D5pAuejsYp
been trying out https://t.co/l2agiAlNM8 today, it's really interesting.
initial thoughts:
- agent really liked it. cursor w/ 5.5 one-shot a bunch of stuff that was super annoying before that i was trying to (keep a persistent music player playing across different pages, share state, load state back from local storage, etc).
- it's all effect, which i like. dunno how well it integrates further down, gotta try some more httpapi integration stuff but should be fine w/ httpapi client
- seems to handle a bunch of stuff that normally felt really finnicky with getting right with effect, schema stuff, state thing,s blah blah
- the dev mode is insanely cool, can replay mesages and everything, super sweet
idk probably more to think of later but been enjoying it a lot
ty @devinjameson love the direction