Changelog

All versions and downloads Jump to Added | Changed | Fixed | Security

Unreleased [Not released yet]

Part 3 of 15. Previous part

Added (72)

  • Onion lints for an app with scripts = false. They are two more rules (42 in all) and a new lint group, onion. onion-fetch is an error. It finds what the browser loads from another host: src, srcset, poster, <object data>, <link href> (stylesheet, preload, icon, manifest, preconnect), CSS url() and @import (in a .css file, a <style> block and a style attribute) and a src/fonts.txt line with cdn or a URL. A URL that starts with //, http: or https: in any case counts as another host. A relative, data:, hole or <a href> URL, a comment, Markdown code and a component call are not found. onion-form is a warning. It finds a form that posts to another host. The build reads the shell, templates, Markdown pages and the CSS in src and static, so a request pays nothing. Set a level, or the group onion, in [package.metadata.wisp.lint].
  • Browser::scripts(false) of wisp::test turns JavaScript off in the page of a browser test, with the DevTools command Emulation.setScriptExecutionDisabled. scripts(true) turns it on again. The test nojs/tests/browser.rs drives the pages, the forms and the redirects of examples/nojs this way, and the gate runs it where a Chrome or Edge is installed. See In a Browser.
  • wisp build --target extension [--out dist] writes a Chrome extension folder (Manifest V3). It is the static export. Wisp's own files go under wisp/, not _app/, because Chrome refuses a file or folder name that starts with _. Each <a href> to a page becomes <route>/index.html. The build writes no _headers, .nojekyll or 404.html. The app writes manifest.json in its folder. The build copies it and checks that manifest_version is 3 and that each path it names is a file of the output. A route with actions, endpoints or a guard fails the build. An inline script, an on* attribute or a javascript: URL in href, src, action or formaction in a page of the folder fails the build too, because the CSP of Manifest V3 blocks inline code. wisp new --template extension and examples/extension give a popup, an options page and a background worker. The gate step extension loads the folder in Chrome (WISP_CHROME). Checked only on Chrome for Testing 127.0.6533.88. See Browser Extension.
  • A manual start of the release workflow (workflow_dispatch) on a branch runs only the verify job, without the tag steps. The publish jobs run only on a tag ref refs/tags/v*.

Changed (73)

  • Jobs: the docs say what holds on a shared store. A job runs at least once. On a store shared by several servers, two servers can claim and run one job at the same time. Claims can race inside one poll window, or a lease can lapse. Make a job handler safe to run twice (use an idempotency key). Before, the docs said that no two servers run a job at once.
  • WISP_STORE=deno-kv no longer keeps saved tables. Wisp does not check row versions on Deno KV, so it cannot keep ids unique and stop old copies there. The app does not start: it logs wisp: WISP_STORE: the store answered: WISP_STORE=deno-kv cannot keep saved tables: ... and answers each request with a 500. Use d1:BINDING or a libsql:// address. wisp::kv and wisp::blobs on Deno KV do not change.
  • <form guard> in a page fails an edge build (wasm32: Cloudflare, Pages, Deno, Vercel, Netlify, Node and Bun hosts) with the file and line of the form. wisp check --target <host> fails on it too, for every host but lambda. Before, the build passed and each guarded post got a 501 <form guard> needs the native server . The guard uses each token once, and each edge instance keeps its own list of used tokens, so a replay to another instance would go through. The release binary and Docker keep it.
  • <form guard> in a page and <form once> in a page or layout fail the build for each --target host (Cloudflare, Pages, Deno, Vercel, Netlify, Node, Bun and Lambda) and each wasm32 build, with the file and line of the form and the host. wisp check --target <host> fails on them too. Before, an edge build passed, each guarded post got a 501 <form guard> needs the native server , and the edge build ignored once. Lambda kept both. Each form uses each token once, and each instance of the app keeps its own list of used tokens, so a replay to another instance would pass. The release binary and Docker keep both.
  • A WebSocket route fails wisp build --target and wisp check --target for Vercel and Netlify, with one file:line for each route. Before, the build warned, and the route answered 501.
  • wisp check --target <host> shows the warnings of wisp build --target <host> for code that WebAssembly cannot run (std::fs, std::thread, tokio::spawn, reqwest and the like).
  • The h2 feature encodes the head of an answer once, as HPACK, where the handler runs. Before, it copied each header name and value, made a list of references and encoded the head a second time. Instructions per request on one h2c connection: GET / 36863 to 30306, HEAD / 36846 to 29999, a JSON GET 31635 to 26951, POST /tasks (201) 56741 to 51247. HTTP/1 does not change. GET / gave 13418.3 to 13419.4 on base and 13419.3 with the change. Two no-op probe builds of base gave 13418.3 to 13420.4. POST /tasks gave 32663.4 to 32758.6 on base and 32659.1 to 32659.2 with the change. The probes gave 32757.6 to 32850.5. A probe adds, in a cold file, a static or a function that no code calls. The HTTP/1 client sends each request on one keep-alive connection. Method: callgrind on a release build of tests/app with --features h2 in WSL, WISP_THREADS=1, WISP_IO=epoll. A figure is (Ir of 1000 requests - Ir of 1 request) / 999, from 2 runs of the change and 4 runs of base. The runs of base for POST /tasks gave 56741 or 56836. Wisp 755d7a5e6 on 9e46e3e6e.
  • A #[remote(prerender)] input past 2^53, up or down, fails the build with a new error text: "the number is not an integer within +-2^53".
  • The workflow header and the console line of wisp deploy init now read "It reads these secrets and variables: {secrets}." Before, they read "Secrets: {secrets}." The list holds variables too, not only secrets.
  • wisp deploy init with no host names two groups. The first line is Workflow hosts (GitHub Actions): cloudflare-pages, cloudflare, deno, vercel, netlify, lambda, pages (GitHub Pages). The second line is Config hosts: fly, render, railway, cloud-run (config and Dockerfile), docker [--onion], tor [--unix]. Before, one list held all hosts and did not name tor.
  • The agent reference of an app is AGENTS.md and seven topic files in wisp-ref/: content.md, nojs.md, browser.md, members.md, hooks.md, api.md and commands.md. AGENTS.md keeps Files, A page, Actions, Templates, Components, Endpoints and Gotchas, and an index that names each topic file and when to read it. wisp new and wisp update-docs write the topic files. Each one ends with the end line of AGENTS.md, and wisp update-docs keeps the notes below it. It writes no other file of wisp-ref/. It writes a pointer file (CLAUDE.md, .github/copilot-instructions.md, .cursor/rules/wisp.mdc) again only when it holds, byte for byte, the text that an older wisp new wrote. That text calls AGENTS.md the whole reference. wisp upgrade --undo puts the topic files back too. llms-full.txt still holds all of the text, with a marker line before each topic file. wisp mcp gives a section of a topic file the title of that file, for example wisp-ref/hooks.md > hooks.rs. In the repository the topic files are in llms/wisp-ref/.
  • src/tests.rs needs no mod tests; line. The build adds it as #[cfg(test)] mod tests at the crate root, so use crate::App; works in it. When main.rs or lib.rs declares mod tests, the build does not add it again. With wisp::app!() in lib.rs, the library has the tests. A main.rs that also calls wisp::app!() has them too. A mod x; in the added file is src/x.rs, not src/tests/x.rs. So when src/tests.rs declares a mod x; with no #[path] at its top level, the build does not add the module and shows a warning. wisp dev and wisp check show it too. With strict = true it is an error. A folder src/tests/ of fixtures changes nothing. Then declare mod tests; in the crate root. Before, the build compiled a src/tests.rs that the crate root did not declare as a module of the app, also in release builds.
  • On Linux, a page or Body::Bytes body of 16 KiB or more goes in one send with its head: one sendmsg on epoll, one OP_SENDMSG on io_uring. Before, the head and the body went in two sends. On /list of the native-rank app (34092 bytes, loopback, kernel 6.8.12), each response took 1 tcp_sendmsg call and 1 TCP segment, not 2. After a short send, the next send starts at the first byte that did not go. At start, io_uring checks that the kernel lists OP_SENDMSG and sends a test head and body with it. When either fails, the two sends stay, and the stderr line adds , no OP_SENDMSG (<cause>).
  • prefixes of [package.metadata.wisp] takes only a string for each value, as prefix does. A bare value (a = b) is no value. Before, it read as the text b.
  • The Pages warning for static/ names the cause of each entry that reaches the worker: more than 99 entries, or a name over 100 characters. Only the first cause asks for folders.
  • wisp dev always listens on the dev port and sends each request to the app, which listens on a loopback port of its own. A save that compiles starts the new app beside the old one. The front sends new requests to the new app once it answers. Then the old app stops after the requests it has (WISP_DRAIN). Before, a save stopped the app first, and requests during the restart failed. A new app that fails to start leaves the old one, and the terminal says The app of the build before still serves the requests. An app with saved tables opens its data folder only after the old app stopped, and the front holds new requests meanwhile. A held request waits at most 70 s, or WISP_DRAIN and 23 s when that is longer. The front passes Host, Origin and the X-Forwarded-* headers to the app as the client sent them, and names the client in x-wisp-peer with a token of the run. A debug build takes that header only with the token and from a loopback peer, so cx.peer() is the client. For the app, the front no longer adds X-Forwarded-* headers. A request for the app with no body keeps both connections open for the next request when the answer has a length. The front keeps at most 8 idle connections to the app. It keeps one only when no byte and no close wait on it after the end of the answer. Method names are case-sensitive, as in the app: head is not HEAD, so the front reads the body of its answer. Under --https, the front adds x-forwarded-proto: https for a client that is not loopback or that sends a forwarding header. The front serves only a Host that is an IP address, localhost, a *.localhost name or one in WISP_DEV_ORIGIN, else 403 (against DNS rebinding). This holds for the app, its WebSockets and event streams, and each proxy target. Init side effects (timers, wisp::spawn loops, jobs) run in both apps while they overlap, from the start of the new app until the old app stops. After the new app listens, that is up to 10 s for the health check, then WISP_DRAIN and 3 s. Under wisp dev with a HOST other than loopback, the app signs with a key of its own process, not .wisp/secret (WISP_DEV_FRONT). [package.metadata.wisp.dev.proxy] rules apply on the next build, with no restart.
  • In [package.metadata.wisp], scripts, public_env, strict and typecheck take only true or false. A quoted value such as "false" is an error with the same text for each key: Cargo.toml: scripts = "false" in [package.metadata.wisp]: write true or false (true is the default). version_poll takes only a number with no quotes. Before, scripts, public_env and version_poll accepted a quoted value, and strict and typecheck did not.
  • A page of an fs store list can hold fewer than limit keys while more exist, when the scan finds expired keys. Walk until the cursor is None. Before, a page held limit keys when that many live keys existed.
  • wisp lsp shows each parse error of a .wisp file, up to 100, not only the first. The parse continues at the next tag or block tag after an error, and the editor shows each block that is never closed. A later parse error may be a result of an earlier one. wisp build and wisp check still stop at the first error, with the same text. Before, a parse error stopped the parse, so it was the only problem of the file.
  • The server reads /proc/sys/fs/nr_open, /proc/self/cgroup, memory.max and /proc/meminfo at start with one read each. Before, /proc/meminfo took 8 reads and each file took a statx and a second read. The io_uring start proof checks the large request against one 32881-byte pattern. Before, it built a copy of the request and a copy of the response (320 KiB). The proof checks the same bytes. Method: the wisp app of bench/native-rank in WSL2 on 4 CPUs, start to first response. Page faults (perf stat -e page-faults, median of 5 runs, with the taskset that pins the CPUs): 451 before, 377 after. System calls (strace -f, one request): 638 before, 622 after. Cold start (60 alternating pairs): median 2.357 ms before, 2.309 ms after. The new start was faster in 37 pairs. The instructions of a warm request (bench/native-rank/ir.sh, 3 runs) stay the same: 2183.0 for / and 2381.0 for /json (the build of commit a67cafa97).
  • An io_uring worker lends 28 receive buffers at start, not 32. When they run out, it lends a quarter more, at least 16. After the start proof, the server gives free malloc pages back to the system (malloc_trim, glibc only). The native-rank wisp app got 1000 keep-alive requests on /. Its VmRSS went from 4344 kB to 4288 kB (median of 20, 2 workers on CPUs 1-2, WSL 6.8). 256 keep-alive connections of 50 requests each had 0 errors. They had 201 receive rearms, from 193 (a counter in a test build, 2 runs). The work Ir per request does not change: 2183.0 on / and 2389.0 on /json (bench/native-rank/ir.sh, 3 runs, the build of commit 93335e0e6).
  • wisp dev compiles the app crate with -C opt-level=0 -C codegen-units=16 in every build that it runs (the first build and each save) when the profile has opt-level 0 or 1 (the scaffold has 1). A higher opt-level stays as the app sets it. The dependencies keep the profile, and wisp build and a cargo build are not changed. A save of a Rust edit shows in about 0.6 s, from about 1.5 s with the scaffold profile (opt-level = 1). Method: an app from wisp new on Windows (4 CPUs, MSVC), 6 saves that change a function body. The "Rebuilt in" line of wisp dev shows 0.5 s after and 1.5 s before (a poll of / every 10 ms until the new text shows: median 0.6 s after, 1.5 s before). One rustc call takes a median of 303 ms after and 1213 ms before, and the link takes 90 ms and 120 ms of that. The median time of a request to / in the dev server goes from 0.015 ms to 0.027 ms. Before, the app crate used the opt-level of the profile.
  • On the epoll and io_uring drivers, a page body or an owned body (Body::Bytes) of 16 KiB or more goes to the socket after the head with no copy into the write buffer. Only the last response of a read does this. A response before another one in the same read is copied as before. If the socket takes only part of the head on the epoll, the body is copied behind it.
  • The release workflow fails while the elan pin (ELAN_COMMIT, ELAN_SHA256) is not set. Before, it skipped the proofs step. The CI workflow still skips it. The cargo-deny check in the release and scheduled workflows matches the version line exactly. Before, 0.20.2 also matched 0.20.20.
  • The wasm build for Deno and Bun keeps error, redirect and WebSocket answers out of line, as the request-only build did. Deno compiles each wasm function on its first call. A table in memory skips its store check at start, so its code waits for its first use. The first GET / of the bench app compiled 121355 body bytes before, and 108863 after (local Deno 2.9.7 trace, --trace-wasm-compilation-times). Cold start, user instructions (Paris b103, base 7733f3e04): Deno raw 143.00M -> 140.19M (-2.0%), Deno.serve 155.94M -> 153.21M (-1.8%), workerd 116.80M -> 114.83M (-1.7%). Bun and every warm request are flat. Native builds are the same.
  • The type of plain text is text/plain;charset=UTF-8 on every target (native, edge, static), not text/plain; charset=utf-8. This covers Response::text, the built-in error and health answers, robots.txt and .txt files. At load, the bridge checks if new Response(string) has this type (Deno and Node do, Bun does not). Where it does, the bridge sends a plain text 200 with no headers object.
  • cx::decode (query and path parameters) checks UTF-8 without the lossy walk and keeps its decoded buffer, with no second copy. Deno raw /params/42?q=hello%20world&x=1 28.28k -> 27.94k, Deno.serve 40.47k -> 40.14k user instructions per request (Paris b54, 11 reps, disjoint, Wisp a76824924 on b45c83338).
  • Edge builds: Cx::set_cookie_with keeps one body for all value types, not one per type. The gate in the worktree measured tests/edge-full at 804978 bytes on 08b1505ea and 800353 bytes on 30cb4ae0f (-4625). tests/edge-size changed from 376120 to 376233 bytes (+113).
  • A Password in a job or in put_json is stored as its hash. A plain one is hashed when the job is pushed or stored.
  • Rows that Sql::all/first, Kv::get_json and a job read are not checked against #[validate].
  • Edge builds: an app without Response::websocket links no WebSocket handshake code. The wasm of such an app is smaller. The gate in the main checkout measured tests/edge-size at 376385 bytes on 61663dda7 and 370402 bytes on 57403acb5 (-5983). tests/edge-full, an app that uses WebSockets, changed from 801471 to 801498 bytes (+27).
  • Edge builds: an instance keeps the Cx of an answered request and gives it, clean, to the next request. Before, each request made a new Cx on the heap and freed it. A request that starts while the kept Cx is in use gets a new one. The native server does not change. On Deno.serve / (Paris, Wisp 20e72be83 with the edgefull2 patch, median of 11, A/A runs equal), it runs 19.35k user instructions per request, not 19.62k. Raw Deno does not change. The edge-size wasm grows by 3051 bytes.
  • Edge builds: through the fetch handler (serve), the bridge does not read the body of a GET or HEAD request. The app gets these requests with no body. On Deno 2.9.7 and Bun, request.body of a GET with content-length: 5 or a chunked body is null (raw-socket run). So the change does not change what an app gets on these two hosts. The native server still gives a GET body to cx.body(). On Deno.serve / (Paris, Wisp 8cbd05281 on 7e9c4e1d1, median of 11), it runs 290 fewer instructions per request (20.78k to 20.49k). Raw sockets do not change.
  • Edge builds: the header cache of a lazy request is behind one pointer. A request that reads no header makes no cache. A request that reads one uses the cleared cache of the last request.
  • Edge builds: setup runs once per instance, in prepare. It does not run for each request. The setup change alone is inside the spread of the runs. The two changes above together, on Deno.serve / (Paris, Wisp 4f7230291 on 17eff84f0, median of 11), run 340 fewer instructions per request (21.12k to 20.78k). Raw sockets do not change. Native routes do not change.
  • The edge build answers a request to a sync +server.rs arm (App::handle_now) in the call of the host, with no task, as the epoll driver of the native server does. An error page, an arm that waits, a stream, a WebSocket and changes not yet saved go on through the task. An app with a before hook has no such arm. Raw sockets of Node, Bun and Deno answer such an arm the same way. The wasm build leaves out the async shim of such an arm. On / (Paris, Wisp 01c3222cf on 2280dd0a5, median of 11), Deno.serve runs 890 fewer instructions per request (20.51k to 19.62k) and raw sockets run 300 fewer (21.34k to 21.04k).

Next part (4 of 15)

Source: CHANGELOG.md