weft
ir 2.6.0 · warp 1.8.0

Getting started

Three files and one command. The file tree is the route table, so nothing registers anything.

$npm create weft my-app --template app--template minimal
template app — the default a working page, a param route, one mutation
my-app/ 21 files
app/
layout.tsx the document. Its slot holes are what a route fills
layout.css linked by every page under it
styles.css the application’s own sheet
routes/ the route table — this subtree is it
index.tsx /
index.data.ts head, cache policy, loader
index.css linked only by the pages that render index
fragments/
weft.config.ts every line commented out — an application with no config still has a store
Every file the command writes, in both templates. There is no src/, no bundler config, no route manifest and no plugin list: the routes/ subtree is the route table, and weft.config.ts arrives with every line commented out because an application with no config still has a real store, a cookie session and an executor.
✓ Valid An application with no config file

You get an in-process store, a cookie session, no flag axes and inline as the only executor — a real single-process deployment, not a placeholder. Bind a port in weft.config.ts later and nothing else in the application changes.

✕ Refused reading a flag nobody declared
what you wrote→flags must be declared in weft.config.ts→build error

A typo becomes a build error instead of a branch that silently never runs.

In plain terms

Run one command and you get a folder that already serves a page. The framework reads the tree — there is no registry to update, no route config, and no build step to understand before your first edit. --template minimal gives you four files instead of twenty-one if you would rather start from almost nothing.

A weft application is a folder. There is no configuration you must have, no wiring file, and no bundler — the route table is the file tree and the plan that places everything on a page is generated from it.

sketch — not compiled
npm create weft my-app
cd my-app
weft dev

That leaves you with three files that matter:

FileWhat it is
app/layout.tsxThe document. Its <slot> holes are what a route fills.
app/routes/index.tsxThe page at /. A .tsx is a fragment.
app/routes/index.data.tsWhat that route declares: its head, cache policy, loader, guard and slots. Optional.

A fragment is the unit

Everything this framework renders is a fragment, and a fragment compiles to a sealed template: pre-encoded UTF-8 segments with holes between them, and a version that is a hash of its own content. Rendering is writing those bytes and filling the holes.

The smallest fragment

examples/badge

One hole, one sealed template. This is the unit everything else is made of.

output
new
app/fragments/examples/badge.tsx
import { fragment } from '@weftjs/core'

/** A fragment with one hole. The smallest thing this framework compiles. */
export default fragment(({ label }: { label: string }) => <span class="pill">{label}</span>)
What the compiler knows
Holes1
Escape elided0
Effect setnone — static
Wire formshtml · bundle · split · patch · delta

Holes

BindingHoleEscape
labeltextescape

What the client wires on adoption

OpBindsWhere
textlabeltext at [0]
Sealed templates
1
Version
de3e2a47aa3d5266eda10b0e4057fd4b

Open the file at that path. Nothing else produced the markup beside it.

Then what?

The next page is the file convention in full. If you would rather see a mechanism than read about it, pnpm inspect opens the inspector — a page per capability, each with a control.