Your whole app, understood.
Qat’s compiler reads every layer of your app before it ships — so it renders less, sends less, and finds the bugs you would have shipped.
Bill.qx, renderedtip = 0
Dinner for two84.00 ₼
Total84.00 ₼
What the compiler knows4 nodes, 3 edges
tip stateamount a proptotal derivedone text node writtenAdd a tip. Watch where the update goes.
The runtime every page loads, gzip, as the size gate measures it.
How we measureRe-renders. A component runs once; updates are written to nodes, never to components.
How we measurep95 server render of a typical route in a generated 104,495-line app.
How we measureWrite it once.
Where a page renders is one option on its route. The component does not change when the mode does.
export default function Bill(props: { amount: number }) {
let emit = emits<{ tip: number }>()
let tip = state(0)
let total = derived(props.amount * (1 + tip / 100))
const add = () => {
tip += 5
emit('tip', tip)
}
return (
<p class="bill-row"><span>Dinner for two</span><span>{props.amount.toFixed(2)} ₼</span></p>
<p class="bill-total"><span>Total</span><strong>{total.toFixed(2)} ₼</strong></p>
<button type="button" class="bill-add" on:click={add}>Add 5 % tip</button>
)
}tip statetotal derived- ClientHTML + 5.2 kBThe runtime and the component
- ServerHTML + 8.0 kBRendered per request, resumed in place
- StaticHTML + 8.0 kBRendered once at build, resumed in place
- IslandHTML + 8.6 kBInteractive parts resume when needed
What the browser loads for Bill.qx, gzip: the runtime and resume sizes the build gates, plus Bill.qx compiled (533 B). Nothing in the file changes.
The compiler finds what you’d have shipped.
$ qatjs check
src/Search.qx:5:63 warning QX-EVENT-UNDEBOUNCED This on:input handler starts a request on every keystroke, and the framework never debounces on its own
fix: add |debounce:300
1 files, 0 errors, 1 warningsA search box that starts a request on every keystroke: qatjs check names the line and the fix, before a user finds it.
It already speaks your language.
Write .qx with blocks, or the .tsx you already know. The compiler does not care.
export default function Account(props: { user?: { name: string } }) {
return (
<section>
{if (props.user)}
<h2>{props.user.name}</h2>
{else}
<p>Loading your account…</p>
{/if}
</section>
)
}import { If } from '@qatjs/core'
export default function Account(props: { user?: { name: string } }) {
return (
<section>
<If when={props.user} fallback={<p>Loading your account…</p>}>
<h2>{props.user.name}</h2>
</If>
</section>
)
}Same compiler, same output: both compile to 302 B gzip, measured at build.
Comes from React.
npx qatjs migrate ./src converted 97 % of a real checkout (118 of 122 constructs); the rest is listed, not guessed.
Before
import { useMemo, useState } from 'react'
export function Total({ items }) {
const [tip, setTip] = useState(10)
const total = useMemo(() => items.reduce((s, i) => s + i.price, 0) * (1 + tip / 100), [items, tip])
return (
<p>
<button onClick={() => setTip(tip + 5)}>More tip</button>
<strong>{total.toFixed(2)} ₼</strong>
</p>
)
}After, from qatjs migrate
export function Total({ items }) {
let tip = state(10)
let total = derived(items.reduce((s, i) => s + i.price, 0) * (1 + tip / 100))
return (
<p>
<button onClick={() => (tip = tip + 5)}>More tip</button>
<strong>{total.toFixed(2)} ₼</strong>
</p>
)
}tip statetotal derivedBuilt for the long run.
Budgets enforced at build
Give a route a byte budget. qatjs compress fails when it is crossed, naming the route, the sizes and the files.
Nothing leaves your servers
Field vitals go to an endpoint on your own origin; any other address throws. The framework sends nothing of its own.
Components you own
qatjs add copies a component into your app, in .qx and .tsx. No library version to chase: the code is yours.