Changelog
What changed in Tifa that apps and their users can see. From v0.0.1 on, changes are grouped by release. Older changes are grouped by the date they reached main. The format follows Keep a Changelog. Performance has how each speedup was measured. An entry that apps must act on ends its bullet with the word Upgrading, a colon and the steps, which go tool tifa upgrade prints.
[Unreleased]
[0.5.2] - 2026-11-25
Changed
- The docs index in the Tifa block of AGENTS.md now shows the whole summary of each doc, with the names, settings and commands it covers, so a coding agent can tell which doc answers its question.
Fixed
tifa devon Windows no longer fails a rebuild when another program holds an old copy of the app open. When the app does not answer in time, the log now says what the last check saw and whether the app process still ran.
[0.5.1] - 2026-11-24
Added
- An app from
tifa newcan back up its database to Cloudflare R2, AWS S3 or another S3 store: set the optiondb.backup(DB_BACKUP,--db-backup) to the URL of the store, andAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYin the environment or.env. Every commit is in the store about a second later, and a start that finds no database file restores it from there, as on a new machine. Empty, the default, backs up nothing. An app made earlier can add the code from Back it up.
Changed
- Back it up in the database guide is now a how-to for the backup to R2: making the bucket and its token, setting the keys on the server with
tifa deploy env set, moving to a new machine, undoing a bad deploy by going back to the second before it, and what it costs on R2.VACUUM INTOstays for a one-off copy. The driver says how it answersdatabase is locked, write speed and losing the machine.
[0.5.0] - 2026-11-24
Added
- The managed block of
AGENTS.mdthattifa newandtifa agentswrite ends with an index of the docs for apps of the Tifa version in use: one line per doc with its path and the first clause of its summary, grouped by section folder, and where the folder is. A coding agent sees which doc to open without runninggo tool tifa docsfirst.go tool tifa upgradeandgo tool tifa agentswrite it.
Changed
-
The managed block of
AGENTS.mdis about a third shorter, index included: it keeps the conventions, the commands, the build rules ofLoadand the test helpers in short form, and leaves the details (the table of returned errors, the hooks, the flags oftifa devandtifa errors) to the docs it names. It no longer says thattifa devmisses a change toschema.sql, which it rebuilds on since it watches embedded files. -
tifa devandtifa buildno longer compile plain stylesheets (a.cssfile imported for its side effect) for the server render, which has no use for CSS. Tailwind and Vite's CSS step now run for the browser only. A save of a.tsor.tsxfile inexamples/shoptakes about 2.1 s for the bundle step instead of 2.4 s (median of 12 saves each, on an Apple M4).dist/ssr.jsand its map are byte for byte the same. A stylesheet that does not compile still fails the bundle step..tifa/dist/inputs.jsonlists fewer files undertifa dev: not the files a stylesheet imports nor the ones Tailwind scans. -
With
deploy.front: none,tifa deploymakes the app serve visitors itself instead of listening on127.0.0.1only, where nothing outside the server reached it. With a domain as the host ofsite.url, systemd opens ports 443 and 80 for the app and the app runs its built-in HTTPS with a certificate from Let's Encrypt, kept in/srv/tifa/<app>/certs. Without a domain (nosite.url, an IP address orlocalhost) it serves plain HTTP on port 80. Setup setsnet.ipv4.ip_unprivileged_port_start = 80once per server as root so the app needs no root, stops before changing anything when another app or a program such as nginx or Caddy listens on those ports, and says which ports the firewall must let in. When ufw is on and blocks them, the plan of setup allows them as root, once you agree or with--yes, in rules with the commenttifa <app>(ufw allow 80/tcp comment 'tifa <app>').tifa deploy remove, and setup once the app no longer serves visitors on a port, deletes only the rules with that comment, and no other rule, the one of ssh among them. Tifa does not change the firewall or the security groups of your provider. After a deploy it printsvisitors: <url>and whether the ports answered from your machine. See The app serves visitors itself.Upgrading: the next
go tool tifa deploy setupmoves an app withfront: nonefrom the loopback to ports 80 and 443. If your own proxy (Caddy, nginx) holds those ports in front of it, setup stops and names it: stop the proxy and keep it from starting at boot, or setdeploy.front: cloudflare. With several apps offront: noneon one server, only one can move, and the others needfront: cloudflare. When ufw is on, the plan of setup opens ports 80 and 443 (or 80 without a domain) there. Open them in the firewall or security group of your provider if it blocks them.
Fixed
- The
db.gothattifa newwrites opens SQLite with_txlock=immediate, so a transaction takes the write lock atBEGINand waits its turn there, instead of failing withdatabase is lockedwhen another request writes between its first read and its first write. A transaction that only reads should start withsql.TxOptions{ReadOnly: true}. An app made earlier can add&_txlock=immediateto the address in itsdb.go. See When a write getsdatabase is locked. - On Windows, a rebuild of
tifa devright after the app started could fail with "rename ... bin\tifa-dev.exe ...: The process cannot access the file because it is being used by another process" while another program, such as a virus scanner, read the new program.tifa devnow waits up to 2 seconds for it, as the go command does.
[0.4.2] - 2026-11-24
Added
- A guide to logs, Logs: where the logs of an app are in
tifa dev, on a server and in a container, what Tifa itself logs, how to log from your code withlog/slog, how to set the format and the level, and a request log made withtifa.SetHTTPHandler.
Changed
- Server rendering runs on beastjs v0.33.0, the engine that was named slowjs. The engine is the same, and only its module path and names changed.
[0.4.1] - 2026-11-23
Added
- The docs for writing an app now have a Chinese version beside each English file (
docs/guides/forms.zh-CN.mdbesidedocs/guides/forms.md), shipped in the module.go tool tifa docs --lang zh-CNlists them with their Chinese summaries. Without--langthe English docs are listed, and the language is never chosen for you.
Changed
- The docs of Tifa are grouped in folders by what they are for:
docs/start/,docs/pages-and-data/,docs/guides/,docs/build-and-deploy/anddocs/reference/for writing and running an app, anddocs/internals/for developing Tifa.go tool tifa docsprints the new paths, such asdocs/start/app.mdwhere it printeddocs/app.md. Upgrading: rungo tool tifa agentsso the notes and the skill of your app name the new paths.
[0.4.0] - 2026-11-23
Changed
- Breaking: a key in
tifa.yamlthat is not a setting of Tifa now failstifa check,build,devand the deploy commands at its line, such astifa.yaml line 3: deploy.ssh is not a setting of tifa.yaml, withdid you meanwhen a name is close, the settings of its section, and where the options of an app go. Before, such a key was ignored without a word, so a leftoverdeploy.ssh: cloudflaredeployed asdirect.tifa.yamlholds only the settings of Tifa, and the options of an app, also in a section of Tifa such asserver.name, go in a flag, an environment variable,.envor the file of-c.-cfiles,.envand the environment are not checked. Upgrading: delete the keys that are not settings of Tifa fromtifa.yaml, and move the options of your app to.env, the environment or a flag.
Removed
- Everything that only carried an app or a repository from an older Tifa to this one. Tifa has no users on older versions to carry.
tifa deploy setupno longer recognises the secrets and the variable of earlier setups (DEPLOY_SSH_KEY,DEPLOY_KNOWN_HOSTS,DEPLOY_HOST,CF_ZONE_ID,CF_CACHE_PURGE_TOKEN,CF_PURGE_TOKEN,CF_ACCESS_CLIENT_ID,CF_ACCESS_CLIENT_SECRET,TS_OAUTH_CLIENT_ID,TS_OAUTH_SECRETand the variableTIFA_DEPLOY), the OAuth client of Tailscale (TIFA_DEPLOY_TAILSCALE_CLIENT_IDandTIFA_DEPLOY_TAILSCALE_SECRET), the purge token and zone ID kept as repository secrets by v0.1.18, and the ssh host name made from the domain alone. The workflow it writes no longer hands a purge token to Tifa, and no longer has an OAuth form for Tailscale.tifa deployno longer stops onDEPLOY_HOST,CF_CACHE_PURGE_TOKENorCF_ZONE_IDin.env, and no longer says what to write fordeploy.host,deploy.ssh,deploy.ci,deploy.github,deploy.domainordeploy.cdn. The program and the build no longer warn aboutcache.size,cache.whole_page,cache.ignore_queryandcache_control.s_maxage, and--cache-sizeand the other flags of those settings are gone. The build no longer has special messages for ahooks.ts, aroute.tsx, aconfig.gothat holds options,LayoutSSR,RenderCache,BodyLimitandReadTimeoutconstants inroute.go, or anhtmlAttributesexport of the root Layout. Upgrading: an app on an older Tifa editstifa.yamlto the current keys and runsgo tool tifa deploy setupagain, see Deploy. The names and the files above are no longer checked. A left over key intifa.yamlfails as an unknown setting (see the entry under Changed), and a left over environment variable or.envline is ignored.
[0.3.0] - 2026-11-23
Added
deploy.auto.branchanddeploy.auto.needschoose what deploys from GitHub Actions.branchis the branch whose pushes deploy, and left out it is the default branch of the repository as before.needsis the file in.github/workflowsthat must pass first, and left out it isci.yml.needs: nonedeploys every push to the branch without waiting.tifa deploy setupreads the file: it must exist, have aname:line (GitHub'sworkflow_runfinds a workflow by its name) and run on a push to the branch (on:as a word, a list or a mapping, with thebranchesandbranches-ignorefilters of GitHub). Otherwise the plan lists it as something for you and setup exits with an error that says to fix the file, changeneedsor writeneeds: none. GitHub starts a workflow that waits for another only from the file on the default branch, so with anotherbranchthe plan says to commit the workflow to the default branch. The deploy job also checks that the workflow run it follows came from the file inneeds, since two workflows can share a name. The subject of the Tailscale identity that setup prints now has the ref the deploy job runs with: the default branch afterneedspassed, andbranchwithneeds: none. It prints both forms of the subject, the one with the owner and repository IDs that GitHub sends for repositories made after July 15, 2026, and says how to see which one is sent. An identity whose audience variable is missing or is not the one of the client ID is made right from the client ID in the repository, and anydeploy.auto.*key, written dotted or in a block, turnsdeploy.autoon.- CI joins the tailnet with Tailscale workload identity federation instead of an OAuth client secret. The workflow of
connect: tailscalehasid-token: writeand passesoauth-client-idandaudiencefrom the repository variablesTIFA_DEPLOY_TAILSCALE_IDandTIFA_DEPLOY_TAILSCALE_AUDIENCE, which are not secret. In the Tailscale console, make a credential with the GitHub issuer, the subject setup prints and the scopeauth_keysfortag:ci, then rungo tool tifa deploy setup --tailscale-client-id <client ID>(on a terminal, setup asks for it). Upgrading: a workflow written by v0.2.x keeps working with its OAuth secrets until you do that. Make the credential, run setup with its client ID, commit and push the new workflow, then run setup again: it removes the secretsTIFA_DEPLOY_TAILSCALE_CLIENT_IDandTIFA_DEPLOY_TAILSCALE_SECRETonce the workflow on the default branch no longer uses them. Delete the OAuth client in the Tailscale console yourself.
Removed
tifa deploy setup --tailscale-oauthand the page that took an OAuth client secret. The Tailscale identity of CI has no secret: use--tailscale-client-id <client ID>. Upgrading: replace the flag as the entry above says.
Changed
- Breaking:
deploy.sshis nowdeploy.connect, with the same valuesdirect,cloudflareandtailscaleand the same meaning: the one path ssh takes to the server, from your machine and from the runner.deploy.sshintifa.yamlstopstifa check,build,devand everytifa deploycommand at its line withdeploy.ssh is now deploy.connect: write connect: <the value>. Upgrading: in thedeploysection oftifa.yaml, changessh:toconnect:. - Breaking:
deploy.ciis replaced by the blockdeploy.auto. The block being there turns deploys from GitHub Actions on,auto: {}takes the defaults, andauto:with nothing after it, or a key other thanbranchandneeds, is an error.deploy.ciintifa.yamlstops the same commands withdeploy.ci is now the block deploy.auto: replace ci: github with auto: {}. A repository withci: githuband noci.ymlused to deploy on every push: it now needsci.ymlwith aname:orneeds: none. Upgrading: replaceci: githubwithauto: {}, and deleteci: none. If the app has no.github/workflows/ci.yml, or yours has another file name, writeauto:withneeds: <file>(orneeds: none) under it. tifa checkandtifa buildnow run the deploy checks that need no network, andtifa devshows the same problems as warnings and keeps running, once at the start and again whentifa.yamlor a workflow file changes. They stop on settings that cannot work together (connect: tailscalewithoutauto,connect: cloudflarewithoutfront: cloudflare,front: cloudflarewithoutsite.url), and withautoon, on aneedsfile that is missing, has noname:or does not run on a push (to the branch, whenauto.branchis written: the default branch is known to GitHub only, so setup matches that). The messages are the onestifa deploygives. Atifa.yamlthat does not parse,deploy.sshanddeploy.cistay errors everywhere. An emptyneeds:orbranch:says what to write.- The
tifa.yamlthattifa newwrites showsconnect: directand the blockautowithbranchandneeds, commented out.
[0.2.2] - 2026-11-23
Added
tifa deploy setupremembers the servers it sets up in~/.tifa/config.yaml(TIFA_HOMEmoves the folder, and the file holds no secret): the server's host name and machine ID, the host a new app uses, and the apps, each by the folder of its checkout with the host that worked for it (withssh: cloudflare, the ssh host name of its domain once the tunnel check passed). An app that names no server through--host,TIFA_DEPLOY_HOSTor.envnow uses the only server in the file, or the one that lists its folder, andtifa deployprints one line that says which and what to put in.envto name another. With several servers and no way to tell, it stops, lists them and says to setTIFA_DEPLOY_HOST=<host>in.envor pass--host. A host taken from the file is checked against the machine ID the server reports in the command's first probe, and a mismatch stops the command.tifa deploy removetakes the app off the file once it finished with nothing left for you. A second app on the same machine needs noTIFA_DEPLOY_HOSTany more. GitHub Actions never reads the file.deploy.ssh: cloudflarenow takes your own machine through the Cloudflare Tunnel too, so the server needs no open ssh port for anyone.tifa deploy setupadds the email of your cf login to a policy of the Access application it made for the ssh host name (a second person's setup adds theirs next to it), installs cloudflared when it is missing (brew install cloudflaredon macOS,winget install --id Cloudflare.cloudflared -eon Windows, a link elsewhere), writes a marked block at the top of~/.ssh/config, checks thatssh tifa@<ssh host>works (the first time cloudflared opens the Cloudflare Access login in your browser and waits for you, up to 4 minutes), and then movesTIFA_DEPLOY_HOSTto the ssh host.tifa deploy removetakes the policy and the block away. Tifa does not change the firewall of the server: close its ssh port yourself once a deploy through the tunnel worked. Setup makes the Access application and a policy before it publishes the route and record of the ssh host name, and publishes nothing when no policy can be made. Upgrading: nothing is required. An app already set up withssh: cloudflareandci: githubkeeps its Access application and token, and the nextgo tool tifa deploy setupadds the items for your machine.
Changed
- When the check of ssh through the tunnel at the end of
tifa deploy setupfails, it says the key must be in/srv/tifa/.ssh/authorized_keysonly if ssh got to authentication (Permission denied). Any other failure shows the output and does not blame the key. - The commented
deploy.sshline of thetifa.yamlthattifa newwrites says ssh through Cloudflare covers CI and this machine. deploy.ssh: cloudflareno longer needsdeploy.ci: github. The ssh host name, its route, its DNS record and its Access application are made without CI.deploy.ssh: tailscalestill needs it.tifa deploy setupwrites one line of the.envof the app:TIFA_DEPLOY_HOSTbecomes the ssh host name once ssh through the tunnel works, and only when the value was read from.env. When it comes from the environment or--host, setup says what to set and changes nothing.
[0.2.1] - 2026-11-23
Changed
- The build errors for the removed
LayoutSSR,BodyLimitandReadTimeoutsay more of what to write. The one forLayoutSSRlists theroute.goof each page the Layout wraps. The example forBodyLimitandReadTimeoutpasses the app's own value, such asc.SetBodyLimit(4 << 20), where it showed a made-up one, and the exact number when the value names a constant of the package.
[0.2.0] - 2026-11-23
Changed
hooks.tsat the app root is nowsetup.ts, plain top-level code with no function to export. Both entries import it before the routes, so its top level runs once per JavaScript runtime, in each VM of the server and in the browser, before any route module evaluates, and a route module that reads at its own top level whatsetup.tsset sees it. Whatsetup.tsexports is ignored. TheonStartparameter ofserveandhydratein the runtime is gone. Ahooks.tsat the root fails the build withhooks.ts is now setup.ts: rename it and move the body of onStart to the top level of the file.tifa devpicks up an edit ofsetup.tsas it did one ofhooks.ts. Upgrading: renamehooks.tstosetup.ts, delete the lineexport function onStart() {and its closing}, and move the body of the function to the top level of the file. If the body returns early, keep it as a local function and call it once at the top level.LayoutSSRis gone fromroute.go. A Layout has no switch of its own now, and every page renders on the server unless its ownroute.gosaysSSR = false. A URL that matches no page and shows its 404 inside a Layout always renders on the server. DeclaringLayoutSSRfails the build withLayoutSSR is gone: delete it. If it was false, write const SSR = false in the route.go of each page this Layout wraps.tifa routesno longer prints an SSR column for Layouts. Upgrading: delete theLayoutSSRconstant. If it wasfalse, writeconst SSR = falsein theroute.goof each page the Layout wraps (a page with noroute.goneeds one).- The route constants
BodyLimitandReadTimeoutare gone fromroute.go. An app sets them for one request inOnRequestwithc.SetBodyLimitandc.SetReadTimeout, before anything reads the body, and matchesc.Pattern()and the method. Declaring either as a constant or a variable inroute.gofails the build withBodyLimit is gone: set it in OnRequest with c.SetBodyLimit for this route(and the same withReadTimeoutandc.SetReadTimeout), followed by an example for that route. A type namedBodyLimitorReadTimeoutstays allowed.c.SetReadTimeoutandc.SetBodyLimitare the only way now: the 0.1.20 entry that says the constants keep working no longer holds. The misspelling check keeps onlySSR,CacheandMemoas names a typo can be of. Upgrading: deleteBodyLimitandReadTimeoutfrom eachroute.goand add the calls toOnRequestinhooks.go:if c.Pattern() == "/photos" && c.Request().Method == http.MethodPost { if err := c.SetBodyLimit(20 << 20); err != nil { return err }; if err := c.SetReadTimeout(5 * time.Minute); err != nil { return err } }. A variable that came from an option of the app works as the argument (c.SetBodyLimit(int64(UploadLimit))). - The
htmlAttributesof the root Layout are now a key of itsdocumentHead, in the same shape as the return of a route'shead:export const documentHead = { htmlAttributes: { lang: 'zh-CN' }, meta: [...], links: [...] }. The default stays{ lang: 'en' }, and the merge is the same: the root gives the attributes every page starts from, and a route'sheadoverrides one attribute at a time. The check that a site with languages sets nolangreadsdocumentHead.htmlAttributesnow, intifa check,tifa buildandtifa dev. A separateexport const htmlAttributesinapp/layout.tsxfails the build withapp/layout.tsx: htmlAttributes is now a key of documentHead: move it into export const documentHead = { htmlAttributes: {...}, ... }. Upgrading: inapp/layout.tsx, deleteexport const htmlAttributes = {...}and write the object as thehtmlAttributeskey ofdocumentHead, which you add with only that key when the app has none.
[0.1.20] - 2026-11-23
Added
- A page with a canonical link also gets
<meta property="og:url">with the same URL, in the server render and after a navigation in the browser. Anog:urlin a route'sheador indocumentHeadwins, and the page has only that one. - A share image written as a path in a
head(og:image,og:image:url,og:image:secure_url,twitter:imagewith a content that starts with one/) getssite.urlin front of it, in the server render and after a navigation, since crawlers need a full URL. A full URL or one that starts with//is kept, and withoutsite.urlnothing changes. tifa check,tifa buildandtifa devwarn about a<title>or<meta>written as JSX in a component, with its file and line, and point to theheadexport. Tifa writes the head as a string and React renders only the app root in<body>, so such a tag ended up in<body>, where crawlers do not read it. A<title>inside an<svg>and a<meta itemProp>are not reported.c.SetReadTimeout(d)gives the body of one requestdto arrive, as theReadTimeoutof a route does, and the answerserver.write_timeoutafter it. Call it inOnRequestnext toc.SetBodyLimit. The constantsBodyLimitandReadTimeoutkeep working in this release, andOnRequestis the way to write them now.
Changed
- A constant in
route.gothat is a typo of a switch, such asCahceforCacheorReadTimoutforReadTimeout, fails the build withCahce is not a switch: did you mean Cache?. Before, it was ignored without a word. Only exported constants with at least three letters and a type the switch takes count, within one edit of a switch name when the shorter name has four letters or fewer, and within two edits above that.
[0.1.19] - 2026-11-23
Added
- Apps build for and run on windows/arm64, with slowjs v0.31.12. The CI tests Tifa on a Windows arm64 runner too.
- A secret can come in without a terminal, as when a coding agent runs the command, on a page in your browser.
tifa deploy env setuses it when its standard input is not a terminal, a pipe or a file, such as the/dev/nullagents give.tifa deploy setup --cache-purge-tokenand--tailscale-oauthuse it without a terminal, with--yestoo, and setup without them lists the token with that command. Tifa serves the page on 127.0.0.1 at a one-time URL, opens it and prints the URL, takes one value and closes, or stops after 10 minutes. The value never passes through the agent. Before, these flags needed a terminal, andenv setread an empty value from/dev/null.
Changed
tifa devhas a page ready sooner after some saves. A save of a plain.cssfile (not a.module.css) only compiles the stylesheets again when every stylesheet the pages import is plain: on the shop the page is ready 0.19 s after a save ofapp/styles.css, was 2.67 s. A save that leavesssr.jsand its map the same bytes, such as an edit of a comment, keeps the VMs: 2.18 s, was 2.54 s. The checks of exports,htmlLangand foreign imports read again only the files that changed, a few tens of milliseconds on each save. Medians of 10 saves on an Apple M4. What dev serves is the same.- With
front: cloudflare,tifa deploy setupkeeps the Cloudflare token that clears the CDN cache on your server, in/srv/tifa/.config/tifa/cloudflare-purgewith the zone ID, readable only by the usertifa, and no longer as secrets of the repository.tifa deployandrollback, from CI or from any machine that may log in astifa, read it there over ssh and clear the cache, so a deploy from a machine without a cf login clears it too. One token serves every app of the server on that zone: a second app needs nothing. Setup now asks for it withoutci: githubtoo, and--cache-purge-tokenworks without CI.TIFA_DEPLOY_CF_PURGE_TOKENandTIFA_DEPLOY_CF_ZONE_IDin the environment or.envstill work and win over the server. The workflow setup writes no longer passes them, andtifa deploy removeof the last app on the server deletes the file. A workflow written by v0.1.18 keeps clearing the cache, so nothing needs to change. To keep the token only on the server and remove the two repository secretsTIFA_DEPLOY_CF_PURGE_TOKENandTIFA_DEPLOY_CF_ZONE_ID, rungo tool tifa deploy setupon a terminal, paste the token when it asks, commit and push the workflow it writes, and run setup again: it removes the secrets once the workflow on the default branch no longer uses them.
[0.1.18] - 2026-11-23
Added
- A Markdown heading can carry its own id at the end:
## 图片和链接 {#images-and-links}gives the headingid="images-and-links"and takes the{#...}and the space before it out of the text.Headings()returns that id and the shorter text, so a translated heading can keep the id of the original and links between languages and the table of contents keep working. The id has letters, digits,-,_,.and:, and only a{#id}at the very end counts. Headings without one get their GitHub id after these, so an automatic id that would repeat a written one gets-1. tifa deploy setupinstalls and logs in cf and gh whentifa.yamlneeds them and they are missing: cf forfront: cloudflarewithpnpm add --global cf, gh forci: githubwithoutTIFA_DEPLOY_GITHUB_TOKENwithbrew install ghon macOS orwinget install --id GitHub.cli -eon Windows. Installing and logging in are items of a first plan, the y you type to it is the consent, and each login opens a browser on your terminal. Setup then plans the Cloudflare and GitHub parts and asks again. It installs only with a package manager the machine has, never downloads a program itself, and never installs or logs in with--yesor without a terminal: then, or on Linux, it lists the commands for you. An install or login that fails is a warning that says how to do it by hand, and setup goes on with the rest.
Changed
tifa deploycommands now stop when the.envof the app sets aTIFA_DEPLOY_name that Tifa does not read, such asTIFA_DEPLOY_CF_CACHE_PURGE_TOKEN, and name the closest one. They used to ignore the line without a word.tifa buildandtifa devspend about 0.4 to 0.5 s less in the plugin's rewrites of the SSR bundle, whichtifa devruns after every save: on the shop, the bundle step after an edit takes 2.3 s in place of 2.9 s. The bundle is the same byte for byte.tifa deploy setupandtifa deploy removenow saycf is not installed: pnpm add --global cf, then cf auth loginwhen cf is not on the PATH. They used to ask forcf auth login, which fails with "command not found" when cf is missing. With cf installed but not logged in, the message is the same as before.
Fixed
- On Windows, a page request right after a save could get the page without that save:
tifa devwaits for the watcher to see every save made before the request, but Windows could report the save after the event the wait ended on. - On Windows,
tifa devcould stop with "The process cannot access the file because it is being used by another process" when an editor saved a file by renaming a new one over it whiletifa devwas reading it.
[0.1.17] - 2026-11-22
Added
tifa newwrites a.gitattributeswith* text=auto eol=lf, so git keeps LF line ends on every system. git on Windows checks files out with CRLF by default, and the program embeds some of them, such asschema.sqland the hashes of the files in.tifa/dist/inputs.json, so a program built there differed from one built elsewhere from the same commit. An app made before can add the same file.
Fixed
tifa deploy setupno longer plans to write.github/workflows/tifa-deploy.ymlagain on every run when git checked the file out with CRLF line ends, as git on Windows does in an app without a.gitattributes. A file that differs only in its line ends counts as right.
[0.1.16] - 2026-11-22
Added
tifa devruns on Windows (10 1809 and later, tested on Windows Server 2022 and 2025), in the foreground and with--background,dev status,dev logs,dev stopandtifa errors. Ctrl-C, closing the console window andtifa dev stopstop it, the app runsOnShutdownon each restart as on Linux and macOS, and atifa devkilled in the Task Manager takes Node, Vite and the app with it. On Windows lists what differs there.
Fixed
- On Windows a second
tifa buildin an app that is building already now stops with an error, as on Linux and macOS. The lock of the app did nothing there.
[0.1.15] - 2026-11-22
Added
tifa new,tifa checkandtifa buildrun on Windows (10 1809 and later, tested on Windows Server 2022 and 2025).tifa buildwritesbin\<name>.exethere, since Windows runs only files that end in.exe. A build for another system, such asGOOS=linuxfor a server, writes the bare name as before, and-ois used as given.tifa devdoes not run on Windows yet.
Changed
tifa buildandtifa deployno longer print Rolldown's PLUGIN_TIMINGS lists, and Vite's chunk size warning starts at 1000 kB for the browser bundle (it was 500 kB, which an app with a UI library passes with the one entry file Tifa makes). The app's ownbuild.chunkSizeWarningLimitandbuild.rolldownOptions.checksstill win.
Fixed
- Under
tifa dev,import.meta.env.BASE_URLis/, as in a build. It was the prefix of Vite's modules, so a library that builds URLs of the app from it, such as the search of fumadocs-ui, asked a path that does not exist. The URLs of Vite's own modules and the HMR client keep their prefix, and the server render still reads the same value as the browser. - The icon cache of lucide-react works again with lucide-react 1.75 and later. Every build and
tifa devwarnedtifa rewrite not recognizedfor it, because 1.75 rewrotemergeClassesandhasA11yProp, and icons rendered without the cache. The pages render the same. tifa deploy setupsays what it does not know yet in its plan. The ssh host name for CI shows asdeploy-ssh-<random>.example.com, since each run draws a new random part and the line that reports the step shows the name it made. A server without the user tifa shows "the user tifa does not exist yet" and no longer prints ssh'sPermission denied (publickey). The tunnel shows astifa-<machine id>until the server is read.- In
/llms.txt, the Markdown version of a page and/llms-full.txt, a home page with noTitlein itsSitemapPageis named after the site (Sitemap.Name, else the host ofsite.url) and no longer shows as[/]. Other pages without a title still show their path. - Server rendering runs on slowjs v0.31.11. The render timeout, the stop on shutdown and the memory limit now also hold inside
Intlon very long inputs: case mapping for Turkish, Azerbaijani, Lithuanian and Greek, locale tags with many variants,Intl.Segmenteron long Chinese or Japanese text,Intl.ListFormatwith many items andIntl.Collatoron long strings that share a start. The HTML of a render is the same, and its instructions are within 0.24% of v0.31.10. - A built program sends
.jsfiles astext/javascripton every system. Go took the type from the Windows registry or from/etc/mime.typeswhen the machine had one, and a wrong entry there changed the type the browser was sent.
[0.1.14] - 2026-11-22
Changed
- Every name
tifa deployreads or sets starts withTIFA_DEPLOY_. The inputs areTIFA_DEPLOY_HOST,TIFA_DEPLOY_CF_PURGE_TOKENandTIFA_DEPLOY_CF_ZONE_ID. The secrets of the workflow areTIFA_DEPLOY_HOST,TIFA_DEPLOY_SSH_KEY,TIFA_DEPLOY_KNOWN_HOSTS,TIFA_DEPLOY_CF_ZONE_ID,TIFA_DEPLOY_CF_PURGE_TOKEN,TIFA_DEPLOY_CF_ACCESS_ID,TIFA_DEPLOY_CF_ACCESS_SECRET,TIFA_DEPLOY_TAILSCALE_CLIENT_IDandTIFA_DEPLOY_TAILSCALE_SECRET, and the marker variable isTIFA_DEPLOY_FINGERPRINT. Names that cloudflared and the Tailscale action fix stay. An old input name (DEPLOY_HOST,CF_CACHE_PURGE_TOKEN,CF_ZONE_ID) in.env, with the new name missing, stops everytifa deploycommand with an error that names the new one. In the environment the old names are left alone, since other tools use them. Setup finds the old secrets by the old marker variableTIFA_DEPLOY, sets the new ones, and plans to remove the old secrets and the old variable after that.ci: noneandtifa deploy removetake them away too. GitHub does not show a secret, so the purge token and the Tailscale OAuth client are pasted again. Upgrading: renameDEPLOY_HOSTtoTIFA_DEPLOY_HOSTin.env(andCF_CACHE_PURGE_TOKEN,CF_ZONE_IDif used), and rungo tool tifa deploy setupagain when deploying from CI, then commit and push the workflow it writes.
Added
- Every input of
tifa deployis read the same way: the flag if it has one, else the environment variable, else the.envat the root of the app. The purge token and the zone ID were read from the environment only. A machine with nocflogin can now clear the CDN cache at deploy withTIFA_DEPLOY_CF_PURGE_TOKENandTIFA_DEPLOY_CF_ZONE_IDin.env. Tifa only reads that file and never writes a token into it. tifa deploy setupandremovework without gh. With gh installed and logged in they use it as before. Without it they call the GitHub API with a fine-grained token fromTIFA_DEPLOY_GITHUB_TOKEN(environment or.env), limited to the repository with Secrets and Variables set to Read and write. Secrets are sealed with the public key of the repository. With neither, setup lists the GitHub part as something it cannot do and prints a link that opens GitHub's token form with the name, the owner and the permissions filled in.
[0.1.13] - 2026-11-21
Changed
- A public repository no longer shows where the server is.
deploy.hostis gone fromtifa.yaml, which is committed:tifa deploytakes the server from--host, else the environment variableDEPLOY_HOST, elseDEPLOY_HOSTin the.envat the root of the app, which git ignores. The value is an ssh alias (a Host of~/.ssh/config) orssh://host[:port], with no user. In GitHub Actions the workflow no longer writes the port or the zone ID:DEPLOY_HOSTholds the whole target (ssh://<address>:<port>forssh: direct), and the zone ID is the new secretCF_ZONE_ID.tifa deployandrollbackask the log of Actions to hide the host name. Withssh: cloudflare, the ssh host name has 12 random characters (deploy-a-ssh-k3j9x2m5q7wt.example.com), and setup replaces the old name, which the domain alone gave, in its plan. The workflow installs cloudflared 2026.11.1 and checks its SHA-256, in place of the latest version. Upgrading: move the value ofdeploy.hostfromtifa.yamlto a lineDEPLOY_HOST=<the same value>in the.envof the app (adeploy.hostleft intifa.yamlis a warning at its line, and everytifa deploycommand stops on it). Withdeploy.ci: github, rungo tool tifa deploy setupagain: it sets the newDEPLOY_HOSTandCF_ZONE_IDand writes the new workflow, which you commit and push, and withssh: cloudflareit also makes the new ssh host name and removes the old one. Another repository that deploys the same domain throughssh: cloudflareruns setup again too. tifa newpinsgithub.com/liustack/sqlitev0.1.8. It runs on windows/arm64, and on a target it does not support the build stops with the list of supported ones, instead of failing when the program opens a database.PRAGMA optimizeno longer fails withSQLITE_BUSYwhile another connection writes, and_pragma=optimizein the DSN is refused: run it withExec. Readers that fill every core no longer wait on each other in the WAL index. An existing app can upgrade withgo get github.com/liustack/sqlite@v0.1.8.deploy.cdnisdeploy.frontagain, with the same valuesnoneandcloudflare. The value says what visitors come through before the server: withcloudflarethat is the Tunnel, DNS, rules, cache clearing and the pathssh: cloudflareuses, not only a CDN cache. Upgrading: intifa.yaml, renamecdn:underdeploy:tofront:. Acdnkey is a warning at its line, and everytifa deploycommand stops on it.
[0.1.12] - 2026-11-21
Added
tifa deploy logsprints the log of the app on the server over ssh, what it printed and what systemd said about it: the last 100 lines,-nfor another count, and-fto follow until Ctrl-C.tifa deploy statusprints the release that runs and its commit, the releases kept and whether each passed its health check, since when the service runs, whatGET /healthzanswers now and the memory of the program.tifa deploy removetakes the app off the server and takes back what Tifa made for it: its units and its folder with its data, the route, DNS record, rules and Access of Cloudflare, the tunnel and cloudflared with the last app of the server, and the key and secrets of GitHub. It prints a plan and asks for the name of the app, or needs--yeswithout a terminal. The workflow file stays.
Fixed
- A retired key in
tifa.yamlis a warning at its line, such astifa.yaml:69: deploy.front is no longer used, ..., and GitHub Actions marks that line. tifa deploy env listsays on stderr when.envholds no names, and stdout stays empty.- With
deploy.ci: none,tifa deploy setupalso removes the Tailscale secretsTS_OAUTH_CLIENT_IDandTS_OAUTH_SECRETit set.
[0.1.11] - 2026-11-21
Added
- In GitHub Actions,
tifa check,tifa buildandtifa genprint each finding of their own as a workflow command in place of its plain line, so the run and the pull request mark its file and line once, errors and warnings apart. Findings in TypeScript files were not marked before, and a warning about a Go file was marked as an error.
Changed
- The
ci.ymloftifa newand the deploy workflow oftifa deploy setupinstall withpnpm install --frozen-lockfile --ignore-scripts, so the checks run intifa check, where GitHub reads their marks, not in thepreparescript, whose output pnpm prefixes. An app made before gets the marks by adding--ignore-scriptsto that line of its.github/workflows/ci.yml. Setup offers the new deploy workflow as a change.
[0.1.10] - 2026-11-21
Added
- With
deploy.ssh: tailscale,tifa deploy setupasks on a terminal for the ID and secret of your Tailscale OAuth client, checks that it can make keys fortag:ci, and keeps them as the secrets of the repository.tifa deploy setup --tailscale-oauthreplaces them. Setup no longer tells you to rungh secret set.
Changed
- The plan of
tifa deploy setupis short. It lists only what will be added, changed or removed, counts what is already right in one line (--alllists it), and ends with a numbered list of what setup cannot do for you, each with its reason. When everything is right it prints one line and asks nothing. Setup now does all it can and then exits with an error when something is left for you or a step failed, such as a cache purge token that Cloudflare refused three times. Upgrading: a script that runstifa deploy setupmust expect a non-zero exit when something needs you. deploy.frontis nowdeploy.cdn, with the same valuesnoneandcloudflare.tifa deployandsetupstop on the old key and name the new one. Upgrading: intifa.yaml, renamefront:underdeploy:tocdn:.- The Cloudflare cache purge token
CF_CACHE_PURGE_TOKENis optional. Setup lists it as optional when it cannot ask for it, and an empty line at its prompt skips it, without failing the run. It asks on the first CI setup only, andtifa deploy setup --cache-purge-tokenadds or replaces the token later. A deploy without a token or a cf login printscache: not cleared for <host>and what that costs, not a warning: a page withCachecan stay old on the CDN for up to itsCachetime.
[0.1.9] - 2026-11-20
Added
tifa buildandtifa devwarn when the source of a page names an image or a font ofpublic/by its path, such as<img src="/logo.png">orurl(/fonts/a.woff2). A file you import gets a content hash and a one-year cache under/assets/, and a file ofpublic/is checked with the server on every use. The docs now say which files to import and which to keep inpublic/(fixed names such asfavicon.ico,robots.txt, or an og image other sites link to).favicon.ico,apple-touch-icon*.pngand files a web manifest lists get no warning.
Fixed
- Behind Cloudflare, browsers kept a page with
Cacheand the files ofpublic/for 4 hours: the zone's Browser Cache TTL replaced theirmax-age=0andno-cache, and no purge reaches a browser. The cache ruletifa deploy setupwrites now keeps the browser TTL of the origin. Upgrading: rungo tool tifa deploy setupagain, which changes the rule. With a Cloudflare setup of your own, set Browser TTL to "Respect origin TTL" in the Cache Rule of the site.
Changed
- The
.gitignoreoftifa newignores.cloudflare/, where cf, the Cloudflare CLI, remembers the account for the folder it runs in. An existing app can add the same line.
[0.1.8] - 2026-11-20
Changed
-
tifa deploy setupreads the server, Cloudflare and GitHub at the same time and each thing once, says what it is reading, and ignores keys pressed before it asks. Planning went from 49 s to 7 s on a slow link. -
The
deploysection oftifa.yamlhas new keys.deploy.domainis gone: the domain is the host ofsite.url, anddeploy.front: cloudflare(defaultnone) turns on the Cloudflare Tunnel, DNS, cache rules and cache clearing for it.deploy.githubis nowdeploy.ci(noneorgithub).deploycommands refuse a mix that cannot work, such asfront: cloudflarewithoutsite.url, a port insite.url,ssh: cloudflarewithoutfront: cloudflare, orsshother thandirectwithoutci: github. A login of cf cannot make API tokens, so setup no longer tries to: on a terminal it prints a prefilled Cloudflare form, reads the token hidden, checks it and sets the secret, now namedCF_CACHE_PURGE_TOKEN. Without a terminal the plan shows the link and thegh secret setcommand. Upgrading: replacedeploy.domain: Xwithsite.url: https://X(if not set) anddeploy.front: cloudflare. Replacedeploy.github: truewithdeploy.ci: github. Rerungo tool tifa deploy setup, which asks for the token again under the new name and removes the old secretCF_PURGE_TOKEN.
[0.1.7] - 2026-11-20
Added
- The
deploysection oftifa.yamlhas two new settings,deploy.ssh(direct,cloudflareortailscale, how CI reaches the server) anddeploy.github(truelets the GitHub Actions of the repository deploy the app).go tool tifa deploy setupmakes the server, Cloudflare and GitHub match the four settings: it prints a plan ofok,add,changeandremovelines (andcannotlines that say what is missing), asks on a terminal (--yesskips the question, and without a terminal it stops after the plan), then applies it with a line for each step. It can run again at any time, and removes only what Tifa made and marked. Adeploy.hostthat is an IP address gets a note to write an ssh alias instead. See Deploying. - With
deploy.github: true, setup writes.github/workflows/tifa-deploy.yml, which deploys after theCIworkflow oftifa newpassed on the default branch (on a push when the app has noci.yml), and offers deploy or rollback by hand. It makes a key for the repository alone, reads the host keys of the server over your ssh, and sets the secrets with gh without printing or writing them. Withdeploy.ssh: cloudflareit adds an ssh host name to the tunnel with a Cloudflare Access service token for the repository, and withtailscalethe workflow joins your tailnet. - With
deploy.domain,go tool tifa deployanddeploy rollbackclear the Cloudflare CDN cache of that host name when the release is live, by host name and nothing wider. On your machine cf does it, in CI a token that can only clear the cache of the zone does (setup makes it with cf when it can). A clearing that fails prints a warning and does not fail the deploy. In GitHub Actions, deploy and rollback write a short summary to the page of the run. go tool tifa deploy env set NAME,env unset NAMEandenv listedit the.envof the app on the server over ssh.setreads the value from the standard input or a hidden prompt, never from an argument, and no command prints a value. The file keeps mode 600. The app restarts through its socket and must pass the health check of a deploy, or the old file comes back. The file is read by the app as configuration only and is not put into any environment.go tool tifa deploymakes the folder, port and units of a new app by itself on a server that setup prepared, as the usertifaand without root.
Changed
go tool tifa deploy setupno longer takes--cloudflare:deploy.domaindecides whether the app goes behind a Cloudflare Tunnel, and it asks before it changes anything.go tool tifa deploy githubis gone: its work is part of setup, underdeploy.github. Upgrading: setdeploy.github: true(anddeploy.ssh: cloudflareortailscaleif you passed--cloudflareor--tailscale) intifa.yaml, rungo tool tifa deploy setup, and for Caddy or another proxy leavedeploy.domainempty instead of passing--cloudflare=false.go tool tifa newwrites.github/workflows/ci.yml, a GitHub Actions workflow that runsgo tool tifa checkon pull requests and on pushes tomain, andgo tool tifa agentswrites it into an app that has no workflow yet. It never replaces a file. Seetifa new.
[0.1.6] - 2026-11-20
Added
go tool tifa deployputs the app on a Linux server with systemd over ssh. It builds on your machine for the system of the server, uploads the program into a new release, restarts the app through its systemd socket so no request is refused, asks the new program for/healthzon the server and starts the release before again when it does not answer below 500 within 30 seconds. It never uploads.env, keeps the last 5 releases and writes each deploy intodeploys.logon the server.go tool tifa deploy setup, once per app as root, creates the usertifathat runs every app of the server, the folder of the app with an empty.env, a free loopback port and the systemd units.go tool tifa deploy rollbackgoes back to the release before. The server isdeploy.hostintifa.yaml,--hostorDEPLOY_HOST, and Tifa runs your ownssh, so~/.ssh/config, a Cloudflare Tunnel or Tailscale work as they do in a terminal. See Deploy with tifa deploy.- With
deploy.domainset and cf, the Cloudflare CLI, installed and logged in,go tool tifa deploy setupputs the app behind a Cloudflare Tunnel with the login of cf, and the server opens no port. One tunnel serves every app of the server: setup creates it, installs cloudflared with apt from Cloudflare's signed package repository when the server has none (so unattended-upgrades keeps it current, and on a server without apt setup downloads nothing and says to install it), runs it as the servicetifa-tunnel, then adds the route of the domain, a proxied DNS record, and rules for that host name only that cache what theCache-Controlof the app allows, never cache/__tifa/or navigation data, and turn off Rocket Loader and the other features that write into the HTML. It changes no setting of the whole zone, leaves a DNS record that points elsewhere alone, and keeps no Cloudflare token. Running it again changes nothing. Without cf it prints the steps, and--cloudflare=falseskips Cloudflare. See Set up with a plan.
[0.1.5] - 2026-11-20
Added
- A site with
site.urlserves/sitemap.xmlwithlastmodand thehreflanglinks of each page, a default/robots.txtthat allows everything and names the sitemap, and/llms.txtand/llms-full.txtfor language models. The pages without parameters are in them on their own.tifa.SetSitemapinOnStartlists the pages with parameters, leaves routes out withExclude, and adds titles, dates and translations. A page that shows a content entry has a Markdown version at its URL with.md, whichllms.txtlinks to. Apublic/robots.txtor a route of the app at one of these paths wins, and a site withoutsite.urlgets none of them. A site with pages with parameters and noSetSitemaplogs one line at start. A mistake in whatSetSitemapreturns, such as a route with parameters it neither lists nor excludes (a blog with no posts yet), a path that matches no route, a wrong language or a page listed twice, leaves that page or pattern out: the files still answer, and each request logs one error line per kind of mistake naming them. Only an error the function itself returns answers 500 throughOnError. See Search engines and language models. tifa buildwrites the Markdown of each content entry next to its HTML, with the URLs the HTML has. Drafts are left out, as before.
Changed
- With
site.url, every page has a canonical link, also on a site with one language and on a page with one version. Before, only a page with several versions had one. A 404 or an error page still has none. - The canonical link keeps the query parameters the
Loadand Layouts of the page read, as the server renders the page, and drops the others./store/products?page=2&utm_source=newsnow names/store/products?page=2when itsLoadreadspage, where it named/store/productsand told search engines that page 2 was a copy of page 1. The browser writes the same link after it hydrates and after a navigation. Thehreflanglinks stay without a query.
Fixed
- Server rendering runs on slowjs v0.31.10. An
awaiton a promise whoseconstructorgetter throws now throws at theawait, so acatchorfinallyaround it runs. Before, the async function stayed stuck there. The instructions of one render are within 0.03% of v0.31.9.
[0.1.4] - 2026-11-19
Fixed
- Server rendering runs on slowjs v0.31.9. A render that sat just under its memory limit ran a full collection each time an array grew, and could end at the render timeout. It now finishes.
toLocaleStringon an array passes its locales and options to each element, so[1234.5].toLocaleString("de")gives1.234,5as in the browser. The instructions of one render are within 0.1% of v0.31.8.
[0.1.3] - 2026-11-19
Fixed
tifa newpinsgithub.com/liustack/sqlitev0.1.7. A write no longer waits behind readers that keep every core busy, and a pool of connections no longer reads slower beside writes. An existing app can upgrade withgo get github.com/liustack/sqlite@v0.1.7.
[0.1.2] - 2026-11-19
Fixed
- A render that ran up against the memory limit could, in rare cases, leave a freed shape in an object, and a later collection then stopped the engine. That render's request answered 500 and the VM was replaced. Server rendering now runs on slowjs v0.31.8, which fixes it. The bug was in slowjs v0.31.4 to v0.31.7, so in Tifa v0.0.14 to v0.1.1. The HTML and the instructions of one render are the same.
tifa devcould take 5 seconds to stop when a browser opened a connection at the moment it began to stop.
[0.1.1] - 2026-11-19
Fixed
- Server rendering runs on slowjs v0.31.7, a release of engine fixes: a timeout, an interrupt or running out of memory now stops compiling, async functions, generators, modules and promise jobs cleanly, and loading many modules takes linear time. The HTML is the same. Instructions of one render: +0.08% on the shop's workbench pages, +0.10% on the storefront, -0.08% on the MUI test app.
- The v0.1.0 module carried a 41 MB
tifabinary that was committed by mistake, sogo getdownloaded it with the source. It is gone, and v0.1.0 is retracted, sogo getandgo list -m -upoint to v0.1.1.
[0.1.0] - 2026-11-18
Added
- Compatibility says what Tifa keeps stable from v0.1 and what may still change. A change that breaks what it promises now comes in a minor version, never in a patch.
tifa new --emptywrites a skeleton in place of the todo list app: the root files with the sessions table, a root Layout with its error component and a home page of one line. It builds, passes its owngo testandgo vet, and starts. Without the flag nothing changes.- A sign-in over plain HTTP from a host that is not localhost logs a warning, once per process: browsers drop the
Securesession cookie there, so the user stays signed out with no other sign. Requests over TLS, withX-Forwarded-Proto: httpsorForwarded: proto=https, and to localhost do not warn.
Changed
- The
contentpackage spells the language out, as the rest of Tifa does.Entry.LangisEntry.Language(JSONlangbecomeslanguage),Translation.LangisTranslation.Language, and the parameters ofGetandInare namedlanguage. A front matter keylanguageis now one of the names Tifa sets, andlangis free again. The vfile data of a Markdown plugin hasfile.data.tifa.languagein place oflang. Upgrading: rename.Langto.Languageon entries and translations, andLang:toLanguage:incontent.Entryandcontent.Translationliterals (tests that usetifatest.SetContenthave them). In TypeScript that reads an entry or a translation from aLoadresult, renamelangtolanguagein the type and in uses such aspost.lang. A remark or rehype plugin that readsfile.data.tifa.langreadsfile.data.tifa.language. A schema or front matter field of your own namedlanguagemust be renamed. - The names a page imports from Tifa are fixed for good:
tifa/client,tifa/i18nand@tanstack/react-router. Thepathsof the app'stsconfig.jsonis now one line for all of them,"tifa/*": ["./.tifa/tifa/*"], and.tifa/tifa/holds only the public entry files, so a module added later needs no change to any tsconfig.tifa/clientalso exports theSessionDatatype, so a page no longer imports@/.tifa/session.gen. Upgrading: intsconfig.json, replace the lines"tifa/client": ["./.tifa/runtime/client.ts"]and"tifa/i18n": ["./.tifa/runtime/i18n.tsx"]with the one line"tifa/*": ["./.tifa/tifa/*"]. Rungo tool tifa buildorgo tool tifa devonce so that.tifa/tifa/exists before the editor looks for it. In code, replaceimport type { SessionData } from '@/.tifa/session.gen'withimport type { SessionData } from 'tifa/client'. Imports oftifa/clientandtifa/i18nstay as they are. Tifa does not edit your code or your tsconfig for you. RouteErroris gone. Pages have one error class,TifaError, withstatus,messageandfields. A failedLoad, a 404 and a failed handler call all give aTifaError, so oneinstanceofcheck covers them.fieldsis an empty object unless the answer came from atifa.Fields. Upgrading: replace everyRouteErrorin your pages withTifaError, and drop it from imports that list both (import { TifaError } from 'tifa/client'). Checks likeerror instanceof RouteError && error.status === 404becomeerror instanceof TifaError && error.status === 404.- The error and 404 component that
page.tsx,layout.tsxandlayout_.tsxexport is now calledErrorBoundary. The old nameErrorhid the globalErrorin the whole file, soerror instanceof Errorcompared against a component and was always false. A module that still exportsErrorfails the build and says to rename it. Upgrading: in everypage.tsx,layout.tsxandlayout_.tsxthat hasexport function Error(orexport const Error =, rename it toErrorBoundary. Where another file imports it, such asimport { Error as RootError } from '../../layout', importErrorBoundaryinstead (import { ErrorBoundary as RootErrorBoundary } from '../../layout'). - Breaking. Three names changed before v0.1.
tifa.MemoryStoreandtifa.NewMemoryStoreare no longer exported: the memory store is the default, sized bysession.memory_limit, andtifa.SetSessionStore(nil)brings it back.c.IsData()is nowc.IsDataRequest().tifatest.WithSession(c, &s)is nowtifatest.SignIn(t, c, &s). Upgrading: replacetifa.NewMemoryStore(n)with the settingsession.memory_limit(in a test of your own store, pass your store totifatest.TestSessionStore),c.IsData()withc.IsDataRequest(), andtifatest.WithSession(c, &s)withtifatest.SignIn(t, c, &s). - Breaking.
cache_control.s_maxageis nowcache.s_maxage, with the flag--cache-s-maxageand the variableCACHE_S_MAXAGE. The old key, flag and variable still start the program and the build, but the value is not used: each prints one "no longer used" warning, and pages withconst Cache = trueget the default 1m until the new key is set. Upgrading: intifa.yaml, the file of-c,.envand your deployment, renamecache_control.s_maxage(s_maxageundercache_control:) tocache.s_maxage(s_maxageundercache:),--cache-control-s-maxageto--cache-s-maxageandCACHE_CONTROL_S_MAXAGEtoCACHE_S_MAXAGE. - Retired settings no longer fail. A key or flag that Tifa dropped (
cache.size,cache.whole_page,cache.ignore_query,cache_control.s_maxage) prints one "no longer used" warning that says what replaces it, and the program starts and builds. Before, the program refused to start. They are listed in the configuration page of that release. Tifa will use the same list for each key it drops later. - Breaking.
c.Bindandc.BindQueryname a field by itsjsontag, then its Go name, the same as the input of a typed handler. They no longer readformtags, andtifa buildfails on aformtag in a struct passed to them, as it does for a typed input. Upgrading: in a struct you pass toc.Bindorc.BindQuery, move eachform:"name"tojson:"name"(a field with both keeps the json name), and remove the form tag. - Pages that use MUI or emotion's
styledrender faster. A styled component no longer copies its array of styles when no registered class name adds to it, copies its props with a spread when they have a plain shape, andprocessStyleVariantsof@mui/systemreads each variant's props once. On the MUI test app the three pages run 2.5% to 3.2% fewer instructions per render (2.9% fewer over the three, counted with callgrind, not timed) with the same HTML, and the pages of the example shop, which has no MUI or emotion, are the same bundle. tifa newpinsgithub.com/liustack/sqlitev0.1.5. The WAL file stops growing past 64 MiB (_wal_limitin the DSN changes it, 0 turns it off), writes next to overlapping reads are faster, queries of computing run 6% to 10% faster, and a connection that hit an out of memory, I/O or disk full error is dropped once its transaction ends. Two rules changed. A connection in a read transaction that tries to write while another holds the write lock getsSQLITE_BUSYat once, no longer afterbusy_timeout. When a group commit ends because one statement failed, the statements of the group that ran before getSQLITE_ABORT_ROLLBACK, and the caller decides whether to run them again. Errors are of the exported typesqlite.Error, with the result code. Existing apps:go get github.com/liustack/sqlite@v0.1.5.- Pages with links render faster. The router no longer repeats work for each link that gives the same answer every time: it checks the first characters of an href before a regular expression, and writes a query into one string, leaving plain names and values as they are. The check that lets prefix links skip a
URLis cheaper too. On the example shop the storefront pages run 0.4% to 4.7% fewer instructions per render (1.4% fewer over its seven pages in both languages) and the workbench pages 0.1% to 0.3% fewer. The MUI test app runs the same, within 0.04% (counted with callgrind, not timed). The pages are byte for byte the same.
Fixed
- Server rendering runs on slowjs v0.31.6, a release of engine fixes: the garbage collector could stop while an array moved, WeakRefs and young WeakMap keys were mishandled during a collection, the shape cache had a fault, and some built-ins went wrong when they ran out of memory. The HTML is the same. Instructions of one render: -0.37% on the shop's workbench pages, -0.06% on the storefront, +0.19% on the MUI test app.
ssr.timeoutlimited compiling the SSR bundle and loading each VM too, not only a render, so a busy or slow machine could fail to start a program whosessr.timeoutis short, withssr: compile bundle: InternalError: interrupted. Starting now has a limit of its own of one minute, which only stops top level code that never ends, andssr.timeoutis the budget of a render, as documented.- Pages render about 0.7% faster again on the shop's workbench pages and the MUI test app (0.6% on the storefront pages), with the same HTML. A change of 2026-11-13 that writes out small functions whose body throws, such as React DOM's
resolveCurrentlyRenderingComponentthat every hook calls, stopped working on 2026-11-16 when the Tifa host script got atifaThrowof its own, so every SSR bundle kept those calls. The build now reuses a top-leveltifaThrowthat only throws its argument, and still leaves alone any other function of that name. Instructions of one render, 20 pages of the shop: -0.71% on the workbench, -0.56% on the storefront, -0.59% in all. MUI test app: -0.73%.
[0.0.18] - 2026-11-17
Fixed
- The Node process of
tifa devno longer grows with every rebuild of the SSR bundle. Each build kept about 5 MB alive on its worker thread, more with a larger Vite config, and the process grew about 8 to 10 MB per rebuild with garbage on top: past 2.8 GB after 200 edits on a one-core Linux machine. The SSR bundle now moves to a new worker thread every 10 builds, which frees it all. On the test app over 150 edits the process stays between 700 and 970 MB, and rebuilds no longer slow down as it grows. - When a Vite plugin ended the thread that builds the SSR bundle in
tifa devwith an error it did not catch, every later build failed with that error untiltifa devrestarted, also once the plugin was fixed. The next build now runs on a new thread.
[0.0.17] - 2026-11-17
Fixed
- Under
tifa dev, the server render and the browser read the sameimport.meta.env.MODE,DEV,PRODandBASE_URL. Before, a page that read one of them rendered other text on the server than in the browser and failed to hydrate. React keeps its production build in the render.
Added
tifa buildandtifa devwarn when app code readsimport.meta.env.VITE_*, once for each name, with the place of the first read. The value is fixed when the build runs, and a value that is known only when the program runs comes fromLoad. See the new guide Values from the environment.go tool tifa errorsalso lists the warnings of the Tifa plugin in Vite, such as the one for a read ofimport.meta.env.VITE_*, underWarnings. A build that no longer has one drops it.go tool tifa upgrade [version]moves an app to a newer Tifa, the latest release without a version. It runsgo get -toolandgo mod tidy, and then the new Tifa does the rest: it sets the versions of the packagestifa newpins inpackage.json(React, React DOM, TanStack Router, Vite and the others, only when the app lists them with an exact version older than the pin: a newer one stays, a range such as^19.2.0is never guessed at, and both get a line that says so. TanStack Router is the exception, since the build needs exactly the pinned one), installs, writes the skill and the block ofAGENTS.mdagain, prints the migration notes of the changelog entries between the two versions, and runstifa check. It refuses an older version or the same one, and changes none of the app's code. Before, an upgrade wasgo get -toolandgo mod tidy, and then finding out by hand which packages and files had to follow. See Upgrading Tifa.tifa newwrites.vscode/settings.json, which makes VS Code label the tabs ofpage.tsx,layout.tsx,route.go,route_test.goandroute.gen.tswith their folder, such asorders/page.tsx. Before, a dozen open tabs all saidpage.tsx. It is not in.gitignore, so a team shares it. Seetifa new.
Changed
- Pages that use i18next render faster. The key of the translation cache is no longer rebuilt for each
tcall when it is the same as the call before. On the example shop the storefront pages run 1.1% to 1.5% fewer instructions per render, and the article pages 0.2% (counted with callgrind, not timed). tifa buildandtifa devthat stop because anothertifa devortifa buildruns now say thatgo tool tifa checkandgo tool tifa gencan run meanwhile.- The notes of a new app, and
go tool tifa agents, now point to the docs on reloading page data after a write, next to the line that a call never reloads it. - Server rendering runs on slowjs v0.31.5. The HTML is the same. On the example shop a render, with the garbage collection that follows it, takes 1.5% less time on the storefront and 1.9% less on the workbench. A VM holds about 0.8% more memory (20.2 MB against 20.0 MB after a 20 minute run).
docs/app.mdis split by topic intoroutes.md,pages.md,ssr-and-cache.md,server-render.md,styles.md,hooks.mdandtesting-apps.md, so an agent reads only the part it needs.go tool tifa docslists each, and the notes of a new app point to them. "Pages open while you deploy" moved todeploy.md.
[0.0.16] - 2026-11-17
Changed
- Pages of a site with languages render faster. Every link used to make a
URLin the render, and a plain link no longer does. On the example shop a render runs 1.6% to 5.0% fewer instructions on the English storefront pages, 3.3% to 9.4% fewer on the Chinese ones and 0.6% to 0.8% fewer on the workbench pages (counted with callgrind, not timed). The HTML is the same. - An app that does not use sessions no longer logs
tifa: sessions are kept in memoryat startup.
[0.0.15] - 2026-11-17
Fixed
- A site with languages holds less memory in each render VM and collects less often. Each render's router used to stay in memory until the next full collection, so a VM grew by about 26 KB per render between full collections, and now it does not grow. Serving the example shop for 20 minutes at 58 requests a second, its one VM holds 20 MB where it held 34 MB, and the process peaks at 85 MB where it peaked at 111 MB.
[0.0.14] - 2026-11-17
Added
tifa.Stats().SSRhas two more fields:Replaced, how many VMs the pool replaced because they grew (they held more than half ofssr.vm_memoryafter a collection), andMemory, what the loaded VMs hold now in bytes, by the engine's count after each VM's last collection, the sizessr.vm_memorylimits. A monitoring route can now see how much memory the VMs hold and how often one is replaced. The example shop's/metricswrites them astifa_vms_replaced_totalandtifa_vms_memory_bytes. See Metrics.
Changed
- The docs are in English only. The README and the example shop's README keep a Chinese version, and the other
*.zh-CN.mdfiles andCHANGELOG.zh-CN.mdare gone. - Server rendering runs on slowjs v0.31.4. The HTML is the same. Renders take about 0.5% to 0.9% less time by the engine's own timing.
- An import cycle through the root package is reported as Go reports it, without a rule about where the root package may import from. The generated
AGENTS.md, the skill and the docs no longer say the root package imports nothing underapp/: they say what Go allows, that the root package cannot import a domain that usesDB, and how to call such code fromhooks.go. - The i18n guide says that a folder with a
_localesfolder that holds only the default language's file is served at one URL, for pages as well as API routes. go tool tifa docsprints about 2 KB, not 43 KB: one line for each doc about writing an app.--whenadds when to read each doc, and--allalso lists the docs about developing Tifa itself. The skill no longer sends an app to the example shop on GitHub, and its examples use an app-neutral module path.- The database guide has a section on rejecting a duplicate row with
ON CONFLICT ... DO NOTHING RETURNINGand what the driver gives to tell a constraint error from others. - The background work guide starts with the simple case: one loop every minute, started in
OnStart, stopped inOnShutdown, with its function in a package that does not import the root. - The big number refusal is described exactly in the generated
AGENTS.md, the skill and the JSON rules: a handler result is checked only for a call with the headerX-Tifa-Call(what the generated function of a page sends). A test pins a handler by posting withX-Tifa-Call: 1. tifatest.Startrefuses a number above 2^53 in the data ofLoadandLayout, as the program does, and the test sees a 500. Before, onlyStartPagesdid.
Fixed
go tool tifa checkno longer fails withCannot find module .../.tifa/driver-NNN/driver.mjswhentifa devrebuilds at the same moment.tifa devcleaned out the driver folder thatcheckhad just made in.tifa/. It now leaves the driver folders of other processes alone.
[0.0.13] - 2026-11-17
Added
tifa newwrites apnpm-workspace.yamlwithminimumReleaseAge: 4320, so pnpm 10.16 or later installs no package version that is less than 3 days old. A npm package that is compromised is usually found and pulled within days. The versionspackage.jsonpins are all older than that. Seetifa new.tifa errorsnow also lists the warnings of the last build, after the errors, and--jsonhas awarningslist: the warnings of the analysis (such as a number above 2^53 going into a field that pages read), of the check for code of other frameworks and of the content. Before, they only scrolled by in the output oftifa dev, which an agent that startedtifa dev --backgroundnever sees. They are not errors: the exit status stays 0 when there are only warnings. Seetifa errors.- Coming from another framework says what to use instead of static generation and prerender (the render memo and
const Cache),next/imageandnext/font(a plain<img>,public/,@font-face) andloading.tsx(Suspense, or fetch from the browser).tifa checknow reportsnext/imageandnext/fontwith that advice, and the messages forgetStaticProps,getStaticPaths,generateStaticParams,revalidateandloading.tsxpoint to the new sections.
Changed
- Server renders of pages with emotion styles do less work for each component.
getRegisteredStylesof@emotion/utils, which every MUI component calls, walks its class names without making an array and a function. The HTML is the same. Counted with callgrind, the three pages of the MUI test app run 1.0% fewer instructions.
Fixed
- An app with many distinct pages no longer has its VMs replaced over and over. A VM grows as each kind of page renders for the first time and as caches fill, then stays: the example shop's VMs settle at 2 to 2.5 times what they hold after loading, and the pool replaced any VM past twice that, so a fresh VM grew past it again within about a hundred renders (116 replacements in 10.5 minutes in a soak with one VM). A VM is now replaced when it holds more than half of
ssr.vm_memoryafter a collection, 64 MiB with the default limit. When the VM loaded in its place grows past that too within 2,048 renders, the pool logs once thatssr.vm_memoryis too low for the app and waits a minute before it replaces a grown VM again, longer each time. See Memory. go tool tifa agentsno longer rewrites anAGENTS.mdwith CRLF line ends on every run. It compares the block as if the file had LF line ends, and writes a refreshed or appended block with the line ends of the file.--checknow passes on such a file.- A
route.goor other file of a package underapp/that imports its own package now gets a message that says what is wrong: the file is already in that package, so drop the import and use its names directly. Before, the build only saidcould not import ... (import cycle: [...]). A cycle that goes through the root package and a package underapp/now also says that the root package must not importapp/. See which way imports go.
[0.0.12] - 2026-11-17
Changed
- Server rendering runs on slowjs v0.31.3. The HTML is the same. Timed by slowjs on an AMD EPYC 7B13 as the mean of 16 code layouts, the storefront pages of the example shop take 4.2% less time than on v0.31.2, the workbench pages 3.5% less and three pages of an MUI app 1.7% less, and every shop page is faster (2.8% to 6.6%). A VM uses 0.4% to 1.4% more memory, for a cache the engine keeps at each place that reads a property by name. A regular expression may have up to 32,767 capture groups, which the grammars of shiki need.
replaceandsplitwith a customexec, a very long regular expression literal andIntlon a long list of locales now stop when a render is stopped. - A number a browser would read as another number is no longer sent. A browser, and the server render, read every JSON number as a double, so an integer above 9007199254740991, such as a snowflake ID, a
uint64hash ortime.UnixNano(), used to arrive rounded without any error. Now the request fails as an unexpected error (OnError, a 500, the dev page andtifa errors) with a message that names theLoad,Layout, handler or session, the path of the number such asrows[3].id, and the number as written and as a browser reads it. It applies to the results ofLoadandLayout, the session data ofExposedand the result of a handler called from the generated function of a page. A handler answering a client that does not sendX-Tifa-Calland what an app writes withc.JSONare unchanged. Afloat64, timestamps in milliseconds and counters never trigger it.tifa build,tifa checkandtifa devalso warn, with the file and line, where code puts such a number straight into a field of a type a page reads: a constant above 2^53,time.Time.UnixNano, the unboundedmath/randfunctions, aSum64hash orbinary.Uint64of bytes fromcrypto/rand, in a composite literal or an assignment to a field, through a conversion or one local variable. Nothing is warned from the type or the name of a field alone. Addjson:",string"to the field to send it as a string (typedstring), or send milliseconds. See JSON rules. - Apps install
@tanstack/react-router1.170.46, which depends on@tanstack/router-core1.171.39.tifa buildrefuses another version, so change the version inpackage.jsonand install again.tifa newwrites the new one. The router tests, the SSR tests and the shop pass on it unchanged. - Server renders do less work in each
useCallbackcall, in each lookup of the i18next cache and in each lookup of the cache of lucide-react icons. The HTML is the same. Counted with callgrind, the example shop's storefront pages run 1.24% fewer instructions, its workbench pages 0.79% fewer and the pages of an MUI app 0.40% fewer. A stack trace of an error thrown while React compares the dependencies of auseCallbacknamestifaUseCallbackwhere it nameduseMemo.
[0.0.11] - 2026-11-16
Added
tifa dev --backgroundstarts the dev server detached from the terminal and returns once the app answers, so a coding agent or a script can start it and go on working. Every other flag and environment variable reaches the server, and everything it prints goes to.tifa/dev.log.tifa dev status [--json]says whether it runs, its address, process ID, start time and whether the last build worked.tifa dev logs [-n lines] [-f]prints the log.tifa dev stopstops it and waits until the lock is free. What runs is judged by the lock.tifa/dev.lock, not by the process ID in the file, so a leftover file after a restart or a crash isnot runningand nothing is signalled. A secondtifa devnow says to usetifa dev statusandtifa dev stop. TheAGENTS.mdthattifa newwrites tells agents to use them. See Agents and scripts.Validateon a handler input may take the Ctx:func (in SignUp) Validate(c *tifa.Ctx) error. It can read the request, so a message can be in the visitor's language withc.Language().func() errorstill works.tifa buildfails whenValidate, or a function it passes the Ctx to, writes the response, reads the body again, changes the session or callstifa.Use. The forms and i18n guides say when to translate in Go and when to return codes that the page translates.c.Path()is the path of the page as the visitor sees it in the address bar, with the language prefix and without the query:/en-US/store/items/a%20b. A page load and the data request of a client navigation give the same path, a method handler gets its own, andtifatest.NewCtxandtifatest.Startagree. ALoadcan use it for anextaddress withoutc.Request(), whichLoadmay not call.tifa buildrefuses it in aLayout, whose data is shared by every page below it.tifa check,tifa buildandtifa devrecognize code written for Next.js, Remix, React Router, TanStack Start, SvelteKit and other Go web frameworks: imports such asnext/link, the directives'use client'and'use server', exports such asgetServerSideProps,loaderandmetadata, folders such as[id]and(group), files such as+page.svelteandmiddleware.ts, androute.gohandlers that takehttp.ResponseWriter,*gin.Context,echo.Contextor*fiber.Ctx. Each is reported with the file and line, the name of the framework and the Tifa way to write it, as an error (the app cannot be right) or a warning (it builds and does nothing). Names Tifa allows are not reported. See Coming from another framework.go tool tifa agentswrites the Tifa skill into the app (.claude/skills/tifa/) and refreshes the block between thetifa:beginandtifa:endlines ofAGENTS.md, both from the Tifa version the app uses. Before, the skill was a copy of a repository folder that stayed as it was after an upgrade, with links to the docs on GitHubmain, and nothing ever refreshed the block. The skill now links to the docs of the installed version. Run the command again after an upgrade.--checkchanges nothing and exits with 1 naming the files that are out of date, for CI. A file Tifa wrote is overwritten, edits included, a file it did not write is left alone, and the text ofAGENTS.mdoutside the markers is never touched. AnAGENTS.mdwith no markers gets the block appended, and with noAGENTS.mdone is written.tifa newruns the same code, andtifa checkprints one line when the files of an app that has them are out of date. Seetifa agents.
Changed
- The sign-in guide has a
RequireUserguard that sends a signed-out visitor to/login?next=withc.Path(), and tests the whole sign-in and sign-out withtifatest.Start. - A call from the page to a handler with no input and no result, such as
func POST(c *tifa.Ctx) error { return tifa.ClearSession(c) }, now brings the new session to the browser when the handler wrote nothing. Before,SignedIn,SignedOutanduseSessionkept the old state until the next navigation. The answer is 200 withX-Tifa-Session: 1and the session as its body, and the generated TypeScript does not change. A handler that writes its own response is unchanged. - The skill in
skills/tifacoverstifa dev --backgroundwithstatus,logsandstop, the check for other frameworks' idioms, and a sign-out handler with no input. Its links are paths into the docs of the installed version, not GitHub. - The
README.mdthattifa newwrites says what the app is: a working starter to replace with your own domain, not a todo list product.
Fixed
tifa devrebuilds once for a file saved in place, also when the machine is busy or a poll looks at the file in the middle of the save. It could take the empty file for a settled change and rebuild twice, the second time for the finished file. Before it takes a batch, it now lets the file watcher catch up with its events and polls.
[0.0.10] - 2026-11-16
Changed
- Server rendering runs on slowjs v0.31.2. The HTML is the same. Timed by slowjs on an AMD EPYC 7B13 as the mean of 16 code layouts, three pages of an MUI app take 3.0% less time than on v0.31.1 and the storefront pages of the example shop 2.7% less, and the workbench pages show no change beyond 1%. The engine now writes the start tags of
imgand the other void elements, ofinputand of an inlinestyle, and hashes emotion's styles in C. The extra bytes v0.31.1 gave every regular expression go only to those that use them.Intl.NumberFormathasformatRangeandformatRangeToParts.
[0.0.9] - 2026-11-16
Changed
- The whole-visits tables in the README and in Performance count a full load as every request the server answered with a whole page (the landing of a visit, and a search or another action that loads a page) and a client navigation as every one the router answered with data alone. They counted the first page of a visit as the full load and the three after it as client navigations, although about a tenth of those load a whole page. Same run, same page views a second. Full loads: Tifa 39.5 / 80 ms (P50 / P99), TanStack Start 34.9 / 73 ms, Next.js 51.6 / 146 ms. Client navigations: Tifa 2.4 / 30 ms, TanStack Start 3.3 / 24 ms, Next.js 16.6 / 139 ms.
[0.0.8] - 2026-11-16
Changed
- The whole-visits comparison in the README and in Performance is two tables now. The throughput table has page views, full loads and client navigations a second, with the three reference rows (Tifa with the render memo off, TanStack Start with gzip, Next.js with prefetch off). The latencies have a table of their own. The whole-request comparison of 2026-11-06, measured with an older engine, is gone from both.
Fixed
tifa devputs back a file in.tifa/that another tool changed or deleted, on the next rebuild. It used to leave the file as it was until a route changed.tifa devno longer deletes and copies all ofpublic/on every rebuild. Saving a TS file with large images or videos inpublic/is fast again, and a request for a public file during the rebuild no longer gets a 404. Only files you added or changed are copied, and removed ones are deleted.
[0.0.7] - 2026-11-16
Changed
- The whole-visits comparison in the README and in Performance is the run of 2026-11-16, with the traffic of today (4 page views a visit, searches, filters, crawlers, the same warm-up for every server): Tifa answers 97.0 page views a second on one core, Next.js 29.5 and TanStack Start 76.5. React Router is no longer part of the comparison.
Fixed
tifa build --dir apps/shop -o out/appwrites the executable toout/appunder the folder you stand in. It wrote it under the app folder and still printedbuilt out/app.tifa buildwithout-onames the executableshopfor the moduleexample.com/shop/v2, asgo builddoes. It named itv2.
[0.0.6] - 2026-11-16
Changed
- A page whose component throws, or whose render uses up
ssr.vm_memory, no longer slows the whole site when it is requested again and again. The built app remembers the failure and the error page for 5 seconds, so a request for the same page with the same data and session in that time gets the same answer without a render (X-Tifa-Render: memo), and requests that arrive together share the renders that place the error.OnErrorstill sees every request, and after the first one it gets the first line of the error with a note that the page did not render again, so the log does not repeat the stack trace.tifa devremembers nothing (see Errors on a page). - A page whose render uses up
ssr.vm_memoryrenders its error page once, in place of the outermost Layout, instead of once at every level with the same data, each of which used up the memory again and replaced another VM (see Errors on a page). - Pages render a little faster: the engine now writes the start tag of every
awhosehrefis not empty and of everybuttonthat has nonameor form props, where React DOM wrote them itself. The 14 storefront pages of the example shop run 2.2% fewer instructions and the 6 workbench pages 2.4% fewer, with the same HTML.
Fixed
tifa newbuilt with a Go development toolchain writes a validgoline togo.mod, such asgo 1.27, notgo .0.tifa build,tifa dev,tifa genandtifa checkstop at once withtifa needs Node 20.19, 22.12 or later to run Vite, found Node Xon an older Node, instead of an error from inside Vite.- A symbolic link in
public/, to a file or to a folder, or apublic/that is itself a link, is followed bytifa buildandtifa dev. Such files were left out of the build without a word. A link that leads back into the folder being copied, or to nothing, fails the build. - A file named
index.htmlinpublic/, such aspublic/docs/index.html, is served at its own path. It was answered with a redirect to its folder. tifa devno longer calls the app ready when another program holds its address, such as Vite's dev server on a port that was free when both were chosen. The dev server asked only whether the port was open, so a browser request could get Vite'sCannot GET /__tifa/vite/while the app had failed to listen. It now waits for the app itself to answer, and when the app exits instead, shows why.
[0.0.5] - 2026-11-16
Added
performance.now()andperformance.timeOriginexist in the server render, so libraries that read the time while rendering, such as framer-motion's motion values (useMotionValue,useTransform,useSpring), render on the server instead of failing the page withReferenceError: 'performance' is not defined.- A
tifainstalled withgo install github.com/liustack/tifa/cmd/tifa@latesthands the command to the version an app pins when run inside the app, likego tool tifa, so it never generates code for another Tifa version.go tool tifastays the main way (see Installing the command globally). tifa genwrites the generated code into.tifa/and builds nothing, so editors andtscsee the types of a fresh clone. Thepackage.jsonoftifa newruns it from itspreparescript, sopnpm installornpm installis enough. Existing apps: add"prepare": "go tool tifa gen"to thescriptsofpackage.json(seetifa gen).- Built-in languages. A folder of
app/with a_localesfolder holdingzh-CN.json,en-US.jsonand so on is offered in those languages, with its pages and API routes. The default language, named byi18n.defaultintifa.yaml, keeps the plain URL (/store/cart) and each other language is the first segment (/en-US/store/cart).i18n.prefix: alwaysprefixes the default language too. Writesite.urlintifa.yamland Tifa writes<html lang>, thehreflangandx-defaultlinks and a canonical link. In code,c.Language()anduseLanguage()give the language,useAlternates()gives the page's URL in each language for a language switch,c.SetAlternatessays which versions a page has when its slug differs,tifa.Languages()gives the languages for a content collection (Languages: tifa.Languages()), and the newtifa/i18nadapter translates with one i18next instance for all languages and react-i18next, with formatters added inonStartofhooks.ts. Links such as<Link to="/store/cart">and root-relative links in Markdown get the prefix by themselves. See A site in several languages. Apps that kept the language in their ownlang+folder and have no_localesfolder work as before. To move one over, put the strings in_locales, replace thelang+folder with its contents, delete theLayoutthat checked the language and the hand-writtenhreflangandlang, and drop theAccept-Languageredirect unless you still want it. A top-level folder ofapp/named like a language of the site, and alanginhtmlAttributeson such a site, now fail the build. hooks.tsat the app root exportsonStart(), which runs once before the first render in each VM of the server and in the browser before hydration, for what the whole app sets up once on the JavaScript side, such as i18next formatters or dayjs plugins. It is the JavaScript side ofhooks.go. Another export fails the build, naming it. IfonStartthrows, the program does not start, and in the browser the page stays the HTML the server sent (hooks.ts).- The build fails, naming the file and line, for an i18next formatter written in place in
addoraddCachedthat callsDate.now(),Date(),new Date()without arguments,Math.random(),performance.now(),crypto.randomUUID()orcrypto.getRandomValues()itself. Such a formatter writes another text for the same call, so the server would keep the text of one request for the next ones and the browser would write a different one (i18next cache). - The two sides of the example shop share their data. The first shop of the workbench has the products of the storefront at
/projects/studio/products, where staff change the price, the stock and the title and description in both languages, and the storefront shows a change on its next request: the render memo renders the page again because its data changed, and serves it from the memo after that. The second shop has a product list and edit page of its own. A checkout in the storefront becomes the next order of the first shop (SH-1043and on, where it was a randomSS-number). Every order takes its pieces from the stock of its shop, a checkout and an order staff place alike, and an order of more than is left answers 409. The three comparison apps do the same. - The example shop has
/metrics, the counts oftifa.Stats()in the text format of Prometheus as Deploy writes them, for signed-in staff. A PATCH of a product changes only the fields it sends (one that sends none is refused with 422), and the shop keeps up to 100,000 carts, was 10,000, as do the comparison apps. tifa buildwarns, with file and line, of app code that reads, while rendering, a query parameter the server does not render it with: by its name fromuseLocation,useRouterState,useSearch({ strict: false })or theuseSearchof a route, and the wholesearch,searchStrorhrefof the location.page.tsxandlayout.tsxare checked against the parameters of theirLoadand Layouts, which.tifa/vite.jsnow gives the plugin, other modules warn of every such read, and reads inuseEffectoruseLayoutEffectpass. The server renders with the parameters theLoads read only, so such a read can hydrate differently. The build goes on (Query parameters in the server render).tifa.Stats().Memo.Evictionscounts the pages the render memo dropped, least recently used first, to make room for another, so a memo that is too small for the pages it is asked for shows. The example shop writes it at/metricsastifa_memo_evictions_total(Deploy).- The example shop has a
robots.txt, in itspublicfolder, that keeps crawlers out of the search results and the filtered product lists and lets them into the lists of the categories, the sorts and the pages of a list. The three comparison apps serve the same file.
Changed
- Pages that highlight code with rehype-highlight render faster. rehype-highlight made a new highlight.js with its 37 languages on every render of a Markdown component, and the SSR bundle now keeps one for each
languagesobject. The two article pages of the example shop run 15.9% and 20.0% fewer instructions in a render, with the same HTML. A call with thealiasesoption works as before. See Build. - A URL that matches no route and whose last segment has a file extension (
/wp-login.php) or that has a segment starting with a dot (/.env,/.git/config) now gets the plain text 404 that a missing file under/assets/gets, with noLoadand no render, where it got the 404 page. Scanners ask for such paths by the hundred. A URL that a route matches, a catch-all route included, and navigation data requests are not affected, nor is a route or a public file under/.well-known/, andOnRequeststill runs (404). - The server render takes
URLandURLSearchParamsfrom the engine, which parses URLs in Go, in place of the core-js polyfill the host script carried, so the host script is smaller and a VM holds less. On a site with languages the router makes aURLfor each link it writes, so those pages render in less time, with the same HTML: on one core of an AMD EPYC 7B13, three storefront pages of the example shop take 0.703 of the time and its six workbench pages 0.886. A site without languages makes noURLin a render and gains nothing. What a page can see changes in three ways, each as in a browser: aURLhas no property of its own, a host name that breaks the Bidi rule of UTS 46 is invalid, and an invalid URL throwsTypeError: Failed to construct 'URL': Invalid URL.URL.createObjectURLandURL.revokeObjectURLare gone, as there is noBlob(What the server render has). - The storefront of the example shop sells 150 products, was 28. The new ones are other colours and names of the first 28 and share their photos: a product names the folder of its photos (
photoin its data), and the pages take the photos from there, not from the slug. The products are one file,app/store/products/catalogue.json, which the shop embeds and the comparison apps read too. The product list has 7 pages and each language 150 product pages. - Upgrading from v0.0.4: a page with
const Cacheis no longer kept in the program. ItsLoads run on every request and the render memo skips a render whose data did not change, so the origin never answers old data. The page keeps its anonymous request and the build check, and its HTML still sendsCache-Control: public, max-age=0, s-maxage=<seconds>, stale-if-error=86400for a CDN in front, unlessOnRequest, aLoador aLayoutmade it private. A page withSSR = falseandCacheno longer has an ETag.Cacheis nowtrue,falseor a duration:const Cache = truetakes its time from the new settingcache_control.s_maxage(1mby default,--cache-control-s-maxage,CACHE_CONTROL_S_MAXAGE), and a duration still sets the time of the page. Removed:cache.whole_page,cache.ignore_query(--cache-whole-page,--cache-ignore-queryand their environment variables),tifa.ExpirePages(purge the CDN instead, Tifa has no copy to expire) and theAgeandCache-Statusheaders of such a page. Renamed, with no old names kept: the render cache is the render memo.RenderCache = falseisMemo = false,cache.sizeisssr.memo_size(--cache-sizeandCACHE_SIZEare--ssr-memo-sizeandSSR_MEMO_SIZE),tifa.Stats().RenderCacheistifa.Stats().Memo(CacheBytesandCacheSizeareMemoBytesandMemoSize, the typeCacheStatsisMemoStats, andPageCacheis gone),X-Tifa-Render: cacheisX-Tifa-Render: memo, anddocs/render-cache.mdis docs/memo.md The old names are errors, not silent defaults: aroute.gowithRenderCachefails the build, andcache.size,cache.whole_pageandcache.ignore_queryfail the start (andtifa buildfortifa.yaml), whether they come from a file, a flag or the environment. A redirect from aLoadof a page withCachegets the shared policy too (Cache for CDNs, The render memo). ssr.wait_timeoutnow defaults to3s, was1s, the same asssr.timeout. A request waits at most 3 seconds for a VM and then renders at most 3 seconds, 6 seconds in all for the SSR part, inside the 10 secondserver.write_timeout.OnRequest,Load, encoding, compression and writing the answer share the same timeout, so leave room for them when you raise either value. On a machine where 32 waiting renders take longer than 1 second to run, such as one core with pages that take more than 31 ms to render, a burst used to be answered 503 after 1 second and now waits up to 3 seconds, unlessssr.queue_limitis reached first. Setssr.wait_timeout: 1sto keep the old limit (Render queue).- The SSR bundle of an app on react-i18next 18 no longer prints
tifa rewrite not recognized. react-i18next 18 wraps the i18n object in aProxyinstead of copying it, so the plugin leavesuseTranslationas it is. The end-to-end tests of the i18n app now run i18next 27.0.1 with react-i18next 18.0.0 (The i18next adapter). - The i18next cache of the server render now also keeps the strings of calls that run a formatter or post-processor of the app, which it translated on every render before. The example shop's storefront pages, whose amounts and dates go through its formatters, take 0.937 of the time they took, and 0.778 of the time without the cache, with the same HTML. Such code must give the same text for the same language, options and value, as a React component does for the same props. A formatter or post-processor that reads the request or the time should take that value from the options of
tinstead (i18next cache). - The file where an app defines its own options with
tifa.Stringand the like is nowoptions.go, notconfig.go(see Options of the app). Existing apps: renameconfig.gotooptions.gowith onegit mv. Aconfig.gothat still callstifa.Stringor the like fails the build, naming the file and saying to rename it. What an app defines there is now called the options of the app, and the settings of Tifa are the ones intifa.yaml. - The performance doc and the README now compare with React Router as well as Next.js and TanStack Start, and measure with gzip requested, as browsers do. The new render memo doc says what the render memo is, why it is safe on every page, signed-in ones included, and what Tifa does with cookies, the session and
Authorizationfor each kind of answer. - A client that takes both gzip and zstd, as browsers do (
Accept-Encoding: gzip, deflate, br, zstd), now gets gzip. zstd is sent only to a client that takes no gzip or ranks zstd higher withq. This holds for pages, cached pages, navigation data and everything elseserver.compresscompresses. - The render memo keeps one form of a page: gzip with
server.compresson, HTML otherwise. A page was kept as HTML with a gzip and a zstd copy before, and compressed twice on every miss, which cost about 8% of a miss. Now it is compressed once, a page takes about a fifth of its HTML in the memo, and a hit for a client that takes gzip sends the stored bytes. A client that takes no compression gets the HTML unzipped as it is written, with itsContent-Length, and a client that takes zstd and no gzip, or ranks zstd higher, gets zstd made as it is written. - Server rendering runs on
github.com/liustack/quickjsv0.30.1, the new path of the engine that wasgithub.com/liustack/slowjsfrom v0.28.0 to v0.29.11. The HTML is the same. If an app builds with the engine's build tags,slowjs_intl_nonames,slowjs_intl_nocjdictandslowjs_anygoare nowquickjs_intl_nonames,quickjs_intl_nocjdictandquickjs_anygo. Errors of the engine's root package start withquickjs:where they started withslowjs:. Since v0.30.1 the render timeout (ssr.timeout) also stops a page that is flattening a long string, runningString.prototype.repeat, or compiling a very long regular expression or a very large character class. Compiling a very long regular expression under a timeout could kill the VM before. - Server rendering runs on quickjs v0.30.2, whose register interpreter replaces the stack interpreter of QuickJS. Pages render the same HTML in less time, and each VM holds more memory, since the engine keeps the register code of every function that ran.
WeakRefnow keeps its target to the end of the job, as in Node. - Server rendering runs on quickjs v0.30.3, the second batch of the register interpreter. The HTML is the same.
IntlandTemporalnow throw aRangeErrorfor a very long locale tag or option, where they read it whole, and a destructured array no longer makes an iterator. A closure now holds the value of a variable nothing changes, so aWeakRefto an object only a suspended async function held can empty sooner. - Server rendering runs on quickjs v0.30.5, the third batch of the register interpreter, now built with a profile of page renders. The HTML is the same and pages render in less time: on one core of an AMD EPYC 7B13, the six workbench pages of the example shop take 0.894 of the time they took on v0.30.3, three of its storefront pages 0.905 and three pages of an MUI app 0.885.
{..."ab"}now gives the characters, as in Node.ssr.timeoutnow also stops a call ofIntlon a very long text, a list of locales with a tag longer than 16,384 characters is aRangeError, and a VM that would pass its memory limit with one large block collects garbage first. - Server rendering runs on quickjs v0.30.6, which answers more built-in functions inside the interpreter loop, such as
Array.isArray,push,includes,indexOf,startsWith,Object.hasOwnandhasandgetof aMaporSet. The HTML is the same. On one core of an AMD EPYC 7B13, three storefront pages of the example shop take 0.986 of the time they took on v0.30.5 and its six workbench pages 0.996, and three pages of an MUI app take as long as before. - Server rendering runs on quickjs v0.30.7. The HTML is the same. Timed by quickjs on an AMD EPYC 7B13 as the mean of 16 code layouts, the workbench pages of the example shop take 2.3% less time than on v0.30.6, three pages of an MUI app 1.7% less and the storefront pages 1.6% less. A spread no longer calls
returnon an iterator whose step threw, as in Node, andObject.definePropertywith a descriptor whose getter orhastrap throws now ends with that error. - Server rendering runs on
github.com/liustack/slowjsv0.31.0: the engine is named slowjs again, as it was from v0.28.0 to v0.29.11. The HTML is the same. If an app builds with the engine's build tags,quickjs_intl_nonames,quickjs_intl_nocjdictandquickjs_anygoareslowjs_intl_nonames,slowjs_intl_nocjdictandslowjs_anygoagain, and errors of the engine's root package start withslowjs:. Timed by slowjs on an AMD EPYC 7B13 as the mean of 16 code layouts, the pages of the example shop and of an MUI app take as long as on v0.30.7, within 0.5%, and a long Markdown page takes 8% less. - Server rendering runs on slowjs v0.31.1. The HTML is the same. Timed by slowjs on an AMD EPYC 7B13 as the mean of 16 code layouts, the workbench pages of the example shop take 1.5% less time than on v0.31.0 and three pages of an MUI app 1.1% less, and the storefront pages take as long as before. Known limit, until the next release of the engine: a very long Markdown page, one that compiles thousands of regular expressions a render, takes about 3% more time, and in the engine's own test a process that rendered it after a shorter page peaked at 460 MB where it peaked at 258 MB. A power of two prints its shortest digits, as in Node:
2 ** -44is5.684341886080802e-14, where 54 such numbers printed one digit too many.Object.isFrozenandObject.isSealedaskisExtensiblefirst, as the specification says. tifa newpinsgithub.com/liustack/sqlitev0.1.4. v0.1.3 fixed a nil pointer panic when one commit groups more than 64 different SQL statements, common when values are written into the SQL text. v0.1.4 brings group commit and fixes from a full review and for Windows, and one rule changed: with named arguments, every parameter number up to the largest needs a value, as with positional ones (SELECT ?2, :xneeds?1too). Existing apps:go get github.com/liustack/sqlite@v0.1.4.- The example shop's storefront no longer uses
const Cache(it is gone from its five pages), so the browse comparison runs one Tifa. Its pages are answered by the render memo alone, and every request runs itsLoad. The shop README says so. - The browse comparison plays one scenario, the shop with shoppers and staff in one mix. The scenario with twice the staff visits and product edits is gone, and so are
SCENARIOSand-scenarios. The staff share stays a row of the mix table of the report. - The browse comparison has a fifth row in its throughput and latency tables: Tifa with its render memo off (
--ssr-memo-size 0), which keeps no finished render but may still answer navigation data with no render, share a render in progress and answer 304, marked as a reference and not compared. It runs by default, with the same data and checks as the others. - The throughput and latency tables of the browse report name in bold each server that compressed no answer, with the body it sent a page view against the frameworks compared that did, from the rounds. TanStack Start, whose Nitro server sends its answers uncompressed as it ships, is measured as it ships.
- The appendix of the browse report splits the answers of Tifa, by kind of page, into those from the render memo, those that shared a render in progress and those rendered in a VM, and these into the first request of a URL in the round, a URL it had answered before (as the client tells by URL), and the private pages with and without a cart cookie, with the limits of a split made on the client.
- The visits of the browse comparison see 4 page views each on average, one full load and three clicks, exactly in every block, from about 4.3 page views a session (Contentsquare 2025) with a click counted as a page view. The lengths are geometric, from 1 to 12. Before, a visit saw 2.6 page views and at most 5. The adds to the cart and the checkouts are the same share of the visits.
- A browse run asks each Node app, before its first round, for the documents and the navigation data its traces replay, twice each, and stops when an answer carries a sign that a cache could keep it (an
ETag, aLast-Modified, a positivemax-ageor a Next.js cache header). - A browse report that does not come from a formal run (settings other than the defaults, no pinning, not run by
browse.sh, or not every server) says so at the top, with every way it differs. - The example shop keeps its orders with indexes and running totals that every write updates, so the order list, an order and the stats read their data in about the same time with 50 orders or 5000. Before, every read copied and sorted all the orders of the shop. A filter, a search or the sort by amount still goes through all of them. The order page no longer repeats how each carrier did for the shop, which the stats page shows.
- The server render of a page sees the path and the query parameters its
Loadand the Layouts above it read, sorted by name, and the render memo and the ETag are keyed by the same. Other parameters, such asutm_source,fbclidor a random one, no longer make a new memo entry and render, and another order of the parameters is the same page. The address bar keeps every parameter and its value, andOnRequest, theLoads and the navigation data still see the whole URL. Upgrading: a component that reads, while rendering, a parameter noLoadreads now gets nothing on the server and hydrates differently. Read that parameter in theLoad, and in the component by its name (Query parameters in the server render). - Server rendering writes out more calls of small functions, with the same HTML: also those whose body has expression statements before its return or an if that throws, and up to 64 syntax nodes, was 32. React DOM runs several such functions for every hook a component calls. A render runs 0.66% fewer instructions on the example shop's workbench pages, 0.29% on its storefront pages and 0.77% on the MUI test app. The SSR bundles grow by about 0.6%, and an error thrown by such a function shows the place of its call, one frame less in the stack. See Frontend output.
- Server rendering calls React's hooks with one function call less, with the same HTML. React 19 exports each hook as a function that only hands its arguments to the dispatcher React DOM sets for a render, and the SSR bundle now calls the dispatcher directly:
React.useRef(v)becomesReact.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.H.useRef(v). The plugin reads which hooks have that form from React'sreact.production.js, and prints a warning and changes nothing when the file has another form. A render runs 0.28% fewer instructions on the example shop's workbench pages, 0.24% on its storefront pages and 0.44% on the MUI test app. The SSR bundles grow by about 2% to 3%, and a hook called outside a render throws the sameTypeErrorbefore its arguments are worked out. See Frontend output. ssr.vmsdefaults to the CPUs the process may use, at most 4, no longer one VM for each CPU however many. A container with a memory limit and no CPU limit sees every CPU of its host, and loaded a VM for each. An app on more than 4 CPUs that wants one VM per CPU, as before, sets it, such asssr.vms: 8orSSR_VMS=8. A value an app sets is used as it is.
Fixed
- A client that left in the middle of a request is no longer reported as an error of the app. When the request's own context was canceled, a page with
Memo = falsethat waited for a VM, aLoadthat returnedcontext.Canceled, and a write to a closed connection no longer reachOnErroror the error log. Acontext.Canceledfrom somewhere else while the client is still there is still an error. - The temporary files of a multipart upload over 32 MiB stayed in the temp folder when the request was a copy of the one net/http made, as on a site with languages and behind a middleware that calls
r.WithContext. They are now removed when the request ends, whichever request the form was read on. - An answer that failed after part of it was written, such as a streamed reply that broke off or a download that stopped, used to end as if it were whole: the browser,
curland any proxy took the cut-off body for complete. The connection is now cut (reset over HTTP/2), so the reader gets an error.OnErrorstill hears of the failure once, and the log line stays. - The build changes seroval 1.8 again. seroval 1.8.0 moved its code out of
dist/index.jsinto files beside it, so the plugin no longer found the two places it changes, printedtifa rewrite not recognized: seroval 1.8.1twice, and an app with newly installed packages wrote the data of its pages the slow way. The plugin now looks in every file of seroval that the bundle loads. - A small function whose call the SSR bundle writes out no longer reads a variable, a property or a name of the global object before an argument with effects that the call worked out first.
function f(x) { return n + x }called asf((n = 2, 0))gave 1 where the call gives 2, and a getter in the body ran before the argument, or threw before it ran. Such a call now stays: before the last argument with effects the body may only use parameters, compare with===or!==and read names of the module that are set once and surely set at the call (Frontend output). - The search box in the header of the example shop's Chinese storefront searches the Chinese list (
/zh-CN/store/products?q=). It sent the visitor to the English one. - The pages of reviews on a product page of the example shop's Chinese storefront link to the Chinese URLs (
/zh-CN/store/products/<slug>?reviews=2). They linked to the English page. - The redirects the router makes while rendering a page (
/%61to/a) are now kept by the render memo like other pages, so a repeat is a hit (X-Tifa-Render: memo) and not a render. A 404 page and the page of a failedLoadare rendered for each request and not kept, so random URLs do not fill the memo, and requests for the same one at the same time share one render. They carry noETag, andOnErrorsees every failure (The render memo). - A missing file under
/assets/, such as a chunk of an older build that a tab opened before a deploy asks for, now gets a plain text 404 withCache-Control: no-store. It used to go throughOnRequest, run theLoads of the root Layout and render the app's 404 page (Page requests). - A page larger than
ssr.memo_sizeis compressed once: a client that takes gzip gets the form made for the memo, which was thrown away and made again before. The key of every render no longer copies the data it hashes, about 98 KB less garbage a request for 92 KB of data (Optimizations). - The SSR bundle of an app on i18next 27 no longer prints
tifa rewrite not recognizedforfixedT,looksLikeObjectPathandcreateCachedFormatter. The first two are sped up as in 26. i18next 27.0.1 bounds its formatters itself, so the plugin leaves them, and 27.0.0 gets the plugin's bound.build.i18next_cachenow works with i18next 27.0.0 and 27.0.1 as it does with 26, andhydrateempties the cache of its instance (i18next cache). - The i18next cache of the server render no longer gives the text of an earlier call to a later call that differs only in an option under a Symbol key, which a post-processor can read. A call with such an option is not kept (i18next cache).
- A server that formats many different amounts, dates or names with i18next no longer grows without end. i18next keeps a formatter for each value it formats through
number,currency,datetimeand the other formats, and through those added withaddCached, and never lets them go (i18next/i18next#2227): 20,000 new values took 28 MB in a VM, which the server then replaced. The SSR bundle now keeps at most 1,024 for each format, with the same text (i18next). - A route that writes several meta tags of one name in its
head, such as atheme-colorfor light and one for dark mode or severalog:image, now gets all of them on the page. Only the last one was kept, so a page in light mode showed the darktheme-color. A deeper route that writes the name still replaces them all. - The render memo held up to twice the memory of
ssr.memo_sizewithserver.compresson: it counted the length of the compressed pages but kept the larger buffers they were made in, and left out the Content-Security-Policy of each page. It now keeps exactly sized copies and counts what it keeps, so the live heap of the cache stays withinssr.memo_size. The peak memory of a program that fills the cache with writes drops with it. - The 308 the server sends for another spelling of a URL (
/%6Eews?utm_source=mail&page=2,/news/?page=2) keeps the query parameters the render did not see. The render memo also keeps the redirect for each spelling of the parameters it saw, and every request gets its own parameters back. - On a site with languages, a page opened with a query the router spells another way, such as
?q=a%20b,?next=%2Faor a key given twice around another, no longer asks for its data again right after it hydrates, and under a language prefix keeps that spelling in the address bar. The router replaced it with its own (?q=a+b,?next=/a). A site without languages never did either. A URL that differs in its path still goes to the router's own. - A page with
SSR = falseopened with a key given twice around another (?x=1&y=2&x=3) takes its first data from the document again. It asked the server for that data once more, with one language or several. tifa genandtifa checkno longer break a runningtifa dev. They wrote.tifa/as a build does, which replaced themain.goand the reload client oftifa dev, so the app did not start after the next Go change. Whiletifa devortifa buildruns in the app,tifa gennow leaves.tifa/alone and prints one line saying so, andtifa checkstill checks the app but writes nothing into.tifa/(seetifa gen).tifa build,tifa genandtifa checkstart Node with the Vite driver as a file, no longer as an argument ofnode -e, which Windows refuses above 32,767 characters.tifa devbuilds the SSR bundle again when a file that it read changes, whatever the type, such as a Markdown or YAML file imported with?raw. It rebuilt only for.ts,.tsx,.js,.jsx,.mjs,.cssand.jsonfiles, so the server render kept the old text while the browser showed the new one (What each change triggers).- A
tifainstalled globally, which hands the command to the version the app pins, now reads a relative--diror-ofrom where you typed the command. It read them from the root of the app, sotifa build --dir apps/shopfailed from the parent folder and-o bin/xwrote into the app. - A Go panic while the server loads a new VM in the background, or closes one, no longer ends the process. The engine turns a fault into a panic. A load is now retried as a failed load is, and a close counts as a failed close, which shutdown reports.
- A
FinalizationRegistrycallback runs right after the collection between renders that queued it, under the time budget and memory limit of a render, and no longer in the render of the next request, which a callback that threw made fail. One that throws or runs out of time now retires its VM and is logged. A callback of the bundle's own top level code runs when the VM loads. i18n.toftifa/i18nin theheadof a route translates in the language of the page. On the server it used the language of the last page the VM rendered, or none in a fresh VM, which gave the key, and the render memo kept that title. In the browser the title became the key once the page hydrated.
[0.0.4] - 2026-11-05
Added
- A field of type
*multipart.FileHeaderor[]*multipart.FileHeaderin the input of a POST, PUT or PATCH handler holds uploaded files. The generated function takes them asBlob | nullandBlob[]and sends the input as a multipart form, so a page uploads a file as it sends any other input, withValidate,tifa.FieldsandTifaErroras usual. A JSON body for such an input gets 415 (see Files in the input and Uploads). BodyLimitandReadTimeoutin aroute.go, constants or variables such as a setting of the app, replaceserver.body_limitandserver.read_timeoutfor the requests its method handlers answer. The read time is lifted beforeOnRequest, and the answer getsserver.write_timeoutafter it (see Body limit and read time of a route).- A request body that does not arrive before the read deadline is answered with 408, no longer with 400.
tifatest.File(t, name, data)gives the*multipart.FileHeaderof a file, for a test that calls a handler orValidatewith an input that holds one.route.genexportsPageSearchandLayoutSearch, the query parameters theLoadorLayoutof the folder reads, and the route gets them, soLink,navigateanduseSearchknow them: every value astringorstring[]when read, since a key can come more than once in a URL (c.Queryin Go takes the first), every key optional, and other keys open. Only the types change: nothing runs on the query in the browser (see Query parameters in Link and navigate).tifa.Secret("smtp.password", "SMTP password")defines a setting of the app for a password, a token or a key. It comes from the environment,.envor the file of-c, a flag for it stops the program and says where to put it, and./bin/app configwrites where it came from and not its value. The email guide uses it.server.csp: onsends a Content-Security-Policy that lets only the site's own scripts run. Tifa adds the hashes of the inline scripts it writes into a page to the policy of that page, so pages hydrate, and the render cache, the whole-page cache and ETags work as before.server.csp_policychanges the policy, andreport-onlyonly reports (see Content-Security-Policy).tifatest.Start(t, tifaapp.App)runs the whole app ingo testand returns an*httptest.Server, so a test can walk through what a browser does: open a protected page and get the redirect, sign in, see the session cookie, and read the page.OnStart,OnRequest, decoding,Validate, sessions, redirects andOnErrorrun as in the program,OnShutdownruns when the test ends, and the client keeps cookies and does not follow redirects. Without a front end, pages answer the data of their Loads as JSON by route ID.tifatest.StartPagesalso renders the pages with the front end oftifa buildortifa dev, on at most two VMs in the test binary, which later tests with the same build reuse, and fails the test when.tifa/distis missing or a file it was built from has changed since. Import the app from a test in a package of its own, such aspackage login_test(see Testing a whole request).tifa buildandtifa devwrite.tifa/dist/inputs.json: a hash of each file the front end was built from, whichStartPageschecks.
Changed
- A
multipart.FileHeaderanywhere but in a field of a POST, PUT or PATCH input, such as in a result, the data ofLoador the session, fails the build. Aroute.gothat declaresBodyLimitorReadTimeoutwith another meaning, or without a method handler, fails the build too. - A value other than a string for a query parameter that Go reads, such as
search={{ page: 2 }}, is now a type error. Writepage: String(n): the router wrote it as text anyway. - Every answer now carries
Referrer-Policy: strict-origin-when-cross-originandContent-Security-Policy: frame-ancestors 'self', next toX-Content-Type-Options: nosniff. Another site can no longer show the pages in a frame: change the header inOnRequestfor pages that a partner shows (see Security headers). tifa newpinsgithub.com/liustack/sqlitev0.1.2, which builds with Go 1.26.6 to 1.27 and stops the build on a newer Go. After upgrading Go, upgrade the driver too.- The generated table of routes moved from
.tifa/routes.gointo the package.tifa/tifaapp, astifaapp.App, so tests can import it..tifa/main.goservestifaapp.App. A test that imports it needs.tifa, so in a fresh checkoutgo vet,go testandgo mod tidyfail untiltifa check,tifa buildortifa devhas run.
Fixed
- The docs said a page or Layout remounts when a query parameter its
Loadreads changes. It never did, and now the docs and the generatedremountDepssay what happens: a route remounts for a path parameter it reads, and another query loads the data again and keeps the component and its state, as TanStack Router does by default. State set up fromLoaddata follows a new query only through akeyor an effect of the app. - A slice type that reads and writes itself as text, such as
type Tags []stringwithMarshalTextandUnmarshalText, in a GET or DELETE input or a form input with files, passed the build: TypeScript sent it as one string such as"a,b", Go put that string in one element without callingUnmarshalText, and a slice of numbers got 400. It now fails the build, like a field whose element has those methods.c.BindQueryand the decoding of an input with files return an error for such a field whatever the request holds, and a form sent to an input that also takes JSON answers 400 for a value of such a field instead of filling it wrongly (see Method handlers with input and result). - Under systemd socket activation with HTTPS,
server.addrmay stay unset when systemd passes its socket. The program refused to start on the default address, which it does not listen on then. - With HTTPS on, the plain HTTP address
server.http_addrnow reads and writes underserver.read_timeoutandserver.write_timeout, likeserver.addr. It kept 10 seconds whatever they said. - A handler under
tifatest.NewCtxthat wrote a 1xx status, such as103 Early Hints, beforeSetSessionand its answer left the recorder with the 1xx and without theSet-Cookie:httptest.ResponseRecordertakes any status as the final one. The recorder now keeps 1xx statuses out, as the server sends them before the answer. - The test in Sign-in read two requests from one recorder, whose
Result()keeps the headers of its first call, so it never saw the cookie of the second. It now makes aNewCtxper request.
[0.0.3] - 2026-11-05
Changed
- The
tifa newtemplate uses the SQLite drivergithub.com/liustack/sqliteinstead ofmodernc.org/sqlite. It is pure Go and needs Go 1.27 or later, on Linux and macOS (amd64 and arm64) and Windows (amd64). Moving an app over frommodernc.org/sqliteneeds two checks. The driver rejects DSN parameters it does not know, so_foreign_keys=1and the like must become_pragma=foreign_keys(1). And double quotes in SQL only name columns and tables, so a string value written as"text"must become'text'. Both drivers register the namesqlite, so remove the old import completely.
[0.0.2] - 2026-11-04
Added
tifa.ExpirePages("/blog/"+slug, "/blog")has the whole-page cache make those pages again on their next request, for every query string, host and scheme of each path. Call it after a write that changes what pages withCacheshow. A page made from data read before the call is not kept, and the old page still stands in when making the new one fails. It clears the memory of the program only, not a CDN in front (see Making a page again after a write).tifa.Stats()returns the VM pool (VMs loaded, rendering and waited for, renders, failed renders, their time, and renders refused with 503) and the hits, misses, shared makes and entries of the render cache and the whole-page cache, with the bytes they hold. Renders and cache lookups count with atomics and take no new lock. Deploying shows a health check route and a route that writes the numbers for Prometheus without a library, and what to read in them.server.read_timeoutandserver.write_timeout(flags--server-read-timeoutand--server-write-timeout, variablesSERVER_READ_TIMEOUTandSERVER_WRITE_TIMEOUT) set the time to read a whole request and the time to write its answer. Both stay 10s by default. A handler that streams or takes a large upload lifts them for its own request withhttp.NewResponseController(w), which reaches the connection through Tifa and the compression (see Long requests).tifa.ShuttingDown(ctx)returns a channel that closes when the program starts to stop. A stream with no end of its own, such as server-sent events, returns when it closes, so a stop no longer waits the wholeserver.shutdown_timeoutfor it.- Under systemd socket activation the program serves on the sockets systemd passes it (
LISTEN_FDS), so a restart keeps the port open and queues new connections instead of refusing them. With HTTPS, the two sockets are told apart byFileDescriptorName=server.addrandFileDescriptorName=server.http_addr. Without these variables nothing changes. Deploying has the.socketand.serviceunits. - The
tifa newtemplate keeps sessions in its SQLite database (sessions.go, set withtifa.SetSessionStoreinOnStart), so a restart no longer signs everyone out. tifatest.NewCtxtakes the deadlines a streaming handler sets throughhttp.NewResponseController.- Streaming shows server-sent events and an answer streamed piece by piece, with the browser code, the caches, the stop and a test.
Changed
- Answers with
Content-Type: text/event-streamare sent uncompressed. A compressed stream held an encoder of about 1 MiB for gzip for as long as it stayed open. Other streamed answers are still compressed and still flush.
Fixed
- A page with
Cachethat a content entry expired early, sent as the old page because making the new one failed, kept thes-maxageof its whole time, so a CDN in front counted it as fresh until that time ran out. Itss-maxageis now no larger than itsAge. - A built program given a flag it does not know, such as
--addrfor--server-addr, started with the defaults as if the flag were not there. It now stops withunknown flag: --addr. Flags of the settings of the app still work, and other environment variables and other keys of a file are still left alone.
[0.0.1] - 2026-11-04
Added
-
Content collections: an app keeps posts, docs and other writing as Markdown files under
content/and reads them in Go as typed values.content.goat the root declares each collection,var Blog = content.Define[Post](content.Source{Dir: "blog", Languages: []string{"zh-CN", "en"}}), wherePostembedscontent.Entryand its json names are the front matter keys. A folder with anindex.mdis one entry with the files below it (a page bundle), every other.mdfile is an entry, andMatchnarrows the choice.Blog.All(),Blog.In(lang),Blog.Get(lang, id)(tifa.ErrNotFoundwhen there is none or the entry cannot be seen yet) andBlog.Languages()return the entries with their ID, slug, path, date, translations and word count.tifa buildandtifa checkcheck the declarations, the files and every front matter (required keys, types, keys that are not fields with the nearest name, slugs, duplicate IDs and paths, links that lead out of the collection,.mdxfiles), and fail on a folder ofcontent/that no collection reads, also in an app withoutcontent.go. Entries without a version in some language get a warning. The program runs theValidatemethod of each entry beforeOnStartand does not start when one fails. Tests read the content withtifatest.LoadContent(t)or set it withtifatest.SetContent(see Content). -
The bodies of content entries become HTML at build time.
entry.Body()returns the HTML of an entry astifa.HTMLfor<HTML>, andentry.Headings()its headings with theideach has in the HTML, for a table of contents. The conversion runs in the Vite plugin with unified and needsunified@11 remark-parse@11 remark-gfm@4 remark-rehype@11 rehype-raw@7 rehype-stringify@10in the app, and the build says which to add. It reads GitHub-flavored Markdown, keeps the HTML written in it, drops HTML comments and gives headings the ids of GitHub. Apps add their own plugins withtifa({ markdown: { remarkPlugins, rehypePlugins } })invite.config.ts. Images and other files the body points to with a relative URL are found next to the entry or next to its version in the default language, and are served from/assets/with a hash in the name. A relative link to a.mdfile, a missing file and a file outside the collection fail the build. The bodies are put into the program underdist/content/and never served by themselves. An app without pages, such as one whose only route writes a full-text feed, converts too, with the plugins of itsvite.config.ts. Ingo test,Body()returns a placeholder that names the entry andHeadings()returns nil (see Markdown to HTML). -
Drafts and dates of content entries. An entry with
draft: trueis not converted and is not in the program. An entry whosedateis still to come is in the program but hidden: it comes out at its date while the program runs, without a new build or a restart, and from that momentAll,InandGetreturn it and theTranslationsof its other versions list it. A date alone is midnight UTC, and a timer that wakes at least once a minute also catches a clock that was set or a machine that slept. Pages withCachemade before that moment are made again by the next request, so a list of posts shows the new one at once. The program logstifa: content: blog en/202611/release-notes is published (date 2026-11-20 09:00 +08:00), andtifa buildandtifa checklist the entries that wait for their date.tifatest.SetContentTime(t, tm)has a test see the entries oftm. Undertifa devboth drafts (withDrafttrue) and entries whose date is still to come are shown, so a writer sees them in lists and on their pages (see Drafts and dates). -
tifa devfollowscontent/: a change of a Markdown file, its front matter or a file next to it, such as an image, rescans the content in Go, converts only the entries it touches and has the running app load them, without go build or a restart. The app runsValidateagain and takes the new content, the whole-page cache expires, and open pages reload. A change ofcontent.goor a schema type, or ofvite.config.tsand its plugins, converts every entry. A front matter error, an undeclared folder or a plugin error shows the message oftifa buildin the overlay, and an entry that failsValidateshowsThe app did not load the content, while the app keeps the content it had, with its old bodies (seetifa dev). -
A field of type
tifa.HTMLholds markup the app trusts, such as an article turned from Markdown into HTML, and<HTML value={post.body} as="article" />oftifa/clientshows it, in one of the elements of ordinary contentastakes. Its TypeScript type isHTML, notstring. A page the server renders carries each value once, in its markup, and its hydration data a small marker, so a long article is not sent twice. Navigation data and pages withSSR = falsecarry the string.tifa.HTMLcannot be a map key, a handler input, in the session or the whole result of aLoadorLayout. Sanitize HTML from users before you convert it (see Showing HTML the app trusts). -
Links inside
<HTML>go through the router like aLink: a click on a link to a page of the app shows it without loading the whole document, and a hover or a focus of 50 ms, or a touch, preloads it. The browser still follows links with a modifier key,target,downloadorrel="external", links to other sites and schemes, a#hashof the same page, public files,/assets/,/__tifa/and paths without a page such as API routes. Handlers of the app on<HTML>run first and keep the router out withpreventDefault(see Showing HTML the app trusts). -
New
go tool tifa errorsprints the errors since the last build of thetifa devthat runs in the app, so a coding agent that sees neither the browser nor the terminal can check a change: a build that failed or an app that did not start, stopped or did not load the SSR bundle, unexpected request errors with the status, the message users see and the stack trace in your sources, the errors of the browser that open pages had (hydration mismatches, uncaught errors, unhandled rejections) with the page, and pages whose two renders differ. Each kind keeps the last 20 with a count for repeats, a build drops what came before it, and a run during a build waits for it. It exits with 0 without errors, 1 with errors and 2 when notifa devruns, and--jsonprints every field. The dev client now sends the errors of the panel totifa devas well. Built apps have none of this. TheAGENTS.mdthattifa newwrites tells agents to run it (see Tifa errors). -
Apps define their own settings in
config.goat the root:var DBURL = tifa.String("db.url", "app.db", "Database file"), andtifa.Strings(comma-separated text),tifa.Int,tifa.Bool,tifa.Durationandtifa.Size. Each returns a plain value, read from the flag--db-url, the variableDB_URL,.envand the file of-clike the settings of Tifa, and the default ingo test. A bad value stops the program beforeOnStartwith every other bad value../bin/app configlists the settings of Tifa and of the app with their values and where each value comes from.tifa buildfails on a call anywhere else, on a key that is no string literal or no valid key, and on two settings with the same flag or variable (see Settings of the app). -
The program reads the file
.envin the folder it runs in, below the real environment variables. One file per machine, no variants, not put into the program. Undertifa devthe app reads the.envof the app root, and a change of it restarts the app without a build (see .env). -
The program reads
PORTandHOSTof hosting platforms forserver.addr, belowSERVER_ADDR.PORTalone listens on every interface, as Cloud Run and the like need (see PORT and HOST). -
-cis the short form of--config. -
A second
tifa devin the same app no longer starts Vite and fails with a bareaddress already in use. It printstifa: tifa dev is already running in this app at http://<address> (pid <N>)and exits with an error.tifa buildstops the same way while atifa devruns, since both write.tifa/dist. Without--addr, a taken port 9527 movestifa devon to 9528 and up (ten ports in all), and a taken--addrfails with the address in the message. The lock is the file.tifa/dev.lock(seetifa dev). -
tifa devshows errors of the browser in a small panel in the corner of the page:Hydration mismatch(with React's diff and the component stack),Recoverable error,Uncaught errorandUnhandled rejection. The same error again raises a counter, the panel keeps the last 20, and each can be dismissed. The panel leaves the page usable, and the overlay of a build error stays on top of it. Built apps have none of this code (seetifa dev). -
A fresh clone of an app now says what to do.
tifa devandtifa buildstop at once with the command to run (pnpm installwhen pnpm is on PATH,npm installotherwise) when the app has apackage.jsonand Vite is not installed, wheretifa buildprintedVite is not installed in the application, install it with: pnpm add -D vite @vitejs/plugin-react, advice that was wrong for an app that already lists Vite, andtifa devshowed the same text in its overlay. An app without pages has nopackage.jsonand is not checked. The README of an app made bytifa newhas a line on what to run after cloning (seetifa dev). -
tifa docsprints where the docs of the Tifa version the app uses are, found withgo list -mso areplaceworks too, and an index of them in the format ofscripts/docs-list.sh: each doc's summary and when to read it. TheAGENTS.mdthattifa newwrites tells a coding agent to rungo tool tifa docsfirst and no longer links to the docs on GitHub's main branch, which may be another version than the app uses. The part ofAGENTS.mdthat Tifa writes sits between<!-- tifa:begin -->and<!-- tifa:end -->, with the notes about the app itself under## This appafter it (see Tifa docs). -
tifa checkruns every check of an app with one command: the analysis of the routing conventions, the code generation,go vet ./...,go test ./...and the TypeScript type check, with thetscthe app installs (npm and pnpm both work), and stops at the first step that fails with an error that names it and a non-zero exit status. An app without pages skips the TypeScript step and needs no Node (seetifa check). TheAGENTS.mdthattifa newwrites names this as the one command to run before finishing a change, in place of the separate test and type check commands. -
A folder can hold
layout_.tsxin place oflayout.tsx. Its pages, and the pages below it, show without any Layout above it, the root Layout included, and theLayoutfunctions above do not run for them, neither for a page, nor for the navigation data of the browser, nor for the 404 of a URL below it. The root Layout'shtmlAttributesanddocumentHeadandOnRequeststill apply. TheLayoutin its folder gives it data, Layouts below it nest inside it, and when it fails the framework's default page shows. The build fails forlayout_.tsxinapp/, forlayout.tsxnext tolayout_.tsx, and fortifa.Useof a Layout that alayout_.tsxdrops (see A Layout without the Layouts above). The storefront of the example shop uses it, so its pages no longer carry the root Layout's empty workbench data, a URL that matches no page shows the shops in the workbench sidebar, and a language the store does not have shows a 404 of the store in Chinese and English. -
A site in several languages in docs/app.md: the language folder, checking the language in its
Layout,langandhreflangin itshead, the redirect of the URL without a language and loading the translations synchronously. The storefront of the example shop follows it:/storeredirects to/store/zh-CNor/store/en-USby the browser'sAccept-Language, and its page for the rest of the path is gone. -
A package may import a Node module it uses only on Node, such as
node:fsfor code a render never reaches, and the app loads and renders. Each imported name is a stand-in that throws when a render uses it, with the export, the module, the package and the place in its source. The bundle used to turn such an import into arequire, which failed as each VM loaded it, even when only animport()reached the module.tifa buildstill lists the Node modules left in the SSR bundle (see Packages that import Node modules). -
A component that suspends on work promises settle by themselves, such as a
React.lazycomponent of a module in the bundle oruseof a promise, renders on the server: the server waits for it and writes the page whole, as the browser shows it once loaded. Such a page used to fail with the error that a component suspended. Work that waits for a timer or a request still fails with that error. Pages that do not suspend render the same HTML in the same time (see Components that wait). -
AsyncLocalStoragein the server render, as a global and fromnode:async_hookswithAsyncResource, as Cloudflare Workers has them:run,exit,getStore,bindandsnapshot. A store followsawaitand promise callbacks. fumadocs, which keeps the state of a page in one, now builds and renders with no setting but its owncollectionsalias. -
Packages and page code may use top-level
awaitin the server render, as fumadocs-mdx does for its collections. A build with one used to fail. Each VM waits for it while it loads, before its first render. It must settle with promises alone, such asawait import()of a module in the bundle: one that waits for a timer or a request never settles, and the VM fails to load. -
The server render keeps the strings i18next translates and gives them again for the same key and options. The example shop's storefront pages take 0.798 of the time to render, with the same HTML. It is on by default, and
build.i18next_cache: falsein the project file turns it off. Calls that run a formatter or post-processor of the app translate each time, as do all calls of an instance made withcloneInstance, so such code may read the request. An app that changes i18next's resources or options without i18next's API after the first render, or gives i18next other functions that read the request, such as anoverloadTranslationOptionHandler, should turn it off, or pages may show stale translations. For an i18next whose code the plugin does not know, the build prints a warning and the bundle is the one without the cache (build.md). -
The SSR pool replaces VMs whose live memory after collection has grown too far from their warmup baseline. It loads one spare at a time while the render queue is empty and exchanges it only with an idle VM, keeping render capacity during loading. Failed loads keep the old VM and retry with backoff. Allow memory for one extra VM during replacement, see Memory.
-
tifa.WithRenderClock(ctx, now)gives one server render a fixed or controlled clock shared by Date, Temporal.Now and Intl. The clock is cleared before VM reuse, and also applies to replacement VMs. Production keeps the live clock by default. Module initialization still runs during prewarming. -
SSR VMs provide Temporal and
Date.prototype.toTemporalInstant, installed on first use.Temporal.Nowuses the live system clock and defaults to UTC, consistent with Date and Intl. Temporal locale formatting uses Intl. Browser support is still the app's responsibility. -
The SSR VM provides
atob,btoa,DOMException,crypto.getRandomValues,crypto.randomUUIDandstructuredClone. Random bytes come directly from Go before or during rendering, including module loading. The host APIs retain the built-ins they use across VM reuse. getRandomValues rejects views on shared or resizable buffers with TypeError. Cloning preserves cycles, shared references and common JavaScript built-ins. Transfer, SharedArrayBuffer and views on resizable ArrayBuffers remain unsupported. Unlike browsers, transparent proxies of ordinary objects and arrays are cloned through their traps. There is nocrypto.subtle. -
SSR waits are bounded by
ssr.queue_limit(32) andssr.wait_timeout(1s). A full queue or an expired wait answers 503 withRetry-After: 1andCache-Control: no-store, without using a VM or callingOnError. Apps can match the rejection witherrors.Is(err, tifa.ErrSSRBusy).ssr.timeoutstill limits execution only. -
The HTML of a page preloads the chunks of its Layouts and route with
<link rel="modulepreload">right after the tags of the build, so they download alongside the entry script. When aLoadfails, it preloads only the levels the router shows.build.jsonlists the chunks underpreload. -
HTTPS from the program itself, off by default.
server.tls_domainsgets and renews certificates from Let's Encrypt, kept inserver.tls_cache.server.tls_certandserver.tls_keyserve your own certificate and load it again when the files change, without a restart. With HTTPS on, browsers get HTTP/2,server.http_addr(:80) answers Let's Encrypt and redirects the names HTTPS has a certificate for to HTTPS with 308, andserver.hstsadds Strict-Transport-Security. HTTPS on the defaultserver.addrrefuses to start and says to setaddr: :443, and another loopback address starts with a warning.tifa devstays on plain HTTP. -
The example app has a storefront for customers in Chinese and English under
/store: product search and filters, product pages, a cart, a checkout form, and a journal written in Markdown with highlighted code. -
A route's
headcan returnhtmlAttributes, the attributes of<html>for its pages, such aslangon a site in several languages. They merge over the root Layout'shtmlAttributesone attribute at a time, the deepest route winning, andnulltakes one away. The browser keeps them in step after each navigation, also on pages without SSR. It writes an attribute only when the value Tifa wants for it changes, and takes away only attributes Tifa wrote, so a class orlangthat a script of the page set stays until a route wants another value. Apps that do not use it get the same HTML, and in the browser Tifa still leaves<html>alone after the first render, whatever scripts of the page change on it. The example storefront sets its language this way, and a path it has no page for is a 404 in the language of the URL.
Changed
- Breaking: Tifa writes and reads the JSON of apps with
encoding/json/v2(the data ofLoadandLayout, the arguments and results of handler functions,c.JSON,c.Bindand sessions). The generated TypeScript types follow it. What changes for apps (see JSON rules):- A nil slice is written as
[]and a nil map as{}, where both werenull. Their TypeScript types lose| null, sodays?: string[] | nullisdays: string[]. - A
[N]bytearray is a base64 string, as[]byteis, where it was an array of numbers. A slice or array whose element is a named byte type stays an array of numbers. - A type whose
MarshalTexthas a pointer receiver is written as a string wherever it sits, also as a value in a field or slice, where only pointers to it were. Such types may be map keys. omitemptyleaves out onlynull,"",[]and{}, so it no longer dropsfalseand0. Useomitzeroto leave out zero values.- The
stringoption is accepted only on number fields. - The build rejects
time.Duration, also as a map key, which json v2 cannot write. Return a number in the unit you want, or a string. - The build rejects structs json v2 would fail on: two fields with the same JSON name in one struct, an unexported field with a json tag, a struct with fields but no exported field and no tag, an embedded field of a non-struct type without a JSON name, and an embedded struct with tag options or with JSON or text methods.
<,>and&are written as they are in JSON answers and page data, where they were<,>and&. Where Tifa puts JSON into the page HTML it still escapes them.- Bytes in a string that are not UTF-8 are written as U+FFFD, as before.
- Reading is strict.
c.Bindand handler arguments answer 400 for a name that matches a field only in another case, a name twice in one object, a string that is not UTF-8, a time that is not RFC 3339, base64 with line breaks, or an array of the wrong length for a Go array. - A session record kept in an outside store that does not read back under these rules signs the visitor out.
GOEXPERIMENT=nojsonv2is not supported.- The JSON of
tifa routes --jsonandtifa errors --jsonhas[]in place ofnulland no<escapes.
- A nil slice is written as
- Breaking: environment variables of settings have no
TIFA_prefix:TIFA_SERVER_ADDRisSERVER_ADDR,TIFA_SSR_VMSisSSR_VMS.tifa devgives the app its address inSERVER_ADDR. To update a deployment, drop the prefix from each variable. - Breaking: the program reads only its own settings. A file key, an environment variable or a flag that is no setting is left alone, where an unknown key or
TIFA_*variable stopped the program. A misspelt name now changes nothing, so check with./bin/app config. Abuild.*key in the file of-cis left alone too. - Breaking: settings are YAML only.
tifa.jsonand JSON deployment files are no longer read: renametifa.jsontotifa.yamland write it as YAML (JSON is valid YAML).tifa buildcheckstifa.yamland builds its values into the program as Go code, and no longer embeds the file. - Breaking: Vite reads no
.env(envDir: false), so theVITE_variables of.envfiles no longer reach the browser bundle. Pass such values from aLoad.tifa devno longer rebuilds the bundle for.env.*files. - The example shop reads
SHOP_OPENas the settingshop.openof itsconfig.go, so./bin/shop configlists it and--shop-openworks too. - Breaking: a handler function no longer loads the page data again after a successful POST, PUT, PATCH or DELETE, and the
invalidateoption of the call is gone. A call only sends its request and applies the session of the answer. A redirect only navigates, and a redirect to the page that is showing stays where it is. Tifa does not guess what a write changes, as TanStack Router does not. To show the result of a write, callrouter.invalidate()after the call (await router.invalidate({ sync: true })waits until the page shows the new data), orrefreshyour own state. To update, deleteinvalidate: falsefrom calls, and addawait router.invalidate({ sync: true })after each call whose page should show what it wrote. - Breaking: the routes of
tifa builduse TanStack Router's default freshness, where they hadstaleTime: InfinityandpreloadStaleTime: Infinity, and the router no longer setsdefaultStaleReloadMode: 'blocking'. Data counts as stale at once, so going back to a page you visited shows its cached data and loads it again in the background with a?_tifa=request, and preloaded data is reused for 30 seconds. A page that must not show old data of someone else after a sign-out callsrouter.clearCache(). - Breaking:
Session.InandSession.Outoftifa/clientare replaced bySignedInandSignedOut. Each takes exactly one element as its child, renders no node of its own, and shows that element only to a signed-in or signed-out visitor, where the old components wrapped their children in a<span>. A typo in a component name fails the build, and a misspelleddata-sessionattribute by hand failed without a word, so the attribute is now private to Tifa and the docs no longer tell you to write it. In development a child component that does not pass its props on to its DOM element fails when it mounts, with a message that says so. To update an app, replace<Session.In className="x">…</Session.In>with<SignedIn><div className="x">…</div></SignedIn>, and the same forSession.Out(see In the browser). - Breaking: the method of the session type that gives the browser its part is
Exposed() M, where it wasBrowser() M. The new name says what it does: whatever it returns is written into the page HTML and kept in the visitor'slocalStorage, so it must hold no credentials and nothing secret. To update an app, rename the method. The build checks it as before (see Sessions). - The text of
tifa.ErrSSRBusyistifa: render queue busy, where it wasssr: render queue busy, so every error value of Tifa starts withtifa:. A script or alert that matches the old text needs the new one. - Breaking:
c.QueryAll(name)is nowc.QueryValues(name). It returns a slice, and since Go 1.23 anAllfunction returns an iterator, asmaps.Allandslices.Alldo.http.Header.Valuesis the closest name in the standard library. To update an app, rename the calls. The build check is the same (see How Load may use Ctx). - Breaking: redirects are
tifa.Redirect(url, status), a function of the package, wherec.Redirect(url, code)was a method ofCtxthat never usedc. It panics whenstatusis not 3xx, asWriteHeaderdoes for a code it cannot send, where it returned a plain error that ended as a 500. TheCodefield oftifa.RedirectErroris nowStatus, the nametifa.Erroralready uses.c.Redirectis gone. To update an app, replacec.Redirect(withtifa.Redirect(andredirect.Codewithredirect.Status. The answer to the browser is unchanged (see route.go). - Breaking:
OnStartisfunc OnStart(ctx context.Context) error, likeOnShutdown. The context is the one the program runs with, which ends on SIGINT or SIGTERM, so a start that waits for a database can stop when the program is stopped. To update an app, add the parameter. The build rejects the old signature (see hooks.go). - New
Fields.Err()returns theFieldsas an error, or nil when it has no entries. A validator that collects messages in atifa.Fields{}ends withreturn fields.Err()and needs nolencheck. The server still answers an emptytifa.Fieldsthat is returned directly with 422, because it is an error (see Method handlers with input and result). - The example shop's storefront uses the whole-page cache. Its home page, journal list and product pages are kept for 10 minutes, the product list for 5 and a journal post for an hour, so a visitor of a cached page gets the answer from memory with
Cache-Status: tifa; hitand noLoadruns. The pages no longer hold anything of the visitor: the storefront Layout has the language, the menu and the free delivery price, and the cart in the header and the recently viewed rows come from the new/store/{lang}/mineroute, which the browser asks after the page has loaded. A product page tells it which product is open. See The storefront cache. - Pages can opt in to a whole-page cache with
const Cache = 10 * time.Minutein theirroute.go. For that long every visitor gets the same answer from memory, without theLoadrunning or a render, and a CDN in front keeps it for the same time minusAge:Cache-Control: public, max-age=0, s-maxage=<Cache in seconds>, stale-if-error=86400,AgeandCache-Status: tifa; hit. Such a page is anonymous: its GET and HEAD, and the data requests of navigations to it, loseCookieandAuthorizationbeforeOnRequest,tifa.Sessionis nil,SetSessionandClearSessionreturn an error, and theSet-Cookieof its HTML is removed. The build fails when itsLoad, a Layout around it or a function they call readsc.Cookie,c.Headerortifa.Session. Its request keeps only a short list of headers (Host,Accept-Encoding,If-None-Match,Origin,Sec-Fetch-*and a few more), so a header such asX-User-IDcannot reach aLoad. The key is the scheme, theHostheader, the path and the query without tracking parameters (utm_*,gclid,fbclidand the like, the list is the new settingcache.ignore_query), sorted. After the time is over the next request makes a new page and the others wait for it, and if that fails (aLoaderror, a failed or timed out render, a busy pool) the old page is served for up to a day. Only GET and HEAD answers with status 200, 301, 302 or 308 are kept, and not one that saysprivate,no-storeorno-cacheor varies on more thanAccept-Encoding. The answers to navigations stayprivate, no-cache. Pages sharecache.sizewith the render cache.tifa routeshas aCACHEcolumn and the manifest of--jsonhascache.Cachemust be atime.Durationof at least a second, andCache = truestill fails the build. See The whole-page cache. - The browser asks for the data of a navigation with the page URL and the query parameter
_tifa=<build>.<digits>(one digit for eachLoadon the chain, 1 for the ones it wants), where it sent the headersX-Tifa-RouteandX-Tifa-Build. A page and its data now have two URLs, so a cache that keys by URL cannot mix them up, and theVary: X-Tifa-Routeline is gone. The parameter is taken off the request before your code runs, soc.Query,OnRequestand the rendered URL never see it, and aLoadthat reads a parameter named_tifafails the build. A preload of the router ends the value with.p, which tells it apart in a log (it is not a way to count page views). The answer to a navigation request is never public: aCache-Controlof the app that is notno-storeorprivate, no-cacheis replaced byprivate, no-cache. In a middleware set withtifa.SetHTTPHandler,r.Patternis now the route template once the handler has returned, so metrics can count by route. A 400 answers a digit count that is not the number ofLoads on the chain, and 409 still answers another build. Handler function calls are unchanged. See Page requests. - The render cache is on for every page, and
Cache = trueis gone. Pages whoseLoadand Layout data, URL, build and session are the same are rendered once and answered from the cache ofcache.size(64 MiB by default, 0 turns it off), and requests that miss the same page at the same time share one render. This was only so for pages withCache = true. A hit still runs theLoadand Layout functions and hashes their data, and answers 2,865 requests a second against 38 for a render, with one VM and one request in flight on the machine of the study, and 4.6 times as many as a Next.js ISR hit there. The newconst RenderCache = falseinroute.goturns it off for a page that shows the time or a random number on purpose. Breaking: the build fails onCachewith the advice to delete it, and on the lower case namescache,rendercache,ssrandlayoutssr, which were skipped without a word. Delete everyconst Cache = true. A page that read the time or a random number while rendering now keeps the value it had at the first render, so check such pages:tifa devrenders every page twice and says in the terminal and the overlay when the two differ, and where. A request withtifa.WithRenderClockskips the cache.tifa routeshas aRENDERCACHEcolumn where it hadCACHE, and the manifest of--jsonhasrenderCacheforcache. See SSR and cache. - The example shop has a sign-in. Its workbench under
/projectsneeds the demo accountowner@shanhai.examplewith the passwordshanhai-demo, and the storefront does not. A visitor who is not signed in goes to/loginand comes back to the page they asked for. The top bar shows the name and a sign-out button, or a link to sign in. The shop keeps sessions in memory, with no store configured. Start it withSHOP_OPEN=1to see the workbench without signing in, which the comparison with Next.js and TanStack Start and the page benchmarks do. See Sign in. - The session reaches the browser. A page carries who is signed in, and the server writes
<html data-session="in">for someone signed in.useSession(),Session.InandSession.Outfromtifa/clientshow it, any element withdata-session="in"or"out"shows or hides itself from the first paint, and the browser keeps a copy inlocalStorage. Navigation data answers are now{"routes": ..., "session": ...}where they were{route ID: result}. A handler function call answers{"result": ..., "session": ...}, and{"session": ...}with 200 where an input-only handler answered 204 and the call signed someone in or out. Requests withoutX-Tifa-Callget the answers they got. NewGET /__tifa/session.data-sessionon<html>is kept by Tifa. See Sessions. - The build checks the session of the app.
tifa buildandtifa checkfail whentifa.SetSessionandtifa.Sessionare called with different types, whenSessionorClearSessionis called with noSetSession, when the session type is not a struct that reads back from JSON, whenLoadorLayoutreachesSetSessionorClearSession, and when a page, an API route or a file inpublic/uses the path/__tifa/. A session type with a methodBrowser() Mgets itsSessionDatatype in.tifa/session.gen.ts(see Checks at build time). - New sessions.
tifa.SetSession(c, &s)signs the request in with a new random token and a cookie that lasts 30 days,tifa.Session[S](c)returns who is signed in (or nil) inOnRequest,Load,Layoutand method handlers, andtifa.ClearSession(c)signs out. The record is JSON of at most 4 KiB, stored under the SHA-256 of the token. Without a store the server keeps sessions in memory up tosession.memory_limitand signs everyone out on restart.tifa.SetSessionStore(s)inOnStartswitches to your owntifa.SessionStore, andtifatest.TestSessionStorechecks it. The cookie is__Host-tifa_session(tifa_sessionwithoutSecureundertifa dev), set bysession.cookieandsession.max_age. An answer that sets the cookie isno-storeand never a 304.tifatest.NewCtxhas a session store per test andtifatest.WithSessionsets up a signed-in request (see Sessions). - New
tifa.SetHTTPHandler(wrap), called inOnStart, wraps the handler of the whole server with plainnet/httpmiddleware or handlers, such as/debug/pprof/or OpenTelemetry'sotelhttp. The wrapper is outside static files, the cross-site check and the routes, so it sees every request, the 403 of a refused cross-site write included, with the originalhttp.ResponseWriter. It does not go throughOnRequest,OnErroror the cross-site check, and a shutdown still waits for its requests. Calling it after the server listens panics (see Setting up in OnStart). - Tifa logs through
log/sloginstead oflog, with levels and fields. A failed request isERRORwithmethod,pathanderr, a refused cross-site write isWARN, the listening address isINFO, and a request's own context goes with the message where there is one, so a handler can add a trace id. The lines about startup are written afterOnStartreturns.slog.SetDefaultinOnStartmoves all of them to the new handler, and Tifa readsslog.Default()for every message. The text of the lines changed tomsg key=value, so a script that reads the old lines needs an update, but the listening line still containstifa: listening on http://ADDR(see Changing the log handler). - Breaking:
OnRequestisfunc OnRequest(c *tifa.Ctx, next func(*tifa.Ctx) error) error.next(c)runs the matched route, once, wherec.Next()did.c.SetContextis replaced byc.WithContext(ctx), which returns a copy ofcthat carriesctxand leavescalone, ashttp.Request.WithContextdoes:return next(c.WithContext(ctx)).c.Next,c.SetContextandtifatest.SetNextare gone, and a test callsOnRequest(c, func(c *tifa.Ctx) error { ... })with its own closure fornext. To update an app, change the signature, replacec.Next()withnext(c), and pass the context you used toc.SetContexttonext(c.WithContext(ctx)). The build rejects the old signature (see hooks.go). tifa.RedirectErroris exported. It is the type of the error thatc.Redirectreturns, soOnRequestand app tests can recognize a redirect witherrors.As(err, &redirect)and read itsURLandCode.- A page left open across a deploy reloads once for the new build, whatever shows the mismatch. A 409 on a data request already did, and now it names the build the server runs in the
X-Tifa-Buildresponse header. A handler function sends the build of its page, and the server refuses a call from another build with the same 409 before the handler runs, so an old page cannot write with types the new handler no longer reads. The call throws aTifaErrorwith status 409, the page reloads, and the call is not sent again. A 409 that your own handler returns reloads nothing, and a call withoutX-Tifa-Build, from curl say, is not checked. A code chunk that fails to load (Vite'svite:preloadError) reloads the page too. Each reload happens once per build, remembered insessionStorage. A page reloads only after it has written the mark and read it back. Where the browser blocks the storage, the page does not reload and shows the failure, whose message says to reload the page. A page that comes back still stale does not reload again: navigation data fails with the 409, a call throws it, and a failed import reaches theErrorof the route (see Pages open while you deploy). - Every answer of the app is sent with
Cache-Control: private, no-cacheunless the app setsCache-Controlitself. Pages, 304s, 404 pages, navigation data, method handler answers and redirects had no header (navigation data hadno-cache). CDNs such as CloudFront with its default policy keep an answer withoutCache-Controlfor a day or more, and Azure Front Door for days, so a page for one visitor could reach another. Now a shared cache stores nothing, and the browser still keeps the page and asks again with the ETag, which ends in a 304. SetCache-ControlinOnRequest, aLoad, aLayoutor a handler to choose another value. Error answers, which are JSON errors, the plain error page from Go, the page with an error and the busy answer, sayno-storeunless the app setCache-Controlbefore the error. The 404 page of the app keeps the default. Files under/assets/andpublic/keep their headers (see SSR and cache). - The Vite plugin makes three fewer rewrites of the SSR bundle, with the same HTML and the same render time. React's JavaScript cache of HTML escapes and its
replaceAllchain were for a VM without the engine's escape, which every VM of the pool has, so no render ran them. Working out the key of an element only when something reads it saved less than the 0.11% by which two runs of one bundle differ. Every other rewrite was measured again on the C engine of slowjs v0.29.8 and still pays, see Optimizations. - Breaking: a POST, PUT, PATCH or DELETE that a browser sends from another site is refused with 403 before
OnRequestand before any route, for every app (see Cross-site writes). It uses Go'shttp.CrossOriginProtection:Sec-Fetch-Sitedecides, an old browser is judged by itsOriginagainst theHost, and a request with neither header, such as curl or a webhook, passes. The answer is JSON like every other error, withCache-Control: no-store, andOnRequestdoes not see the request. No setting turns it off. The newserver.trusted_originslets the pages of chosen origins write, andserver.cross_site_pathstakes path patterns such asPOST /auth/apple/callbackwhose requests are not checked. To update an app, delete an Origin check inOnRequestthat only does this. An app that a page of another origin writes to, such as a front end onhttp://localhost:3000, lists that origin inserver.trusted_origins. An app that receives browser callbacks posted from another site, such as a sign-in that posts a form, lists their paths inserver.cross_site_pathsand checks those requests itself. Behind a proxy that rewritesHost, passHostthrough. The example shop drops its own check. - Server rendering writes out the calls of small functions, with the same HTML. In the SSR bundle, before it is minified, a call of a function whose body is an expression, a few assignments or ifs that return (up to 32 syntax nodes) becomes that body, in your code and in every package, when the function is set once, does not use
thisorarguments, and the call works out its arguments as often and in the same order as before. The plugin looks at the shape of the code and knows no library. A render runs 0.63% fewer instructions on the example shop's workbench pages, 2.63% on its storefront pages, 1.58% on the MUI test app and 0.83% on the bench app. The SSR bundles grow by about 1%, and the error of such a function shows the place of its call, one frame less in the stack. See Frontend output and Optimizations. - Server rendering hands each node to
retryNodewithout callingrenderNodeDestructive, with the same HTML. React DOM sends every node it renders through that function, which only passes it on, and a call costs more than the work it does. The Tifa plugin writes its body where it is called. A render runs 1.15% fewer instructions on the example shop's workbench pages, 0.76% on its storefront pages, 0.89% on the MUI test app and 2.33% on the bench app. A stack trace of a render error has no frame for that function. The change applies to the string renderer of React DOM 19.3.0 and 19.3.1. With another React DOM the build prints a warning and keeps the calls. - Server rendering writes an attribute that React DOM has written before with one lookup of its name, with the same HTML. React DOM checked the name of every attribute against its cases, its alias and its validity again each time. Now the module keeps what it found for each name, and a string or a number goes out as the chunk before the value, the value and a quote. A render runs 2.54% fewer instructions on the example shop's workbench pages, 2.28% on its storefront pages, 0.43% on the MUI test app and 1.81% on the bench app. The change applies to the string renderer of React DOM 19.3.0 and 19.3.1. With another React DOM the build prints a warning and keeps the old way.
- Pages that join class names with
clsxrender a little faster: the plugin writesclsx2.0.1 to 2.1.1 so that a call of up to six arguments, which covers the calls of MUI and of class-variance-authority, joins them without a loop over theargumentsobject and without a call for each string. The MUI test app runs 0.25% fewer instructions, the storefront of the example shop 0.15% and its workbench pages 0.08%, with the same HTML. When a release of clsx has another text, the build prints a warning and the file stays as it is (build.md). - Server rendering runs on slowjs v0.29.7, with the same HTML. On linux/amd64 the engine's C files are optimized again after they are linked, so calls between them are inlined. Locals of a function that are never live at the same time share one slot, so a call sets and frees fewer of them.
JSON.parsereads plain keys and strings straight from the text, so it runs 31% fewer instructions on the orders of the example shop and 60% fewer on a table of 1000 rows. A render runs 1.4% fewer instructions on the workbench pages of the shop, 1.0% on its store pages and 0.8% on the MUI test app from the shared slots, and 3.9% fewer on the table page of the bench app fromJSON.parse. On linux/amd64 the table page took 0.968 of the time and/inject/10.831, and the other pages moved less than 3%. - Breaking:
page.tsxandlayout.tsxno longer exportNotFound. A 404 shows inError, which gets it as aRouteErrorwith status 404, and aNotFoundexport fails the build with a message that says so. To update an app, move what eachNotFoundshows into theErrorof the same file, undererror instanceof RouteError && error.status === 404. A route with noErrorof its own or above it shows the framework's default 404 page, as before. - A URL that matches no page shows its 404 inside the deepest Layout it matches, where it showed the root Layout's
NotFoundalone. TheLayoutfunctions from the root down to that Layout run, so the 404 keeps the app's navigation and, below a language folder, the language of the URL. Navigation in the browser shows the same, and its data request answers with the data of those Layouts and status 404.OnRequeststill sees an emptyc.Pattern(), and itsc.Next()now runs those Layouts. A page for the rest of the path is no longer needed to show a 404 inside a Layout (see 404). A page whose Layout fails no longer preloads the chunk of that Layout, whatever the status. - A component that throws while the page renders on the server shows the
Errorof the page, inside its Layouts, where the browser got Go's plain error page. If that render fails too, the error moves up one route at a time, and Go's plain page comes only when the error fails in place of the root Layout as well.OnErrorsees the error once and picks the status and the public message as before, the answer is never cached, and the browser hydrates with the error where the server put it. Undertifa devthe stack trace shows in an overlay over the page, which reloads after you save a fix. A render that used upssr.vm_memorytries again the same way on a fresh VM, one that ran pastssr.timeoutdoes not, and all the renders of one request keep to onessr.timeout(see Errors on a page). - Breaking: a folder has at most three convention files, and
layout.goandroute.tsxare gone.route.goholds every Go name of the folder:Layout,LayoutSSR,Load,SSR,Cacheand the method handlers. Declaring one in another file of the package,layout.goincluded, fails the build.page.tsxis the page component, whereroute.tsxwas, and aroute.tsxfails the build with a message to rename it.layout.tsxstays. Aroute.gowith onlyLayoutgives the pages below it their Layout data and is no API route, andLoadis allowed only next to apage.tsx. The generated+route.tsand+layout.tsare replaced by oneroute.gen.tsfor each folder with a page, a Layout or a method handler. It exportspageandlayout(replacingroute),PageDataandLayoutData(replacingData),Params, and the method functions with their<METHOD>Inputand<METHOD>Outputtypes. Import it as./route.gen. To update an app, rename eachroute.tsxtopage.tsx, move theLayoutandLayoutSSRof eachlayout.gointo theroute.goof the folder, and change the imports of./+routeand./+layoutto./route.gen. Page HTML is unchanged. - Server rendering writes the calls of
jsxandjsxsas the elements they return, with the same HTML. In the SSR bundle, a call whose config is an object literal with no spread,ref,keyor computed name, and whose key is missing, a literal or a plain variable, becomes the object itself, when the React in the app is 19.3.0 or 19.3.1. With another React the build prints a warning and keeps the calls. A render runs 1.6% fewer instructions on the workbench pages of the example shop, 1.0% on its store pages, 3.0% on the bench app and 0.5% on the MUI test app. On linux/amd64 the workbench pages took 0.987 of the time, the store pages 0.992, the bench pages 0.959 and the MUI pages 0.995. The bundle of the example shop is 4.5% larger. - Server rendering runs on slowjs v0.29.6, with the same HTML. A call between the functions of the generated engine takes its result from a register instead of reading it back from the stack, and the compiler drops the checks of a
let,constorclassvariable where it can see the variable was written first. A render runs 0.8% to 1.6% fewer instructions on the pages of the example shop and the MUI test app, and the workbench pages of the shop took 0.978 of the time on linux/amd64. - Server rendering runs on slowjs v0.29.5, with the same HTML. Renders take less time: 0.976 of the time on the workbench pages of the example shop, 0.980 on its store pages and 0.943 on the pages of the bench app. A call costs less for each local of the function, object literals of the same keys share one shape, and common pairs of steps, such as a read of a local and then of one of its properties, or a
typeoftest, run as one. The render timeout (ssr.timeout) now also stops a page inside a long compare of strings of exactly 65,536 characters, a search through an array of thousands of long strings of one length, and a long copy inJSON.parseorJSON.stringify. 23 fixes of upstream QuickJS are in, so a few built-ins answer as Node does where they did not (BigInt.asUintNof a negative BigInt, among others). - Pages with a long
Loadresult render faster. When the JSON text of aLoad's data is 4,096 code units or longer, the render no longer writes it into the hydration script itself. It writes a short slot there, and Go fills the slot with the text once the VM is free, escaped the way seroval escaped it, so quotes,</script>, U+2028 and U+2029 in data stay harmless. A render runs 0.3% to 0.4% fewer instructions on the pages of the example shop and the MUI test app, 5.9% fewer on a table of 1,000 rows of two UUIDs (92 KB of data), 7.5% fewer on a page with 1 MB of data and 29% fewer on one with 0.5 MB. A page with no long text renders as before. The browser reads the same data. Where a text is over 16K code units, the router used to split the hydration script into three script tags, and now writes one, as it does for a small page, so such a page is 80 bytes shorter. The browser bundle changed by a few bytes, so its file names changed. - Server rendering runs on slowjs v0.29.4, with the same HTML. Calls of built-in functions written in C skip a step of the interpreter, and object literals keep their properties in the block of the object: a render runs 0.1% to 2.3% fewer instructions, and a VM holds 1% to 2.4% less after a render. Recursion goes exactly as deep as before.
- Server rendering runs on slowjs v0.29.3, with the same HTML. The render timeout (
ssr.timeout) now stops a page within a few polls of the engine when it is inside one long call that walks a string, an array, a Map or a Set without calling anything for each item (Object.fromEntries, spreading a Set,Iterator.prototype.toArray, the methods ofSet), areplaceorreplaceAllwith a string pattern, aslice,substring,trimorsplitthat cuts out more than a million characters, or a Map or Set operation on a key of millions of characters. Such a call used to run to its end, or long enough to get the VM killed. - Server rendering runs on slowjs v0.29.2, with the same HTML. The render timeout (
ssr.timeout) now stops a page within a few thousand characters or elements when it is inside one long call ofsplit,padStart,padEnd,trim,isWellFormed,toWellFormed,encodeURI,decodeURIand the like,Array.fromor a typed array constructor, or when it joins or compares long strings built with+. Such a call used to run to its end. Object spread ({...o}), the rest of a destructuring andObject.assignlook up each key when its turn comes, as in Node: a getter that deletes a later key or makes it not enumerable leaves it out of the copy, and one that makes a later key enumerable has it copied. - Server rendering runs on the C engine of slowjs v0.29, its only engine: QuickJS in C, compiled to Go assembly that the module ships. Building needs no C compiler, and
CGO_ENABLED=0stays. Pages render the same HTML in less time (see Performance below). What apps can see: tifa devrenders a page the second time with the clock 36 hours on, so it also finds a page that shows the date, the time to the minute or "3 hours ago", which two renders in a row almost never told apart. The warning now lists where your code read the time or a random number (Date.now(),new Date(),Date(),Math.random(),crypto) by file and line, leaving out React, TanStack Router and Tifa itself (see Log).- An app builds for linux and darwin, on amd64 and arm64, and windows/amd64. A build for another target stops with an error from slowjs that names them.
JSON.parsenests 2,000 levels at most in a render, so a page whose data nests deeper fails withRangeError: JSON nesting too deepwhere it rendered before.ssr.vm_stack_depthis still 10000 by default and at most 10000. It counts calls now, where the engine before counted slots of its stack. Plain recursion goes as deep in a render as in Node, as before. A render that recurses without end grows the process by up to 26 MB on linux/amd64 and 14 MB on darwin/arm64, where it grew it by up to 24 MB of goroutine stack (see Stack depth).ssr.vm_memorylimits what the engine's own allocator holds. The same heap counts 13% to 15% less than before, so the same limit leaves that much more room.modernc.org/libcis no longer a dependency of Tifa. The SQLite release thattifa newpins no longer has to match a libc version.build.goasmis gone from the project file, since there is no Go interpreter to switch to. A project file that sets it fails with an unknown key.
tifa buildno longer compiles apps with a CPU profile (PGO). Thebuild.pgosetting and thedefault.pgofile of an app are gone, and a project file that setsbuild.pgofails with an unknown key. The engine is Go assembly, which PGO does not change, and the profile made no difference you can measure with it: on linux/amd64 the shop's, the MUI app's and the bench app's pages took 0.998, 0.999 and 1.004 of the time with it as without it, a render executed 0.9987 to 1.0003 of the instructions, and on darwin/arm64 the shop's pages took 1.002 (see Optimizations). With the engine before the C engine it made pages about 3% faster on linux/amd64 and 7% on darwin/arm64. Nothing needs collecting again when slowjs is upgraded.- A VM that waits idle gives its free memory back to the system. A VM that has not rendered for a second hands back the pages its renders left free and the stack they touched, and the full collection between renders does the same, where it gave back nothing before. In the program, a VM of the example shop takes 9.6 MiB when idle instead of 12.8 MiB, and one of the MUI test app 5.6 MiB instead of 7.7 MiB, about a quarter less (see Memory). A VM that renders at least once a second keeps its memory, so sizing for load does not change. The first render after the wait takes 1 to 2.5 ms more, and render times are the same.
- The example shop has a new look and pages as heavy as a real shop's. It looks like a printed catalogue, with Latin headings in Newsreader, bundled with the app, and Chinese headings and body text in the system fonts. Every product has three photos in AVIF at three widths. The storefront gained a category menu, a cart drawer, a carousel, product galleries, reviews in pages with photos, questions and products to buy together. The product list has facets with counts, quick filters, chosen conditions, a grid and list view and a quick view of each product, and a product page has the whole specification and a comparison with similar products. The workbench order list shows 25 rows a page, with product photos, filters by date, carrier and amount, row menus and bulk actions. An order shows a log of what happened, internal notes, payment, a stock check, a packing list and the way of its parcel, and the stats page has a table of every product, a heatmap of when orders come, carriers and the best customers. Its pages take longer to render because they hold more: Optimizations has the new numbers, which are not a change in Tifa's speed. The built
bin/shopgrew from 31.1 MB to 35.9 MB on darwin/arm64 with the font and photos it embeds. - Pages with a large
Loadresult render faster. The JSON text of eachLoad's data now goes to the render as an argument of its own, so Go no longer escapes it into the JSON of the input and the VM no longer parses it twice. A table of 1,000 rows of two UUIDs takes 0.986 of the time to render (0.965 to 0.991, faster in 6 of 6 rounds), and the server takes 0.665 of the time to prepare its render input (0.655 to 0.682). The example shop's workbench and storefront pages, whose data is a few KB, stay within the spread of the rounds (a group of pages between 0.987 and 1.008 of the time). Same HTML, same browser bundle. - Apps that install rolldown 1.2.15 or seroval 1.7 keep the speedups of the Tifa plugin. rolldown 1.2.15 starts each module with a
// pathcomment rather than//#region path, and seroval 1.7 passes the plugins it asks toparsePlugin, so the plugin warned and left React's namespaces with getters and arrays of route data in seroval's own form, which render more slowly. A new app gets these versions. Pages render the same HTML. - Server rendering runs on slowjs v0.28.6. On linux/amd64, it runs JavaScript in slowjs's interpreter in Go assembly, which slowjs now uses by default there. Pages render the same HTML in less time: with one VM the example shop's workbench pages take 0.940 of the time and the pages of the MUI test app 0.850, and with 8 VMs on 8 hyperthreads the program renders 1.085 times as many shop pages a second and 1.211 times as many MUI pages.
- Server rendering runs on slowjs v0.28.5, which keeps an async context across promise jobs, for the
AsyncLocalStorageof the server, and lists the own keys of ordinary objects from their shape, forObject.keys,for in, object spread andJSON.stringify. - Server rendering runs on slowjs v0.28.4, which frees the top-level function of a module once it has run, with the variables it kept.
- The SSR bundle runs in strict mode, as the browser bundle does: it is now an ES module, which each VM evaluates as a module (see Top-level await and strict mode). A package that only works outside strict mode now fails on the server too.
tifa buildcompiles the SSR bundle as the server does, without running it, so syntax that only sloppy mode allows, such as awithstatement in a CommonJS file, fails the build with the place in the source file rather than the start of the server. An assignment to a variable that was never declared throws aReferenceErrorwhere it runs. Pages render the same HTML. - Server rendering runs on slowjs v0.28.3. Regexps with the v flag accept what the specification allows and Node accepts, such as
[\&\;]and/-/v, where they threw a SyntaxError. The regexps shiki makes compile, apart from those with more than 254 capture groups. - Server rendering runs on slowjs v0.28.0, the new name of the quickjs engine (
github.com/liustack/slowjs, it wasgithub.com/liustack/quickjs). It is the engine of quickjs v0.27.3 under a new name, and pages render the same HTML. slowjs supports Linux and macOS on amd64 and arm64, and Windows on amd64, so an app can no longer be built for FreeBSD, 32-bit targets or other CPUs. - Server rendering runs on quickjs v0.27.3. The pool uses
VM.RunYoungGCbetween renders. String searches (includes,indexOfandlastIndexOf) skip with Go'sbytespackage and count the searched text toward the interrupt check. - Server rendering runs on quickjs v0.27.2. The render timeout (
ssr.timeout) now stops a page that compiles regexps or builds strings in a loop within a few milliseconds, where such a loop could run on for seconds past it: compiling a regexp and the built-ins that parse source or build a string (JSON.parse,JSON.stringify,join,repeat,replaceAlland the like) count toward the engine's interrupt check. One long call of such a built-in still runs to its end. The GC between renders frees the WeakMap entries whose keys are gone in one collection, also when a value points back to its key, where such entries stayed in a reused VM. The HTML is the same (see Performance below). - Server rendering runs on quickjs v0.27.1, which renders the same HTML in less time (see Performance below).
- Pages styled with emotion, such as MUI's, render faster: the hash emotion takes of every style is computed in Go, with the same result. The pages of the MUI test app take 28% to 29% less time to render, with the same HTML.
- Server rendering runs on quickjs v0.27.0. Every
Intlconstructor and every calendar Chromium has now work while a page renders, andlocaleComparesorts by the locale's rules, as browsers do, where it compared code points. A program now carries go-intl's data and code, so it ships six notice files where it shippedLICENSE-DATAalone (build.md). tifa buildandtifa devstop with an error when an app with pages installs React or React DOM older than 19.3.0.- The build prints a warning that names each module outside React DOM with
$$FORM_ACTIONin its code, since such a form gets a different key than React writes without the plugin. - In the browser, route modules that export
headload with their routes, as other route modules did, instead of being part of the entry script. The example shop's entry went from 224 KB to 146 KB with gzip. Code at the top level of such a module now runs when its route first loads, so setup that every page needs belongs in the root Layout. A module of the entry that imports a route module keeps it in the entry, with the bundler'sINEFFECTIVE_DYNAMIC_IMPORTwarning. - An address that cannot be listened on names its setting, and a port only root may take says to use
setcap cap_net_bind_service=+ep. tifa buildleaves the DWARF debug info out of the program with-ldflags=-w, after the flags of the-ldflagsinGOFLAGS. The example shop's program on darwin/arm64 went from 26.4 MB to 21.2 MB. Panics,runtime.Callerand pprof still give files and lines, but debuggers such as Delve cannot step through the program.build.debug_info: truein the project file keeps the debug info.tifa devkeeps it as before.- A panic in the render of a
Cache = truepage reachesOnRequestandOnErroras an error of the render,tifa: render page: tifa: panic: ..., with the stack of the render, rather than the plaintifa: panic: ...it gave before, which a panic in aLoadstill gives. Undertifa devits error page says the request failed while rendering on the server, not only that it failed.
Performance
-
Pages render faster on the server: slowjs writes the start and end tags of most elements in C, where React DOM wrote each tag with a dozen calls of JavaScript functions. The engine writes the whole start tag as one string and hands back to React any element it cannot be sure to write the same, which happened for none of the 469,530 tags on the pages of the example apps. A page takes 7.9% less time on the shop's workbench, 7.5% on its storefront, 4.4% on the MUI test app and 32% on the bench app. The pages are the same byte for byte. The change applies to React DOM 19.3.0 and 19.3.1: a React DOM in which any of the 28 parts the C functions stand for differs gets a warning, and React writes every tag (build.md).
-
MUI pages render faster on the server:
memoThemeof@mui/systemkeeps the styles it made from the theme across renders.ThemeProviderspreads the theme into a new object on every render, somemoTheme, which kept them only for the same object, made them again each time. The plugin now takes a plain-object theme with the same own keys and values as one it saw as that theme. The MUI test app makes its 107 such styles once per VM, and its pages take 0.917 of the time and run 9.3% fewer instructions (linux/amd64, 16 code positions), with the same HTML. An app that changes an object inside its theme after a render and passes a new theme object with the same objects keeps the old styles, so make a new theme to change it. AmemoThemeof another text gets a warning and stays as it is (build.md). -
React makes the arrays called key paths only for a bundle with a module that has
$$FORM_ACTIONin its code, where it made one for every element it renders. Pages render the same HTML, with 1.2% fewer instructions on the shop's workbench pages, 0.7% on its storefront pages and the MUI test app and 1.8% on the bench app. The change applies to the string renderer of React DOM 19.3.0 and 19.3.1, whose text the plugin has read, and a build with another file prints a warning and keeps the key paths. The key thatuseActionStatewrites into a form with a server action is the same as before when a module of the bundle has$$FORM_ACTIONin its text, which is how the plugin tells. A property name put together while the program runs is not recognized, and its key is hashed from empty key paths. Tifa has no server actions of its own (build). -
Pages render a little faster, with the same HTML. React DOM asks three times, for almost every attribute, whether its value is a function, a symbol or a boolean, which it does not write. The Tifa plugin asks first whether the value is a string, which it is nearly every time, and asks the other questions only for another type. A render runs 0.30% fewer instructions on the example shop's workbench pages, 0.24% on its storefront pages, 0.19% on the bench app and 0.07% on the MUI test app. When the code in React DOM differs from 19.3's, the build prints a warning and renders as before.
-
React's
createElementandcloneElementcopy their config into the props of an element in the engine. slowjs has the loop that does it as a C function (RegisterCopyProps), each VM of the pool has it as__tifa_copy_props, and the build makes both functions ask it before their loop. It copies only a config where the loop cannot do otherwise, and any other (a proxy, a getter, a class instance, an array, more than 32 keys) goes through React's loop. A render runs 2.9% fewer instructions on the shop's workbench pages of the example app, 2.1% on its storefront pages and 4.1% on the MUI test app, with the same HTML, and the pages take 0.988, 0.989 and 0.980 of the time (linux/amd64, 8 code positions, inside their spread, so the instruction counts carry it). A VM without the function and a React the plugin does not know keep React's loop (build.md). It needs the slowjs version withRegisterCopyProps. -
Pages that translate with react-i18next render faster: the copy of the i18n object that every
useTranslationcall makes is built from a list of the object's keys when the object has only plain properties, and from its descriptors as before for any other. The shop's storefront pages take 0.967 of the time to render and run 6.0% fewer instructions, with the same HTML. When a release of react-i18next changescreateI18nWrapper, the build prints a warning and the function stays as it is (build.md). -
Pages with
asChildcomponents of shadcn/ui render a little faster:Slotof@radix-ui/react-slotmerges props with a loop that tells handlers from other props by the codes of their names, where it tested a regexp for each prop. The shop's workbench pages run 0.58% fewer instructions and its storefront pages 0.24% fewer, with the same HTML. When a release of react-slot changesmergeProps, the build prints a warning and the function stays as it is (build.md). -
React DOM's escape of every text and attribute value runs in the engine. slowjs has
escapeTextForBrowseras a C function (RegisterEscapeText), each VM of the pool has it as__tifa_escape, and the build makes React's string renderer call it in place of its JavaScript function with the cache andreplaceAll. A render runs 2.5% fewer instructions on the shop's workbench pages of the example app, 2.4% on its storefront pages, 0.7% on the MUI test app and 4.5% on the bench app, with the same HTML. At 8 code positions on linux/amd64 the workbench pages render in 0.974 of the time, the storefront pages in 0.975 and the bench pages in 0.938. A VM without the function and a React DOM the plugin does not know keep the cache andreplaceAll(build.md). It needs a slowjs release withRegisterEscapeText. -
React DOM's
pushAttributewritesclass,tabindex,dir,role,viewBox,width,heightand the XLink and XML attributes without callingpushStringAttribute, and looks a name up in the cache of valid names before it callsisAttributeNameSafe. A render runs 0.8% fewer instructions on the shop's workbench pages of the example app, 0.7% on its storefront pages, 1.0% on the bench app and 0.1% on the MUI test app, with the same HTML. At 8 code positions on linux/amd64 the pages take 0.993 to 0.997 of the time, within the spread of the positions. When one of these functions differs from React DOM 19.3's, the build prints a warning and pages render as before (build.md). -
Server rendering runs on slowjs v0.29.1, with the same HTML. slowjs measured each of its changes against the one before, without PGO on linux/amd64 at 8 code positions. An object literal of plain keys is made at its final shape at once: the workbench pages of the example shop render in 0.956 of the time, the MUI pages in 0.969 and the table page of the bench app in 0.942. A call then sets and frees its values in fewer steps, and React's
for inloops withhasOwnProperty.callno longer make the two calls: the workbench pages take 0.982 of the time, the MUI pages 0.976 and the bench pages 0.952. An ordinary object, such as the props of a React element, takes 48 bytes instead of 72, so a long Markdown page holds 3.8% less at its peak. -
The C engine of slowjs renders the pages of the example shop's workbench, the MUI test app and the bench app in 0.834 to 0.860 of the time slowjs took before v0.29.0 with the profile Tifa shipped, with the same HTML and without a profile (11 pages, one VM on one core, faster at each of 8 code positions, see Engine). The pause of Go's garbage collector while VMs render stays as short: a P99 of 131 to 164 µs with one VM and 197 µs with three, and a longest stop of 3.1 ms and 0.9 ms against 4.2 and 2.1 ms. A VM of the example shop takes 8.5 to 8.6 MiB of the process after loading, 12.8 MiB after rendering and 9.6 MiB once idle, and one of the MUI test app 3.9, 7.4 to 7.6 and 5.3 to 5.5 MiB (see Memory).
-
Icons of lucide-react render faster: each VM keeps what lucide-react built for an icon with the same props and hands it out again. The shop's workbench pages take 4.3% less time to render and its storefront pages 5.8% less, with the same HTML. When a release of lucide-react changes the files the cache depends on, the build prints a warning and icons render as before (build.md).
-
Pages that translate with i18next render faster: the
tofgetFixedTanduseTranslationcopies the options of i18next only for a key or key prefix that is a function, and i18next keeps the regexp it tells keys with a namespace from sentences with. The shop's storefront pages take 5.2% less time to render, with the same HTML. When a release of i18next changes either function, the build prints a warning and that function stays as it is (build.md). -
The VMs of the SSR pool share one copy of the source text of the bundle's functions and of the tables that give error stacks their line numbers, with slowjs's
SharedBytecode, so each VM of the example shop holds 2.35 MiB less after loading (9.0 MB rather than 11.5) and each VM of the MUI test app 1.22 MiB less.toString, error stacks and the HTML stay the same. That copy does not count towardssr.vm_memory. Render time does not change. -
The SSR bundle runs fewer bytecode instructions: after minifying,
tifa buildandtifa devwrite the statementsa && b;,a || b;anda ? b : c;asifstatements and!0and!1astrueandfalse, in the SSR bundle only. The pages of the MUI test app render in 0.989 of the time (faster in 6 of 6 rounds), the shop's workbench pages in 0.994, within the spread of the rounds, with the same HTML and the same places in error stacks. -
quickjs v0.27.2 renders the shop's workbench pages and the pages of the MUI test app in the same time as v0.27.1, within 1% with or without PGO (1.006 and 0.991 of the time without PGO, 0.993 and 0.996 with it), with the same HTML. After a GC a VM holds up to 0.6 MiB less memory from its allocator.
-
quickjs v0.27.1 renders the shop's workbench pages in 0.991 of the time of v0.27.0 without PGO and in 0.982 with PGO, and the pages of the MUI test app in 0.986 and 0.980, with the same HTML and memory. Together with emotion's hash computed in Go, the MUI pages render in 0.70 of the time they took on v0.27.0 before that change, with or without PGO, and the shop in 0.987 without PGO and 0.984 with it.
-
quickjs v0.27.0 renders the shop's workbench pages in 0.982 of the time of v0.26.17 without PGO, and in the same time with PGO, which already got what its changes give. A page that makes the same regexps on every render, such as one that highlights code, compiles them once per VM: the shop's journal post that highlights CSS renders in 0.893 of the time without PGO.
-
The entry script holds all code every page loads in one file instead of four. Over HTTP/1.1 at 150 ms round trips the shop's pages hydrate 11 to 192 ms sooner than before, at 40 ms 4 to 77 ms sooner, and they paint 8 to 24 ms later (8 to 48 ms over HTTP/2). Served by Tifa itself over HTTP/1.1, an app whose pages need 17 to 20 files hydrates 58 to 100 ms later at 150 ms round trips. A proxy or CDN that speaks HTTP/2 in front avoids that.
-
Four more rewrites of the SSR bundle by the Vite plugin: React escapes HTML with
replaceAll, builds no component stacks, gets plain values in place of the getters of its namespaces, and leaves component names out of key paths. Together the example shop renders 6.5% to 7.5% faster and pages of plain text 17.6% to 18.3% faster, with the same HTML. -
The data of a route whose
Loadreturns an array, such as a slice, now goes into the page as the JSON text Go wrote, as objects already did. A table of 1,000 rows takes 39% less time to render. When seroval's code has another form, the build prints a warning and pages render as before. -
Go writes characters above U+FFFF, such as emoji, in the data it gives the render as the escapes of their surrogate pairs, so one emoji no longer makes the shop's order list render 9% slower. The browser reads the same values.
-
quickjs v0.26.16: without PGO, two of its changes make renders take 0.971 of the time of v0.26.15, and the other three take 0.955 of that, with the same HTML. Each VM keeps the shapes of recent objects and a cache of freed small blocks for reuse, so it holds about 0.7 MiB more after a garbage collection, 647 KiB of it for the shapes. Pages that make many objects whose keys no other object has can make the shapes take up to about 6 MiB. The shapes count against
ssr.vm_memory. -
Requests for a
Cache = truepage that miss the cache at the same time with the same data share one render, so a burst on a cold page, such as right after a deploy, renders it once. Each request keeps its own headers and gets its own encoding, the render compresses the page once for all of them, a failed render is the answer of every request that waited for it, and the requests that took the render another one started carryX-Tifa-Render: shared. A request whose client goes away while it waits has its connection cut, with no answer sent and no call toOnError. A render that fails once no request waits for it is logged. 50 requests at once for a cold order page of the shop took 50 renders and 146 to 221 ms before, and now take one render and 30 to 52 ms. -
The pool runs a young garbage collection after each render, which looks only at the objects the render made, and a full one only when a VM has grown 1.5 times past what the last full one left, after the engine collected during a render, and every 256 renders. With one VM, the P99 of a render of the example shop is 0.748 of what it was and that of the MUI pages 0.940, with two VMs 0.796 and 0.919. The P50 and CPU stay within 2.1%, the HTML is the same, and peak memory is 0.82 to 0.88 of what it was.
-
The pool collects the garbage of renders between renders, after the answer has gone out, instead of the engine collecting in the middle of a render. With one VM, the P99 of a render of the example shop is 12% to 41% lower and that of the MUI pages 4% to 7% lower, while the P50, throughput and HTML stay the same and a VM holds 3% to 14% less memory after a render. When every VM is busy and requests wait, the next request still waits for the collection.
Fixed
- Under
tifa dev, a page loaded right after a save now shows the new server render. Before, a request in the first 100 ms or so, before the files went quiet and the rebuild started, got the old one. Saving apage.tsxorlayout.tsxthat exportshead,htmlAttributesordocumentHeadmakes Vite reload the page at once, so the browser often hit that window: the page kept the old text and React reportedHydration failed. Such a request now waits for the rebuild (see What each change triggers). - The pages of an app made by
tifa newnow show a new todo, and a todo marked done, at once. They did not: the comments said the page data loads again after a write, but Tifa never reloads it, so the list stayed old until a reload. The add form and the done button now callrouter.invalidate()after the write, and the comments say so (see Calling method handlers from the browser). tifa devno longer puts the tags that a Vite plugin adds withtransformIndexHtmlinto the head, except the Vite client and the React refresh runtime.tifa buildnever ran that hook, so such a tag was in the page undertifa devand silently missing in production.tifa devnow prints a warning that names each tag it leaves out. Put the tag in theheadof the rootlayout.tsxto have it in both.tifa devgives the namespaces of React and React DOM plain values in its SSR bundle, astifa builddoes, and no longer printstifa rewrite not recognized: react, react-dom. The bundle oftifa devis not minified and keeps the license comments of React, so the rewrite did not find the modules of React and pages in dev called a getter for each export they read.- In an app with a parameter folder at the root of
app/(such asapp/lang+), a link to a file of the public folder no longer asks for navigation data./favicon.svgmatched the page/{lang}in the browser router, though the server answers public files first, so<Link to="/favicon.svg">androuter.navigatefetched page data for it. The generated routes now list the public files, and a navigation to one of them, or to a path under/assets/or/__tifa/, loads the document. Every page route also carries a marker, and the newisPage(router, pathname)of the runtime tells a page from these paths and from URLs that show a 404 (see Route tree). tifa devruns the bundle step when a file is added to the public folder or removed from it, since the generated code lists these files. Editing the content of one still builds nothing (see what a change runs).- The error page that follows a component throwing during the server render now has the head of an error page. Its head was the one worked out for the page that failed, so tags of a page that rendered stayed on the 500 page:
hreflangand canonical links, thetitle, andhtmlAttributessuch aslang. The browser works the head out again from the matches when it hydrates, so the two could differ. Now the route the error replaces runs itsheadwithout data, the routes below it give no tags, and theheadof the routes above it runs again with the failed route inmatches, as for a page whoseLoadfailed. See Errors on a page. - The example shop no longer links a missing page to itself in other languages. A 404 under
/store/<language>/(a product that does not exist, or a URL no page has) answered withhreflangalternate links to that URL in each language, which tell search engines the missing URL is a real page. The recipe in A site in several languages is fixed the same way: theheadof the language Layout leaves the links out when the page shows an error. tifa devrebuilds and restarts the app when a file thatgo:embedtakes in changes, such as a Markdown post. It used to look only at Go, TypeScript, CSS and JSON files, so an edit to an embedded.mdfile did nothing until some other file changed. A new or removed embedded file runs the static analysis too, and an embedded front end file runs the bundle as well.- A URL that is only another spelling of a page now answers 308, a permanent redirect, where it answered 307. That covers a trailing slash (
/store/en-US/to/store/en-US), a double slash, a dot segment and a percent-encoded letter (/%61for/a). Search engines take a permanent redirect as the sign of the canonical URL and ignore a temporary one, and 308 keeps the request method, as 307 did. A redirect thatc.Redirector aLoadasks for keeps its own status. - Server rendering runs on slowjs v0.29.8, with the same HTML.
JSON.stringifythat runs out of memory throws, where it could keep an element alive or return text without the keys of a replacer list. Aspaceargument built by joining strings indents with its text, not bytes of the engine. Setting thelengthof an array to fewer elements and then writing past it works as in Node, and is 17% faster on 100,000 elements.Iterator.prototype.reduceandIterator.concatclose their iterators as the specification says. - Server rendering runs on slowjs v0.29.9, with the same HTML. A page that runs out of memory while it makes an array with the prototype of another class (
Reflect.construct(Array, [], F)) or while it sets the prototype of an object whose shape is shared (Object.setPrototypeOf) now gets the out of memory error. The first used to write through a null pointer and end the process, and the second kept the new prototype alive. tifa dev: the app and Vite no longer outlive it. Closing the terminal that runstifa dev(SIGHUP) now stops it as Ctrl-C does. Whentifa devis killed (SIGKILL), the app it started shuts down as it does on SIGTERM, where it used to keep running with its port until someone killed it by hand. Atifa devstarted withnohupstill ignores SIGHUP. The app and Vite also no longer hold the filestifa devinherited, such as the lock a script keeps withflock.tifa dev: after Vite's dev server restarts (a change tovite.config.tsor a.envfile, or the switch to polling), an edit made right away could be missed for good, and a module the dev server had already served stayed old until the file changed again. The dev server now answers requests once its file watcher has read the app's files.- Files from the public folder get an ETag, so a browser that revalidates them gets a 304 instead of the whole file again. They go out with
Cache-Control: no-cache, but the copy embedded in the program has no modification time and had no ETag, so every revalidation downloaded the file in full.tifa buildnow writes the content hash of each public file intobuild.json, and the server sends it as a strong ETag, which turns weak (W/"…") when the file goes out compressed. Files of the browser bundle are unchanged, andtifa devkeeps the modification time of the files it serves. - quickjs v0.26.17: Intl converts options, values and locale lists as ECMA-402 does, so a Symbol or a BigInt where a string or a number is wanted throws a
TypeError, andIntl.NumberFormatformats a wrapped BigInt exactly where it rounded it through a double. A page that changesArray.prototype,JSONor other built-ins no longer changes what Intl does. Intl's functions have the shape of built-ins, and the formatters are shared by every VM of the process, so a VM that has used Intl holds a few KB less. - The SSR bundle keeps every line of React DOM in place, so the places in render error stacks point at the right lines.
- A page no longer carries the time its data was loaded. TanStack Router wrote the time of the render into every page, so
tifa devwarned that every page with the render cache read the time, and the render cache gave the time of the first render to later visitors, whose browser then dropped data it could have kept when they went back to the page. The page now carries a fixed time, its answer says how old its data may be inServer-Timing: tifa-age;dur=<ms>, and the browser dates the data at the time it sent the request less that age. Only an answer that every cache must check with the server again carries it, so a page of the whole-page cache, or one whoseCache-Controllets caches keep it, has none. Where the answer has no age or the browser cannot read it (Firefox over plain HTTP, a page from the back and forward history), the data counts as old and loads again when you come back to the page (see SSR and cache).
2026-10-19
Added
server.compress, on by default: pages, navigation data, JSON and other text go out with zstd or gzip to clients that accept them, so a Tifa program needs no proxy to compress. Set it tofalsewhen a proxy in front compresses.tifa buildwrites a gzip file next to each text file of the browser bundle, and the program sends that file to clients that accept gzip, at no CPU per request.- Pages and JSON answers carry
Content-Lengthwhen they go out uncompressed. - A performance guide: how fast pages render, how throughput grows with cores, and how to size CPUs,
ssr.vmsand memory.
Changed
- quickjs v0.26.14: the engine build stops where an upstream change could make it fix the generated code wrong, and
NewVMno longer leaks when it cannot make a context. Pages render as before.
Performance
- quickjs v0.26.15: renders take 0.843 of the time of v0.26.14 without PGO and 0.859 with a new profile, and whole requests with 6 VMs on 3 cores serve 1.17 times as many. On an Apple M4, 10 VMs serve 1.80 to 1.88 times as many as before, since they no longer wait on the allocator lock.
- Cached pages keep their gzip and zstd forms, so a compressed cache hit is not compressed again and costs less CPU than an uncompressed one.
- Pages are written without copying them.
2026-10-18
Added
tifa buildcompiles apps with pages with a CPU profile of page renders (PGO), andbuild.pgopicks it:auto,offor a file. With quickjs v0.26.15 pages render about 2.4% faster on linux/amd64.
Fixed
- quickjs v0.26.8: Tifa builds on linux and freebsd again, which v0.26.6 and v0.26.7 broke. A string cut inside an emoji renders as Node renders it.
- quickjs v0.26.9: Intl names daylight saving time as ICU does on every system. On Linux, Europe/Dublin and a few other zones swapped their summer and winter names.
- quickjs v0.26.10: invalid bytes in a Go string passed to JavaScript become U+FFFD instead of cutting the string short.
Performance
- quickjs v0.26.12: a JavaScript call no longer allocates under libc's global lock. Renders take about 11% less time on linux/amd64 and 14% less on darwin/arm64, and several VMs no longer hold each other back.
- quickjs v0.26.13: the interpreter loop does less work with the stack, and adding a property to a plain object takes a fast path. Renders take about 18% less time on linux/amd64.
- Three rewrites of the SSR bundle by the Vite plugin: React joins the chunks it writes, checks a
Setbefore its longswitchstatements, and seroval escapes short strings withJSON.stringify. Together the example shop renders 11% to 14% faster and pages of plain text 17.5% to 22% faster, with the same HTML.
2026-10-17
Added
ssr.vm_stack_depthlimits how deep JavaScript calls nest in a render.tifa buildrefuses a TanStack Router version Tifa is not tested with.build.skip_tanstack_checkturns the check off.
Changed
- Breaking: the generated client functions type a handler's result as
Out | undefined. - quickjs v0.26.4: Intl reads fraction digits as ECMA-402 does since 2021, so a currency format no longer needs both digit limits.
- quickjs v0.26.6: running out of memory and the render timeout can no longer be caught by page code, and endless recursion throws a
RangeErrorinstead of killing the process. - quickjs v0.26.7: the render timeout runs on the monotonic clock.
Fixed
-0in aLoad's data hydrates as-0: the page carries the JSON Go wrote.- quickjs v0.26.5: a VM close to its memory limit reports out of memory instead of a JSON decode error.
- An interrupt of the engine counts as the render time budget.
tifa devruns the app in the app root.
Performance
- The Vite plugin caches React's HTML escapes in each VM. The example shop renders 8% to 10% faster on an Apple M4, whose Tailwind class names are full of characters to escape.
2026-10-16
Added
- Every SSR VM has Intl, with every modern CLDR locale (quickjs v0.26.2).
tifa devwarns about Intl calls that rely on the server's default locale or time zone.- The time zone database is embedded in the program.
Ctx.QueryAll, collected as a query parameter ofLoad.tifa devshows render errors with their stack, and reloads once they are fixed.tifa devlogs slow build steps and shows a page during the first build.
Changed
- quickjs v0.26.3: a script's local time is UTC in every VM, so a page renders the same on a laptop and on a server.
Fixed
- A VM whose render panics is replaced.
- A relative redirect of a data request resolves as a 3xx does.
- A handler call follows a redirect, and resolves once the page shows its new data.
tifa devkeeps working when the system runs out of file watches: it polls the folders it cannot watch.- The build refuses
c.BindQueryandc.BindinLoadand its helpers.
Performance
Loaddata goes into the page as the JSON text Go wrote, in place of TanStack's serializer, which takes several times as long.- quickjs v0.26.1 builds an
Error's stack only when it is read, which makes React's development build render faster.
2026-10-15
Added
tifa newstarts an app in an empty folder: a SQLite todo list,tifa.yamlwith every setting, andAGENTS.mdandCLAUDE.mdfor coding agents. It uses npm when pnpm is not onPATH.- Tailwind CSS through
@tailwindcss/vite, the@/alias to the app root, and fonts and images that stylesheets reference. tifa devuses Vite's dev server, with hot updates and React refresh, and loads a rebuilt SSR bundle into the running app.- Render errors name the package and place of a failed
require, and point into the sources.
Changed
- Breaking: the default port is 9527, for
tifa devand built apps. - Breaking: the front end is bundled by the app's own Vite 8 instead of esbuild. An app with pages needs Node,
vite,@vitejs/plugin-reactand avite.config.ts, and@/andtifa/clientresolve by the app's tsconfig paths. The built program still needs no Node. - A
requireleft in the SSR bundle is a warning with its place, not a build failure.
Fixed
- The ETag of a page covers the SSR bundle, so a new build does not answer 304 with an old page.
Removed
- The esbuild bundler.
2026-10-14
First version.
Added
- The
tifapackage:Ctx,Error,ErrNotFoundandUse. - Routes from folders, Layouts,
Loadwith its result typed in TypeScript, and method handlers with typed input and result and generated client functions. - A static check of route code: where the
Ctxmay go inLoad, and which JSON shapes are allowed. tifa buildmakes one executable inbin/, with the front end embedded.tifa dev,tifa routesandtifatestfor testing route code.- Layered config from files, flags and environment variables, and a server with
OnRequestand an error flow. - Server rendering in a pool of prewarmed QuickJS VMs, on the fork github.com/liustack/quickjs v0.26.0, which no longer leaks memory when a VM runs out of it.
- Page caching with
Cache = true, ETags and 304, navigation data requests, and client-only components. - The example shop app.