Some experiments written in ReScript. Mostly written with Claude.
WARNING: None of this is intended for real production use.
Weft is the UI framework in here: weft (components, hooks and a fiber reconciler), weft_dom (the
DOM renderer) and weft_signals (hooks for reading signals), plus the weft_app example. Server
components for it are under way: weft_server and weft_vite_plugin, with the weft_notes,
weft_split and weft_shop examples.
| Package | What it is |
|---|---|
@e-cline/common |
Utilities with no direct Belt equivalent: array helpers, an ImmutableArray, debug-only assertions, hashing, and a lazy sequence type. |
@e-cline/priority_queue |
Priority queues: a mutable array-backed binary heap and an immutable leftist heap. |
@e-cline/trees |
Persistent sorted maps (a B+tree, an AVL tree and a chunked AVL tree), with mutable variants and diffing that takes advantage of structural sharing. |
@e-cline/signals |
Reactive signals: atoms, computeds and effects, with diff-driven history for incremental consumers. |
@e-cline/signal_maps |
A sorted, signal-backed map whose derived views update incrementally. Built on the two packages above. |
@e-cline/servy |
A small framework for HTTP servers on the Web-standard Request/Response APIs, running on Node. |
@e-cline/weft |
A React-like component library: @weft.component components and hooks, rendered by a fiber reconciler through a pluggable host renderer. |
@e-cline/weft_dom |
The DOM renderer for weft: render components into a browser page. |
@e-cline/weft_signals |
Hooks for reading signals atoms and computeds from weft components. |
@e-cline/weft_server |
Server components for Weft: render on the server into a streamed payload, decode it on the client, with entrypoints loaded on demand. |
@e-cline/weft_vite_plugin |
The Vite plugin for Weft's server components: server and client environments, an entrypoint per chunk, the boundary enforced, dev and build. |
These are at version 0.0.x: the APIs are still changing, and any release may break them.
None of these packages is on npm yet. The steps below are how you'll use one once it's published; until then, the way to try one is to clone this repository and work inside it (see CONTRIBUTING.md).
The ReScript packages need ReScript 12. Install one alongside the compiler and its runtime:
npm install @e-cline/signals rescript @rescript/runtimeThen list it in your rescript.json:
{
"dependencies": ["@e-cline/signals"]
}Each package's modules sit under a namespace named after it (Signals, Trees, Common,
SignalMaps, Servy, Weft, WeftDom, WeftSignals, WeftServer), so Signals.Atom.make works
without an open. The packages ship as ReScript source, and your project's rescript build
compiles them along with your own code.
These aren't published:
examples/-- an HTTP server built withservy, a React component written in ReScript and the TypeScript React app consuming it, a todo app built withweft, a notes app and an app code-split with Weft's server components (with tests through the plugin's harness, and in a browser), a tree-shaking check, and a use of the PPX below.packages/trees/benchmarks,packages/signals/benchmarks,packages/signal_maps/benchmarksandpackages/weft/benchmarks-- benchmarks fortrees,signals,signal_mapsandweft, run against a bundled and minified build.tools/benchmarking-- what benchmark packages share: ReScript bindings to mitata and a seeded PRNG.tools/ppx/pretty_print-- an example ReScript PPX, written in OCaml, that derives pretty-printers for types.tools/ppx/weft-- the PPX for Weft's@weft.componentattribute, the start of server components for Weft, with its tests intools/ppx/weft_tests.RESCRIPT.md-- notes on integrating ReScript with the Vite+ toolchain, including the rough edges found along the way.
See CONTRIBUTING.md for how to set up, build and test the workspace, and SECURITY.md for reporting a vulnerability.