FAQ

Short answers to common questions.

Do I need a build step?#

No. Zoijs runs as native ES modules in the browser. A <script type="module"> and an import map are the whole toolchain. You can add a bundler if you want one, but it's never required.

How do updates reach the page?#

Bindings update the exact text node or attribute that changed, so update cost scales with what changed, not with the size of your app.

Why do I have to wrap values in an arrow function?#

Components run once — there is no re-render. The () => is how Zoijs knows a binding should react. ${() => count.get()} is live; ${count.get()} is rendered once and never updates.

Is it secure against XSS?#

Text interpolations are written to inert Text nodes, so a string like <script> renders as text, never executes. URL attributes are scheme-checked, inline on* handlers from data are blocked, and there's no eval. It's CSP- and Trusted-Types-friendly.

Does it do SSR?#

Not yet. Zoijs is client-side. For SEO-critical content sites you'll want server rendering, which isn't available today. SPAs, dashboards, internal tools, and prototypes are a great fit.

How big is it?#

The core is tiny — a single small dependency-free module. The optional packages are each one small file.

What does Zoijs focus on?#

Size and simplicity. You write plain functions that return HTML and keep state in reactive values. The whole framework is seven small functions you can read in an afternoon, so there's very little to hold in your head.

Can I use TypeScript?#

Yes. Every package ships type definitions, so you get autocomplete and optional type-checking without converting your project to TypeScript.

Is this site built with Zoijs?#

Yes — it uses @zoijs/core, @zoijs/router, and @zoijs/head, loaded from a CDN with an import map. No build step.