Server-side rendering using Preact components, a pool of JS runtimes,
and QuickBEAM's native DOM — no Node.js, no renderToString.
mix npm.install preactfetches Preact intonode_modules/- OXC transforms JSX and bundles
app.jsx+ Preact into a single script at startup - A
QuickBEAM.Poolof 4 runtimes is initialized with the bundle - On each request, a runtime is checked out from the pool
- Preact's
render()writes into the native DOM (lexbor, a C library) - Elixir reads the DOM with
dom_text/2to extract the page title document.body.innerHTMLserializes the body HTML- The runtime is reset and returned to the pool
┌──────────────────────────────────────┐
HTTP request ───→ │ QuickBEAM.Pool (4 runtimes) │
│ │
│ ┌─ QuickJS ──────────────────────┐ │
│ │ Preact h() → render() │ │
│ │ ↓ │ │
│ │ Native DOM (lexbor) │ │
│ └─────────────┬──────────────────┘ │
└────────────────┼─────────────────────┘
│
Elixir reads DOM directly ──┘
dom_text(rt, "h1") → "Blog"
eval(rt, "document.body.innerHTML") → "<div>..."
mix deps.get
mix npm.install preact
mix run run.exsmix test- Native DOM — Preact renders into a real DOM tree (lexbor), not strings
- Elixir DOM access —
dom_text,dom_find,dom_find_allread the live DOM without JS execution - Pool —
NimblePoolof runtimes for concurrent rendering with automatic reset - npm packages —
mix npm.install, resolved and bundled by OXC - Zero Node.js — no
node, nonpx, no build step