HeadlinesBriefing favicon HeadlinesBriefing.com

Foldkit: Elm-like frontend framework on Effect

Hacker News •
×

Foldkit is a new frontend framework built on Effect and architected like Elm, written in TypeScript. It aims to provide a predictable and correct architecture, unlike frameworks like React, Vue, Svelte, and Solid that leave architecture to the developer.

Foldkit features a single immutable model for application state, with all changes flowing through a single update function, eliminating mutations and surprises. Side effects are handled explicitly as values returned from updates, described by commands and executed by the runtime. The framework is designed for linear complexity growth, ensuring that 5-file and 50-file applications follow the same understandable patterns.

Built entirely on Effect, Foldkit offers type-safe bidirectional routing, accessible UI components, and a robust system for submodels, subscriptions, managed resources, and field validation. It includes testing primitives like Story and Scene for state machine and view testing, respectively, and powerful Dev Tools for inspecting messages and model states with time-travel capabilities. Foldkit also supports embedding widgets and AI-assisted development through the Model Context Protocol.