DOCS v0.1.13 github

@hatch:web v0.1.5

Server-rendered, htmx-native web framework for Wren. Router, middleware, content-negotiated rendering via @hatch:template, HTTP/1.1 server on top of @hatch:socket.

stable networking updated May 2, 2026 source ↗
README
$ hatch add @hatch:web

MOD live

CL Scheduler_

NEW Scheduler_.new()

GET Scheduler_.count

GET Scheduler_.isEmpty

GET Scheduler_.tick

FN Scheduler_.spawn(fn)

FN Scheduler_.static isExpectedDisconnect_(err)

FN Scheduler_.static removeAt_(list, idx)

CL Subscription_

NEW Subscription_.new_(channel)

GET Subscription_.limit

SET Subscription_.limit=(n)

GET Subscription_.receive

GET Subscription_.close

GET Subscription_.closed_

FN Subscription_.static DEFAULT_QUEUE_LIMIT_

FN Subscription_.deliver_(msg)

CL Channel

NEW Channel.new(name)

GET Channel.name

GET Channel.subscriberCount

GET Channel.subscribe

FN Channel.broadcast(msg)

FN Channel.unsubscribe_(sub)

CL SseStream

NEW SseStream.new_(writerFn)

GET SseStream.writer

FN SseStream.static stream(writerFn)

CL Sse

FN Sse.static stream(writerFn)

FN Sse.static frame(payload)

FN Sse.static escapeLines_(s)

FN Sse.static indexOf_(s, ch)

MOD web

CL Request

NEW Request.new_(method, path, query, headers, body, remote)

GET Request.method

GET Request.path

GET Request.headers

GET Request.body

GET Request.remote

GET Request.params

GET Request.rawQuery

GET Request.session

GET Request.flash

GET Request.flashNext

SET Request.session=(s)

SET Request.flash=(f)

SET Request.flashNext=(f)

GET Request.fragmentSheet

SET Request.globalSheet=(s)

GET Request.globalSheet

GET Request.query

GET Request.form

GET Request.hx

GET Request.isHx

FN Request.setFlash(key, value)

FN Request.style(s)

FN Request.validate(form)

FN Request.param(name)

FN Request.header(name)

FN Request.render(tpl, context)

FN Request.render(tpl)

FN Request.setParam_(k, v)

CL Response

NEW Response.new()

NEW Response.new(status)

NEW Response.new(status, body)

GET Response.status

GET Response.body

GET Response.headers

GET Response.cookies_

SET Response.status=(s)

SET Response.body=(b)

FN Response.init_(status, headers, body)

FN Response.header(name, value)

FN Response.cookie(name, value)

FN Response.cookie(name, value, opts)

FN Response.html(s)

FN Response.text(s)

FN Response.json(s)

FN Response.static redirect(url)

FN Response.static redirect(url, status)

FN Response.static coerce(value)

CL Route_

NEW Route_.new_(method, pattern, handler)

GET Route_.method

GET Route_.handler

FN Route_.static compile_(pattern)

FN Route_.match_(method, path)

CL Router

NEW Router.new()

NEW Router.new_(prefix)

GET Router.routes

FN Router.get(path, fn)

FN Router.post(path, fn)

FN Router.put(path, fn)

FN Router.patch(path, fn)

FN Router.delete(path, fn)

FN Router.any(path, fn)

FN Router.mount(subRouter)

FN Router.add_(method, path, fn)

FN Router.resolve(method, path)

CL Pipeline_

NEW Pipeline_.new_(stack, terminal)

FN Pipeline_.run(req)

FN Pipeline_.step_(req, i)

CL App

NEW App.new()

GET App.globalSheet

FN App.clearRoutes_()

FN App.globalCss(style)

FN App.get(path, fn)

FN App.post(path, fn)

FN App.put(path, fn)

FN App.patch(path, fn)

FN App.delete(path, fn)

FN App.any(path, fn)

FN App.mount(r)

FN App.use(fn)

FN App.notFound(fn)

FN App.error(fn)

FN App.handle(req)

FN App.listen(addr)

FN App.spawn(fn)

FN App.channel(name)

FN App.serve_(conn)

CL Http_

FN Http_.static readRequest(conn)

FN Http_.static writeSseHeaders(conn)

FN Http_.static writeResponse(conn, resp)

FN Http_.static bodyLen_(body)

FN Http_.static parseForm(s)

FN Http_.static urlDecode(s)

FN Http_.static hex(s)

FN Http_.static indexOf(s, ch)

FN Http_.static trim(s)

FN Http_.static lower(s)

FN Http_.static reason(status)

CL ByteBuf_

NEW ByteBuf_.new(conn)

GET ByteBuf_.readLine

FN ByteBuf_.read(n)

FN ByteBuf_.findCrlf_()

FN ByteBuf_.fill_()

FN ByteBuf_.bytesToString_(from, to)

CL Static

FN Static.static cacheGet_(full)

FN Static.static cacheSet_(full, entry)

FN Static.static serve(urlPrefix, root)

FN Static.static unsafe_(rel)

FN Static.static join_(a, b)

FN Static.static bytesToString_(bytes)

FN Static.static mimeOf_(path)

CL Session

FN Session.static COOKIE_NAME_

FN Session.static cookie(secret)

FN Session.static cookie(secret, opts)

FN Session.static parse_(req, cookieName, secret)

FN Session.static readCookie_(req, name)

FN Session.static sign_(secret, payload)

FN Session.static verify_(secret, signedCookie)

FN Session.static constantTimeEq_(a, b)

CL Csrf

FN Csrf.static TOKEN_BYTES_

FN Csrf.static middleware

FN Csrf.static middlewareWith(opts)

FN Csrf.static isHx_(req)

FN Csrf.static newToken_()

FN Csrf.static field(req)

FN Csrf.static token(req)

CL Flash

FN Flash.static bind(req, ctx)

MOD examples.hello

MOD examples.styled

MOD examples.signup

MOD examples.chat

MOD forms

CL Field

NEW Field.new(name)

GET Field.name

GET Field.trim

GET Field.lowercase

GET Field.uppercase

GET Field.required

GET Field.email

GET Field.url

GET Field.numeric

GET Field.transforms_

GET Field.validators_

FN Field.default_(value)

FN Field.transform(fn)

FN Field.required(msg)

FN Field.email(msg)

FN Field.url(msg)

FN Field.minLength(n)

FN Field.minLength(n, msg)

FN Field.maxLength(n)

FN Field.maxLength(n, msg)

FN Field.numeric(msg)

FN Field.range(lo, hi)

FN Field.range(lo, hi, msg)

FN Field.oneOf(options)

FN Field.oneOf(options, msg)

FN Field.matches(otherName, msg)

FN Field.custom(fn)

FN Field.custom(fn, msg)

FN Field.static trim_(v)

FN Field.static isWhitespace_(c)

FN Field.static toLower_(s)

FN Field.static toUpper_(s)

FN Field.static looksLikeEmail_(s)

FN Field.static looksLikeUrl_(s)

CL FormResult

NEW FormResult.new_(data, errors, rawInput)

GET FormResult.valid

GET FormResult.data

GET FormResult.errors

GET FormResult.rawInput

FN FormResult.errorsFor(name)

FN FormResult.firstError(name)

FN FormResult.hasError(name)

FN FormResult.valueOf(name)

CL Form

NEW Form.new(fields)

GET Form.fields

FN Form.validate(params)

MOD css

CL Tw_

FN Tw_.static spacing_(n)

FN Tw_.static intOf_(s)

FN Tw_.static COLORS_

FN Tw_.static FONT_SIZES_

FN Tw_.static FONT_WEIGHTS_

FN Tw_.static RADII_

FN Tw_.static color_(family, shade)

FN Tw_.static expand(token)

CL Style

NEW Style.new_(base, pseudos, mediaBuckets)

NEW Style.empty_()

GET Style.className

GET Style.css

GET Style.styleTag

GET Style.base_

GET Style.pseudos_

GET Style.media_

GET Style.normalizedForHash_

FN Style.tw(classes)

FN Style.raw(decls)

FN Style.hover(arg)

FN Style.focus(arg)

FN Style.active(arg)

FN Style.disabled(arg)

FN Style.visited(arg)

FN Style.sm(arg)

FN Style.md(arg)

FN Style.lg(arg)

FN Style.xl(arg)

FN Style.baseMerge_(key, value)

FN Style.pseudoMerge_(sel, key, v)

FN Style.mediaMerge_(query, key, v)

FN Style.pseudo_(sel, arg)

FN Style.media_(query, arg)

FN Style.static declsFromArg_(arg)

FN Style.static applyToken_(style, token)

FN Style.static indexOf_(s, ch)

FN Style.static clone_(src)

FN Style.static dumpSorted_(m)

FN Style.static strGt_(a, b)

FN Style.static emitRule_(selector, decls)

CL Stylesheet

NEW Stylesheet.new()

GET Stylesheet.count

GET Stylesheet.emit

GET Stylesheet.styleTag

FN Stylesheet.add(style)

CL Css

FN Css.static empty

FN Css.static tw(classes)

FN Css.static raw(decls)

FN Css.static sheet