Ports, config, and the build
Ports replace, plugins extend. Fourteen are declared and eleven are bound by the front door with no configuration at all.
No configuration at all for a first deployment. Bind a port and only that behaviour changes; a port that is not bound refuses by name rather than approximating.
No configuration at all for a first deployment. Bind a port and only that behaviour changes.
Not unlimited. Likewise an edge key-value store refuses lease outright, because a lease that is not atomic guards nothing.
In plain terms
Ports are the things your deployment provides: a store, a limiter, a registry, a clock. You swap a port to change where something lives; you add a plugin to add something to a request. Ports replace, plugins extend.
Everything a framework normally does for you is a port here: the store, the session, the flags, the executors, the registry, the transport. Fourteen are declared, fourteen are implemented, and eleven are bound by the front door with no configuration at all — so a deployment that changes nothing is a real deployment rather than a demo mode.
// weft.config.ts
import { defineConfig, redisLeases } from '@weftjs/core'
import { workerPool } from '@weftjs/adapters'
export default defineConfig({
port: 3000,
store: redisLeases({ url: process.env.REDIS_URL }),
executors: { 'pool:heavy': workerPool({ size: 4 }) },
flags: { 'new-cart': ['off', 'on'] },
})Those four are the ones an application reaches for first. There are twenty-nine, and every one of them — with what it accepts, what it defaults to and a line showing the shape — is on the weft.config.ts reference. Every port is there too, with what implements it and which key binds it.
Ports replace, plugins extend
A port has one implementation at a time and swapping it changes where something happens. A plugin adds to a request without replacing anything, declares what it reads and provides, and its ordering is inferred from those declarations — so a cycle or an ambiguity is a build error rather than a race.
The one thing neither may do is write a cache key. A plugin may add an axis; nothing can set a key, because a key that can be written by hand is a key that can be written wrongly.
The build, and the tier below it
weft build # sealed templates, the generated plan, the manifest, revved assets
weft start # serve the build. No compiler runs
weft verify # ask every region what it is serving, and fail on disagreement
weft upload # PUT the build to an object storeA page whose every fragment reads nothing is resolved at build time and written as a file, so it is served without the kernel being invoked at all. A parameterised route joins that tier when its parameters are a set the application declared. Every page that is not a file is refused by name, with the read that caused it — because a tier nobody can see is a tier nobody uses.