๐ The Key Insights That Birthed Minimact โ
The philosophical foundation of Minimact emerges from questioning fundamental assumptions about modern web development. These insights led to a radically different approach to building reactive UIs.
1. Hydration Is a Tax, Not a Feature โ
The Problem: Client-side hydration is an optimization illusion. It delays interactivity, duplicates rendering logic, and bloats bundles.
Minimact Insight:
๐ฅ What if you never hydrated at all?
Instead of reconciling VDOMs on the client, Minimact predicts patches on the server using a Rust engine, and the client just applies them. No diffing. No waterfalls. Zero re-renders. ๐ฅ
Impact:
- First interactivity: 2-3ms (vs 150-300ms for hydration)
- Zero duplicate logic between server and client
- No hydration errors or mismatches
2. JSX Is Declarative DOM Logic โ Not Just Structure โ
The Problem: JSX traditionally binds structure and logic together, creating tight coupling and unnecessary nesting.
Minimact Insight:
๐ฏ What if JSX could declare behavior separately from structure?
With features like <Bundle />, Minimact turns JSX into a behavioral selector layer โ influencing DOM from afar with zero wrapper pollution.
Example:
// Traditional: Wrapper hell
<div className="fade-in">
<h1>Title</h1>
<p>Content</p>
<button>Action</button>
</div>
// Minimact: Behavioral anchors
registerBundle("hero", ".hero h1, .hero p, button");
useBundle("hero", { class: "fade-in", style: { opacity: 1 } });
<section className="hero">
<h1>Title</h1>
<p>Content</p>
<button>Action</button>
</section>Impact:
- Zero wrapper divs
- Behavior decoupled from structure
- CSS selectors become behavioral primitives
3. Reactivity Doesn't Require Hydration โ
The Problem: Reactive UI libraries usually bootstrap a reactive graph on the client.
Minimact Insight:
โก What if server-rendered UI could still feel reactive without ever being hydrated?
Minimact's SignalR-based sync layer and predictive patch engine makes state feel instant โ even though the logic never leaves the server.
Architecture:
User clicks button
โ
Client: Send state change via SignalR (1-2ms)
โ
Server: Re-render component with new state
โ
Rust Predictor: Check if patch was pre-computed
โ (cache hit)
Client: Apply cached patch (0-1ms) โ INSTANT
โ (cache miss)
Server: Compute patches, send back (5-15ms)
โ
Client: Apply patchesImpact:
- 0-1ms updates on cache hit (99% faster)
- No client-side reactive graph
- No useEffect/watch waterfalls
4. You Can Predict UI Changes Before They Happen โ
The Problem: Most frameworks wait for a signal (click, scroll, etc.), then compute new UI.
Minimact Insight:
๐ง What if you precomputed the next UI states ahead of time?
Rust-native predictive patches mean the client instantly receives ready-to-apply UI โ like a DOM time traveler.
How It Works:
- Rust observes user patterns: "When count = 9, it often becomes 10 next"
- Pre-computes patches for count = 10
- Sends patch to client's HintQueue
- User clicks increment โ Client checks HintQueue first
- ๐ข CACHE HIT! Apply patch in 0-1ms, no network round-trip
Impact:
- Perceived latency: 0ms
- Server still maintains truth
- Client feels native
5. C# and JSX Can Be Friends โ
The Problem: The industry pretends that .NET and modern UI are mutually exclusive.
Minimact Insight:
๐ค What if you brought the expressive power of JSX to the maturity of ASP.NET Core?
Minimact transpiles JSX/TSX to C#, combining ergonomic frontend syntax with the power of .NET's performance, security, and tooling.
Example:
// Write this (JSX/TSX)
export function Counter({ initialCount = 0 }) {
return (
<div className="counter">
<span>{initialCount}</span>
<button onClick={() => setCount(initialCount + 1)}>+</button>
</div>
);
}
// Transpiles to (C#)
public class Counter : MinimactComponent
{
[Prop] public int InitialCount { get; set; } = 0;
protected override VNode Render()
{
return new VNode("div", new { className = "counter" },
new VNode("span", InitialCount.ToString()),
new VNode("button",
new { onClick = "increment" },
"+"
)
);
}
public void OnIncrement()
{
SetState("count", InitialCount + 1);
}
}Impact:
- Ergonomic component syntax
- .NET performance and tooling
- Type safety across full stack
6. Most UI Doesn't Need a Virtual DOM โ
The Problem: The VDOM is a clever hack... but also an expensive middleman.
Minimact Insight:
๐ซ What if you removed the middleman entirely?
You get direct, precomputed DOM diffs without reconcilers, lifecycles, or fiber trees. Just intent โ patch โ done.
Traditional VDOM:
State change
โ Re-render to VDOM
โ Diff VDOM with previous
โ Compute patches
โ Apply to DOMMinimact:
State change
โ Server computes patches
โ Client applies patches โ DONEImpact:
- No VDOM reconciliation overhead
- No fiber tree traversal
- Direct DOM manipulation
7. Size Matters โ
The Benchmark:
- React 18: 45KB gzipped
- Vue 3: 34KB
- Minimact: 13.33KB โ including predictive runtime, SignalR hooks, and interactivity glue
Minimact Insight:
๐๏ธ Minimalism isn't a constraint. It's a superpower.
Everything in Minimact is designed for maximum leverage: bytes, logic, latency โ all minimized without sacrificing power.
What's in those 13.33KB:
- โ Patch application engine
- โ HintQueue (predictive cache)
- โ SignalR state sync
- โ DOM manipulation primitives
- โ Component lifecycle hooks
- โ Event handling
What's NOT in those 13.33KB:
- โ Virtual DOM reconciler
- โ Reactive graph runtime
- โ Component fiber tree
- โ Effect scheduler
- โ Hydration logic
Impact:
- Faster download (40-70% smaller)
- Faster parse (less JS to evaluate)
- Faster execution (simpler runtime)
8. Structure โ Behavior โ
The Problem: Wrapping elements to apply styles or state is a legacy constraint from the VDOM days.
Minimact Insight:
๐งผ What if you could express behavior across components, elements, and render passes โ without ever wrapping them?
With concepts like registerBundle() + useBundle(), you create declarative, multi-element styling/logic scopes with zero intrusion.
Example:
// Register behavioral anchor
registerBundle("loading", "button, input, .interactive");
// Apply behavior to all matching elements
useBundle("loading", {
class: isLoading ? "disabled loading" : "",
attr: { "aria-busy": isLoading }
});
// Structure remains clean
<form>
<input type="text" />
<button>Submit</button>
<div className="interactive">Status</div>
</form>Impact:
- No wrapper divs
- Behavior applied to arbitrary selectors
- Clean separation of structure and behavior
9. You Can Have Server-First AND First-Class Interactivity โ
The Problem: Most SSR frameworks trade off interactivity for speed or vice versa.
Minimact Insight:
๐ What if you had both โ and instantly?
Minimact's patch model is state-driven, interactivity-preserving, and fast AF. You get interactions in 2-3ms, even on 3G.
Performance Metrics:
| Metric | React SSR | Next.js | Remix | Minimact |
|---|---|---|---|---|
| Time to Interactive | 150-300ms | 120-250ms | 100-200ms | 2-3ms |
| Bundle size | 45KB | 85KB | 55KB | 13.33KB |
| State update | 16-32ms | 20-40ms | 15-30ms | 0-1ms (predicted) |
| Network requests | Many | Many | Many | 1 (SignalR) |
Impact:
- Native app-like interactivity
- Server-side rendering benefits
- No trade-offs
10. Posthydrationism Is a Movement โ
The Problem: Frameworks usually define a stack. Minimact defines a philosophy.
Minimact Insight:
๐ Stop thinking in hydration waterfalls, loading states, and client VMs. Start thinking in patches, bundles, and predictive state.
Minimact isn't just a tool โ it's the manifesto of a better, saner, more server-aware web.
The Posthydrationist Manifesto:
- Server-first, always - Logic lives on the server, not duplicated
- Patches over reconciliation - Direct DOM updates, no diffing
- Prediction over reaction - Pre-compute likely states
- Bundles over wrappers - Behavior without structure pollution
- Minimal over maximal - 13KB does what 45KB used to
- State sync over hydration - Real-time updates, zero bootup cost
๐ต In Summary โ
Minimact exists because we saw through the myths:
- โ That hydration is necessary
- โ That virtual DOMs are sacred
- โ That servers can't be reactive
- โ That JSX must be tied to the tree
- โ That .NET can't be cutting-edge
Instead, we built a system that proves:
Minimal code. Maximum control. DOM domination.
What Makes This Revolutionary โ
Traditional Framework Assumptions: โ
Client = Smart (runs framework)
Server = Dumb (sends HTML)Minimact Reality: โ
Server = Smart (React + Rust predictions)
Client = Fast (13KB patch applier)Result: Best of both worlds with none of the trade-offs.
Core Principles in Action โ
| Traditional Approach | Minimact Approach |
|---|---|
| Hydrate client-side | Never hydrate |
| Virtual DOM diffing | Direct patch application |
| Client reactive graph | Server state + SignalR sync |
| Wrapper div hell | Behavioral bundles |
| 45KB+ frameworks | 13.33KB runtime |
| Wait for user input | Predict next states |
| Choose SSR or SPA | Get both, instantly |
The Minimact Stack โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Developer writes JSX/TSX โ
โ (Familiar React-like syntax) โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ Transpile
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ C# MinimactComponent classes โ
โ (Server-side rendering) โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ Render to VNode tree
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Rust Predictive Engine โ
โ (Pre-compute likely patches) โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ Send patches via SignalR
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Client Runtime (13.33KB) โ
โ - HintQueue (cache) โ
โ - Patch applier โ
โ - State sync โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโPhilosophical Lineage โ
Minimact builds on and transcends:
- Smalltalk - Everything is a message (SignalR state sync)
- Erlang - Let it crash (server maintains truth)
- LISP - Code as data (VNode trees)
- React - Declarative UI (JSX syntax)
- Phoenix LiveView - Server-side rendering + real-time updates
- htmx - HTML over the wire (patch-based updates)
But goes beyond all of them:
- โจ Predictive - Pre-compute future states
- โจ Minimal - 13KB client runtime
- โจ Behavioral - Bundles without wrappers
- โจ Type-safe - Full-stack TypeScript โ C#
- โจ Quantum - Extensions that transform the DOM
Why This Matters โ
For Developers:
- Write less code
- Reason about less complexity
- Ship faster features
For Users:
- Instant interactivity (0-1ms)
- Smaller downloads (70% less JS)
- Better performance on low-end devices
For The Web:
- Server-first architecture
- Less JavaScript bloat
- More sustainable computing
Next Steps โ
The web doesn't need more JavaScript. It needs better architecture. ๐ตโจ
