No build step
Import the library from a CDN, fetch a component from your own host, mount it. That is the whole deployment.
<script type="module">
import { C79 } from "https://esm.sh/jq79"
C79.fetch("./app.html").mount("#app")
</script>jq79 parses and mounts single-file components in the browser, at runtime. No compiler, no bundler, no virtual DOM — one script from a CDN and any static host is the whole stack.
<script :setup="{ step = 1 }">
let count = 0
$: double = count * 2
</script>
<button @click="count = count + step">
clicked {{ count }} times
</button>
<span :if="count > 0">double is {{ double }}</span>
<style scoped>
button { font: 600 1rem system-ui; padding: .7em 1.2em; border: 0; border-radius: 99px; background: #3178c6; color: white; }
span { font: 1rem system-ui; margin-left: .8em; }
</style>
Most component frameworks need a toolchain between your source and the browser. jq79 moves that step into a 31.5 kB runtime, so the browser can take your components as they are.
Import the library from a CDN, fetch a component from your own host, mount it. That is the whole deployment.
<script type="module">
import { C79 } from "https://esm.sh/jq79"
C79.fetch("./app.html").mount("#app")
</script>Markup, a setup script and styles side by side, in a .html file any editor, server or CDN already understands.
<script :setup="{ name }"></script>
<h1>Hello {{ name }}!</h1>
<style scoped> h1 { color: tomato } </style>Top-level let and const are reactive, and $: derives from them. No hooks, no signals to unwrap, no setState.
<script :setup>
let price = 4
let quantity = 2
$: total = price * quantity
</script>Proxies track what each binding read. A write re-runs only those bindings — no diffing, no re-rendering the component.
rows[3].label = "renamed"
// one text node changes; the other
// 999 rows aren't even looked atAn import() of an .html fetches that component when it's needed: the ones a script is sure to need start together, before its first line runs; one in a handler waits for its line. The chunk is the file; there's no chunk graph to configure.
const Chart = await import("./Chart.html")A dev server with hot reload, a Vite plugin, TypeScript in setup scripts, a VS Code extension, and a CSP-safe mode. All optional.
npx jq79 dev # serve + hot reloadIn the order you'll need it: install, put it on a page, write components, compose them, share state, load data, and ship.
Nothing to install if you don't want to: every major CDN serves the package. Pin a version in production.
<script type="module">
import { C79 } from "https://esm.sh/jq79"
// or https://cdn.jsdelivr.net/npm/jq79/+esm
</script><script src="https://cdn.jsdelivr.net/npm/jq79/dist/jq79.global.js"></script>
<script>
const { C79 } = jq79
</script>With npm, for a bundler or the dev tools:
npm install jq79C79.fetch() downloads a component and hands back a pending one you can mount straight away — every call queues on the download. The second argument is the component's props.
<!doctype html>
<main id="app"></main>
<script type="module">
import { C79 } from "https://esm.sh/jq79"
C79.fetch("./app.html").mount("#app", { title: "Today" })
</script>Awaiting it gives you the component itself; fetchAll() loads several in parallel. Each URL is downloaded once and reused by later fetches and imports — Component79.cache(false) turns that off.
const app = await C79.fetch("./app.html").mount("#app")
const [Header, Footer] = await C79.fetchAll(["./Header.html", "./Footer.html"])Markup, an optional <script :setup> and an optional <style>, in any order.
<script :setup="{ title }">
let todos = []
let draft = ""
$: left = todos.filter(todo => !todo.done).length
const add = () => {
todos = [...todos, { text: draft, done: false }]
draft = ""
}
</script>
<h1>{{ title }} <small>{{ left }} left</small></h1>
<form @submit.prevent="add">
<input :value="draft" @input="draft = $event.target.value">
<button :disabled="!draft">add</button>
</form>
<style scoped>
small { color: gray; font-weight: normal; }
</style>:setup="{ title }" declares the props the component takes, with optional defaults.let/const become reactive; assigning to them — from a handler, a timer or a .then() — updates the DOM.$: re-runs whenever what it reads changes.scoped keeps the styles inside this component.Expressions in {{ }}, attributes with :name, events with @name, structure with :if and :each.
<ul>
<li :each="todo in todos" :key="todo.id" :class.done="todo.done">
<input type="checkbox" :checked="todo.done"
@change="todo.done = $event.target.checked">
{{ todo.text }}
</li>
</ul>
<p :if="!todos.length">Nothing to do.</p>
<p :elseif="left === 0">All done 🎉</p>
<p :else>{{ left }} to go</p>
<a :href="`/todos/${id}`" @click.prevent="open(id)">details</a>Event modifiers (.prevent, .stop, .once…), :class as string/object/array, :html with a sanitizer, :with to narrow scope.
Import a component in the setup script and use it as a tag. Props go down, $emit events come up, and :model wires both ways.
<script :setup>
const TodoItem = await import("./TodoItem.html")
let todos = [{ id: 1, text: "write a component" }]
const remove = todo => { todos = todos.filter(t => t !== todo) }
</script>
<ul>
<TodoItem :each="todo in todos" :key="todo.id"
:todo @remove="remove(todo)" />
</ul><script :setup="{ todo }"></script>
<li>
{{ todo.text }}
<button @click="$emit('remove')">×</button>
</li>Slots pass markup instead of data, and several components can live in one file with <template name>.
<Card>
<template :slot.header><h2>{{ title }}</h2></template>
<p>{{ body }}</p>
</Card>When two components need the same state, make it a store. $reactive works anywhere — including a plain module, which is all an app-wide service needs to be. $computed derives from it.
import { $reactive, $computed } from "https://esm.sh/jq79"
export const cart = $reactive({ items: [] })
export const total = $computed(() =>
cart.items.reduce((sum, item) => sum + item.price, 0)
)
export const add = item => { cart.items = [...cart.items, item] }<script :setup>
const { cart, total } = await import("./cart.js")
</script>
<span>{{ cart.items.length }} items · {{ total.value }} €</span>Every component that holds the store sees every write, whoever made it. A store passed as a prop is shared the same way — no context API, no injection.
A setup script can await. The template waits for it — or renders straight away from await $mounted(), and fills in when the data lands. After it, the component's DOM is there to query with $self.
<script :setup>
let users = []
let loading = true
await $mounted() // render now, fill in later
$self("input").focus()
users = await fetch("/api/users").then(r => r.json())
loading = false
</script>
<input placeholder="search">
<p :if="loading">loading…</p>
<ul :else>
<li :each="user in users" :key="user.id">{{ user.name }}</li>
</ul>No bundler: npx jq79 dev serves your folder as-is and hot-reloads the components you edit, keeping their state.
npx jq79 dev # http://localhost:4179With Vite: the plugin imports .html components as modules, with HMR and TypeScript in setup scripts. The same files keep working when fetched at runtime.
import { jq79 } from "jq79/vite"
export default { plugins: [jq79()] }import App from "./App.html"
App.mount("#app")In your editor: the VS Code extension highlights and type-checks components; jq79-check does the same in CI.
Upload the folder to any static host — GitHub Pages, S3, a CDN. There's no build output because there's no build. For a page with a strict Content Security Policy, safeEval runs without 'unsafe-eval', with or without a bundler.
import { C79 } from "https://esm.sh/jq79@0.9.0" // pin it
await C79.safeEval() // no new Function, ever
C79.fetch("./app.html").mount("#app")22 short lessons, each a component you edit with a live preview beside it. Because there is no compiler, the tutorial runs the real library: the component you write is the component that mounts.
Open the tutorial →Updates are where jq79 is fastest: a write reaches only the bindings that read the path it changed, so updating rows in a 10,000-row table costs what the changed rows cost. Every release is measured on the js-framework-benchmark row table, against itself and against React, Vue, Svelte and Preact.
See the benchmark →Paste the page from step 02 into a folder, add an app.html, and open it.