Getting started
Three files and one command. The file tree is the route table, so nothing registers anything.
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.
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.
npm create weft my-app
cd my-app
weft devThat leaves you with three files that matter:
| File | What it is |
|---|---|
app/layout.tsx | The document. Its <slot> holes are what a route fills. |
app/routes/index.tsx | The page at /. A .tsx is a fragment. |
app/routes/index.data.ts | What 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/badgeOne hole, one sealed template. This is the unit everything else is made of.
app/fragments/examples/badge.tsximport { 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
Holes
| Binding | Hole | Escape |
|---|---|---|
label | text | escape |
What the client wires on adoption
| Op | Binds | Where |
|---|---|---|
text | label | text 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.