Unreleased [Not released yet]
Part 4 of 15. Previous part
Changed (73)
- Pure routes on the edge. A sync
+server.rsgetthat takes noCxand no input, on a path with no param, can be pure (App::pure). It is pure when no hook, guard,CACHE,COMPRESS,CORSorTIMEOUTis on it. The bridges that answer through the host'sfetchhandler areDeno.serve,Bun.serve, Workers, Netlify and Vercel Edge. A GET of such a path with no query can send a 200 with only a staticcontent-type. Then these bridges keep the path and host. Later GETs of them run the handler in one call, with no request bytes and noCx. Any other result goes the whole way with that result, so the handler runs once. Other results are another status, a header, an error, a stream or changes not yet saved. An app with no pure route has noApp::pure. A bridge that finds no pure call at startup does not use it. Raw sockets of Node, Bun and Deno do not use it. User instructions per request on/(Paris b86, base 7733f3e04): Deno.serve 19.37k -> 15.91k, Bun.serve 17.54k -> 15.77k, workerd 232.13k -> 205.57k. - Node's
node:httphandler (WISP_NODE_HTTP=1, Vercel's Node function, Firebase) uses pure routes too. The first GET of a path goes as a lazy request, as onDeno.serve. That request can make the path pure. Later GETs of a pure path run the handler in one call. Only a GET with no query, no body header, onehostthat is not empty and each header name once uses this path. Each value must be Latin-1 with no control byte but a tab. All other requests go whole, as before. A whole request hascontent-length: 0, and so has the lazy one. - Edge builds: a task poll uses one kept waker. It does not clone and drop the waker's
Arcfor each poll. A task that keeps a waker still wakes, and the next poll gets a new waker. A poll inside a poll gets its own waker. On Deno.serve/(Paris, median of 21) the change is inside the spread of the runs: no gain is measured. Native routes do not change. - Edge: the parser writes each request into a
Cxon the heap in place. The request path does not copy theCxfrom frame to frame. On Deno.serve/(Paris, Wisp d9d973b0 on 0e25654f, median of 11) it runs 930 fewer instructions per request (22.25k to 21.32k). Deno raw sockets and native routes do not change. - Edge: a bodiless request through
serveof the edge bridge (Deno.serve) goes into itsCxwith no parse when its head has the shape that the bridge writes: a request line and onehostline. Wisp checks the same things as the parser: method, path bytes, host bytes and the 16 KiB head limit. Any other head goes to the parser as before. On Deno.serve/(Paris, Wisp 6d3a874c on d22cadb0, median of 11) it runs 290 fewer instructions per request (21.45k to 21.16k). Raw sockets and native routes do not change. - Edge builds: when a reply has only static headers at the same addresses as the last reply,
senduses the last head and does not compare its bytes. The sent bytes do not change. On Deno.serve/(Paris, Wisp fdbb0af9 on 27803028, median of 11) it runs 550 fewer instructions per request (22.94k to 22.39k). Deno raw sockets do not change. - Edge build: a request uses the request buffers of an answered request. It does not allocate them again. On Deno.serve
/(Paris, Wisp 7a9d0991, median of 11) it runs 160 fewer instructions per request (23.12k to 22.96k). Wisp raw does not change. - Edge builds: the request parser reads a header value eight bytes at a time and skips the scan of 16 bytes. Wasm has no vector compare, so that scan was a loop over each byte. A failed scan of 16 bytes also ran again after each next word. On Deno raw sockets
/(Paris, Wisp c4597060 on 77624185, median of 11) it runs 170 fewer instructions per request (20.70k to 20.53k). Deno.serve and native routes do not change. - Edge builds: a reply with the same head as the reply before it skips the head write and the search in the sent heads. It sends the same head number. A byte-by-byte check of status, flag and headers decides. On Deno.serve
/(Paris, Wisp 3038cd91, median of 11) it runs 390 fewer instructions per request (23.51k to 23.12k). With/and/jsonmixed (Paris, two oha runs at once, same code), the change (-0.21k) is below the run spread (3.9%): not resolved. - The edge wasm keeps
wisp.jsandlive.jsgzipped and unpacks each once, on the first request that sends it. The wasm is smaller, and the served bytes stay the same. - Deno raw sockets: a socket write is a plain promise chain, with no async function and no
catchpromise for each write. - The gate has a
proofsstep. It runslake buildinproofs/, which holds Lean 4 proofs of premises of the request path. With nolake, the step printsproofs: SKIPPED (no lake). Response::with_headertakes a value ofimpl Into<Cow<'static, str>>. A&'static strvalue is not copied, so.with_header("cache-control", "no-store")allocates nothing.Response::headersisVec<(Cow<'static, str>, Cow<'static, str>)>. A borrowed&strthat is not'staticneeds.to_string().- A table keeps its rows in one
Vecin the order of their adds, not in aBTreeMap. An index of ids in sorted chunks of at most 256 finds each row. An add with a new highest id is a push. An add at another id (a random-id table) moves at most one chunk of the index, and never a row. A load sorts the ids once. The edge wasm is smaller. wisp build --target deno: a read on a connection adds one to a counter. The idle check reads the clock, not each read. The idle time starts at the first check that sees the new read or write, not at the read. So a quiet connection can stay open up to one check interval (a quarter of the idle limit) longer than before.- The edge answer keeps the check of a
'staticheader pair, as the native server does. A thread checks such a pair again only when it is not one of its last 4 pairs. wisp openapi: a named action (?/send) is no longer a path key with a query, which OpenAPI 3.1 does not allow. It is an operation in thex-wisp-action-sendfield of the page's path item.fn defaultstays thepostof the page.- The TFB bench runs wrk on 4 CPUs, because 2 CPUs limit it. A cell where the median busy share of the busiest client CPU is 95% or more gets no rank. Actix Web sets its workers to the CPUs it can use, because actix-server 2.2.0 ignores
taskset. The numbers on the site are from a WSL2 VM on a Ryzen 7 7800X3D. - Benchmark validity is per cell.
bench/quiet/summarize.mjswritesvalid_cells,valid_fractionandpublishablein place of the run-levelvalid. A run is publishable when the gates pass, no cell is unclassified and at least 90 % of the cells are valid (PUBLISH_FLOOR). Reports show only valid cells and show each other cell as "noisy, not shown". Before, one noisy cell blocked the whole run. - Release builds send a smaller browser runtime. Its minify step drops each
;before}and joinsletstatements (let a=1,b=2). The meaning of the code stays the same. Gzip bytes (gatejsstep): wisp.js 10_250 to 10_186, live.js 12_539 to 12_457, extra.js 6_291 to 6_242. - The offline queue of
data-wisp-queuemoved from wisp.js to/_app/c/queue.js. wisp.js imports it while online on a page with such a form, and when a page starts with posts that wait. Gzip bytes (gatejsstep): wisp.js 10_180 to 10_178, queue.js 386. After a failed import, the next try asks forqueue.js#1,#2and so on, because a browser may keep the failure for that URL. A static export writes queue.js beside wisp.js. The runtime serves queue.js to every app, also an app withscripts = false. tweened,springandcrossfademoved from extra.js to/_app/c/motion.js, and the browser code oft('key')moved from live.js to/_app/c/i18n.js. Only a module that names one of the three loads motion.js. Only an app withsrc/localesloads i18n.js. Gzip bytes (gatejsstep): live.js 12_457 to 12_324, extra.js 6_242 to 5_305, wisp.js 10_186 to 10_180.versionofimport { version } from 'wisp'is now the id of the build (the same as<meta name="wisp-build">and/_app/version.json, an empty string inwisp dev). Before, it was the[package] version.- The generated Dockerfile builds with
--locked.wisp deploy init dockerstops with a message whenCargo.lockis missing. A missing wasm target error says to runrustup target addin the app folder, for the toolchain inrust-toolchain.toml. - Edge builds (Node, Bun, Deno, Cloudflare): the JSON writer writes a short string (8 bytes or fewer, nothing to escape) one byte at a time, with no
memory.copy./json-biguses 3.0% fewer user instructions a request on Deno and 5.6% fewer on Node (median of 7 reps, VPS). The wasm grows 570 bytes. Native code does not change. - Apps that use
wisp::Tableget a smaller wasm: the edge build has no store poll and notest::freshcode (14,523 B less in a test app with one saved table, 454,715 to 440,192 B, measured on one PC). - Apps that use
wisp::Tablewith more than one row type get a smaller wasm: the check for two saved tables with one name is one shared function for all row types (3,525 B less in the test app, measured on one PC). - A release edge wasm build has no
/_wisp/*dev endpoint. WithWISP_DEV=on, the app's router answers those paths (its own 404 page when no route matches), not a plain 404. The wasm is smaller. beforeNavigate:nav.tois nowURL | null(null forleave).- A template hole that is one
format!(..)call (${format!("Item <{i}> & co")}) writes into the page. It makes noStringfor the value. When the format string holds only text and captures ({name},{name:spec}), the build escapes the text between the captures once. A{name}capture writes as${name}does, so a number takes the integer path. Any other arguments (format!("{}", x)) format into the escaper. The text on the page is the same as before. When aDisplayimpl returnsErr, the page keeps the text written so far. Before,format!panicked. - The gate checks more. The
stestep reads the comments, docs and messages oftests/,examples/,bench/andeditors/too, with a baseline per file that can only fall. Theauditstep fails on two ledger lines for one file. Thestampsstep rejects a<Measured at="newest">block that names a group such asrankand not one suite ofbench/suites.tsv, because the hash binds only exact suite names. The testfast.rsfails in CI (CIis set) whennodeor thewasm32-unknown-unknowntarget is missing, and does not skip. The release workflow publishes the VS Code extension only after the binaries, the crates and the release job passed. The GitHub mirror of the workflows setspermissions: contents: readat the top. - The last line of the reference in the
AGENTS.mdof an app has no semicolon now:<!-- End of the Wisp reference. Notes for this app go below. wisp update-docs keeps them. -->.wisp update-docslooks for this exact line. An app made before this change has the old line, sowisp update-docssays that it finds no end line. Move your notes to another file, deleteAGENTS.md, and runwisp update-docsagain. - The
sitestep of the gate counts a changelog version page without its release body (the<article>element) under the HTML budget. The body has its own ceilings, 29,800 bytes and 11,450 bytes gzipped. They come from the page of1.0.0-pre.3. The pages ofchangelog/unreleased/have the same ceilings. The gate has no exemption for them. cargo run -q -p wisp-gate site --dist <dir>checks a site that is already built in<dir>against the speed budgets. It builds nothing and needs no docs checkout. Without--dist,sitebuilds the reference site as before.- A WebSocket upgrade on
WISP_LISTEN=unix:logswisp: WebSocket on "<path>" refused: WebSockets need a TCP listener, not WISP_LISTEN=unix:. The server still writes the 101 and closes the connection. Before, it closed with no log. - The onion page gives the reason for no
Securecookie on a plain-http onion: Tor Browser treats a.onionaddress as a potentially trustworthy origin, and Wisp did not check which other clients refuse aSecurecookie there. Before, the page said that the browser may refuse it. wisp::env_orpanics on a set value that does not parse only before the app serves (inmainorinit). Afterprepareends, it logswisp: {key} is {v:?}, which is not a {type}once for each key and returns the default. Before, it panicked in a request too.
Fixed (612)
- The 204 of a
corsrule preflight keeps the headers of thebeforehook, the server and theheadersrules. Before, it dropped every header. Now it drops only the headers of the answer that it replaces:allow,location,retry-after,www-authenticate,content-type,content-encoding,content-language,content-length,content-location,content-range,content-disposition,etagandlast-modified. #[validate(len = ..0)]and other ranges that no length fits (5..3,3..3,3..=2) fail the build. Before,len = ..0let an empty value pass. Alen = ..Nwith a constNof 0 now fails every value.- A Markdown page with a
datethat is notYYYY-MM-DDfails the build, as in a content collection. A time can follow. The error shows 40 characters of the value at most. Eachupdatedof/feed.xmlis RFC 3339 (2026-01-02 10:30gives2026-01-02T10:30:00Z), and the feed sorts by it. Before, the feed copied the date as written. - While the app's
entries()runs to make a sitemap or a feed again, the server holds no lock. While one request makes it, the other requests get the old copy and do not wait. They wait only when there is no copy. A make that panics lets the next request make it. - A try that ends after its lease lapsed, and after its server read the claim of another server (
WISP_STORE_POLL), does not change the job and writes a log line. Each claim writes a random token into the job row (claim).Store::savehas no condition, so a late try whose server did not read the other claim yet can still change the job. Before, the failure of the old try set the lease of the new claim to 0, and its success deleted the job that the new claim ran. - A worker tries again at the next renewal (30 s later) when the store fails to renew the lease of a running job. After 2 failures in a row, it writes one log line. Before, one failed renewal stopped the renewals until the job ended, so another server could claim the job when its lease ended (60 s).
- A host trigger (edge, serverless) runs at most as many jobs of a queue as were due at its start. Before, a job that pushed a new job due at once kept the trigger in a loop until the host stopped it.
wisp buildrefuses awisp::cronschedule thatwisp::cronrefuses when the app starts. A schedule takes digits and* , - /only. A day name (MON-FRI) or?givessrc/hooks.rs:3: the schedule "0 9 * * MON-FRI" has characters that wisp::cron does not take. It takes digits and * , - /.A number out of range names its field:src/hooks.rs:3: wisp::cron: "60" is outside 0-59.Both use one rule (wisp_shared::cron::parse). The converters for the hosts no longer read day names or?. Before, the build wrote the trigger of the host, and the app panicked ininit.wisp::cronrefuses a field with a+sign (+5 * * * *). Before, it read+5as 5.- A
wisp::crontask that panics before it returns its future does not stop the schedule, and Wisp writes one log line. This holds for a host trigger (edge, Lambda) too. Withpanic = "abort", the panic stops the process. Before, that panic ended every later run. #[validate(min)]and#[validate(max)]compare au128abovei128::MAXexactly. Before, they compared it as anf64, so 2^127 passedmax = 170141183460469231731687303715884105727(i128::MAX).- The Lambda runtime reads at most 6 MB (6291456 bytes) of an event, the Lambda payload quota of a synchronous request. It answers a longer event with an error to the runtime API:
the event is over Lambda's 6 MB payload. Before, it read the whole event with no limit. wisp::cachedrops an answer that it lets go (replaced, expired, evicted or forgotten byuncacheor a tag) after the unlock. Before, a slowT::dropmade the other calls wait.- The critical CSS of a page stays out when a function name in the sheet has a CSS escape, such as
u\72l(x.png)forurl(x.png). Before, such a relative address could go into the page, where it means another file. WISP_SECRETandWISP_SECRET_OLDmust have at least 32 characters, and the error counts characters:WISP_SECRET is 5 characters, too short to keep signed cookies safe. Before, Wisp counted bytes, so 16 characters of 2 bytes each passed.- The gate step
sitecounts the HTML of a page with a fixed build id in<meta name="wisp-build">. Before, a new id of a changed build could change the count with no change to the page. - Saved tables on the edge (
WISP_STORE=d1:BINDINGor alibsql://address) lost data when several instances (Cloudflare isolates) ran at once. Two instances gave the same id, and the second row replaced the first. An instance did not see a row that another instance added, so a redirect to it got a 404. An instance wrote its old copy of a row over a newer one, or back after a delete. Now the store keeps a version for each row. Before the handler of a request runs, the instance reads the rows that changed. That is 1 query, only in an app with a saved table. Wisp's own files and the app's static files skip it. Each instance takes its ids from its own block of 16. So ids are unique and grow in one instance, but are not in time order across instances. A client that pages a REST list forward withafterdoes not see a row that another instance adds below that id. The changes of a request go to the store after the handler, in one batch, all or none. The response waits for it. The changes of awisp::spawntask or ofinitgo to the store each time the task waits, so they are not all or none. So do the changes of a WebSocket (of a request or a connection), and a WebSocket gets no 409. A request that the client cancels still saves the changes that it made before the cancel. Two requests of one instance share a batch only when they change the same row. When another instance changed one of those rows first, the request gets a 409 and none of its changes stays. Effects outside the store (an email, afetch) are the job of the app. A batch that fails for another reason gives a 500 and no longer stops the instance. The instance reads those rows again. When the store cannot be read before the handler, the request gets a 503. A call of the store that gets no answer in 30 s fails: a read gives a 503 and a write a 500. The instance then reads those rows again, and that read can also take 30 s. So the 500 can come after 60 s. Each 500 of a batch now saysThe store may not have saved the changes.A change of awisp::spawntask, ofinitor of a WebSocket that starts from a failed change fails alone, with a log line. The other changes of its batch go. A request stays all or none. A row that the instance read again no longer replaces a newer copy of it. Before, a late read could give the next change of the row a 409. When the store answers a write with no version, the log shows what it sent. A database of 1.0.0-pre.3 gets the new columns at the first start, with all its rows. In one instance, a request can keep a copy of a row across an.await. It can then write over a change of the same instance (seedocs/known-issues.md). The tests are intests/app/tests/store_race.mjs. - A post to
?/<name>with no such action, on a page whose forms post only to form commands (#[remote]), gets a 404No action named<name>on this page, as on other pages. Before, it got a 405. - An
import { ... } from 'wisp'of a name thatwispdoes not export (such asonMount, a helper that a<script>of a .wisp file has with no import) fails the build at the line of the import, in a script of a .wisp file and in a file ofsrc/lib. Before, the browser stopped at the import with "does not provide an export named" and ran none of the module.