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.

Is there a CLI? How do I start a new app?#

Yes — scaffold a named app in one command: npm create zoijs@latest my-app, then cd my-app, npm install, and npm run dev. The generated app is plain HTML/CSS/JS with no build step. The CLI is only a convenience; Zoijs works without it. See Start a New App.

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?#

Yes. The optional @zoijs/ssr package renders a component to HTML on the server (or at build time for static prerendering), then hydrates it on the client — adopting the server DOM in place, with no full re-render and no flash. The same component code runs in both places, and the core stays no-build. See the Server Rendering page.

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 nine 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, hover docs, and optional type-checking (checkJs) without converting your project to TypeScript. Scaffolded apps include a jsconfig.json and recommend a highlighter for html`` templates — see Editor Setup.

Is there lint tooling?#

Yes — the optional @zoijs/eslint-plugin enforces Zoijs's one rule: it flags a reactive ${count.get()} that should be ${() => count.get()} (read once, never updates) and auto-fixes it. It lints your code and never touches the core. See ESLint Plugin.

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.