Upgrade Guide
This guide explains how to move a Zerotal app to a newer release. For the list of what changed in each version, see the Release Notes.
Versioning
Zerotal's @zerotal/* packages share one version line, and what each number means
is set by how much the framework still moves in a year rather than by the letter of
semver:
- Patch (
x.y.Z) — anything that does not break. Fixes, and features too. Safe to take at any time. - Minor (
x.Y.z) — a breaking change. Always labelled BREAKING in the Release Notes, with the reason and the migration steps, and given its own section on this page. - Major (
X.y.z) — an annual consolidation, cut each July. The next is 2.0, in July 2027.
Why not strict semver: a framework this young corrects itself often, and under strict semver every correction is a major. A version line that reaches 9.0 in its first year tells a reader nothing about how much has changed — only that the project is willing to break things, which the release notes already say far more precisely. Keeping the major for a yearly line in the sand leaves it meaning something, and puts the work where it is useful: reading the notes for each minor.
Warning — a caret range crosses a minor.
"zerotal": "^1.10.0"will install 1.11.0, and its breaking change, without asking. Read the notes for every minor you cross, or pin with a tilde (~1.10.0) and cross them deliberately.
Warning — a tilde still crosses a patch, and under this scheme a patch carries features.
~1.13.2means>=1.13.2 <1.14.0, so it takes 1.13.3 without asking. That is the right default for most apps and it is weaker protection than the same range gives under strict semver, where a patch is only ever a bug fix. If you need the version to hold exactly where you put it — a release you have certified, a machine you cannot re-test quickly — pin the exact version with no range operator at all.
Note —
bun create zerotalwrites a tilde range into new apps for this reason. An app scaffolded earlier has a caret: change^to~in itspackage.jsonto get the same protection.
Warning — always upgrade the
@zerotal/*packages together. Mixing versions across core, ORM, and feature packages leads to type and runtime mismatches.
Upgrade steps
-
Bump the packages. Update every
@zerotal/*dependency to the target version, then reinstall:bun update # within the ranges in package.json # or pin exact versions, then: bun install -
Review the breaking changes. For each minor you cross, work through its section below, newest first. The Release Notes give each change its reason.
-
Run migrations. A release may add framework tables or columns:
bun zt migrate -
Type-check and test. The fastest way to surface breaking API changes:
bun run typecheck bun test -
Boot it. Start the dev server and exercise the main flows:
bun dev
1.18.0
A minor, with one type-level break and two changes that refuse what used to pass silently. Most apps need no change.
The queue driver setting gains "database"
QueueConfigShape["driver"] is now "database" | "sqlite" | "redis" | "sync", and
QueueConfig() fills in "database" where it filled in "sqlite". Both names select the same
driver, which now also runs on PostgreSQL and MySQL 8.
What to change. Nothing in config files. Code that reads the setting needs a look in two
cases: an exhaustive switch over it stops compiling until it has a "database" case, and a
check of config.get("queue.driver") === "sqlite" that meant "jobs are in the database" no
longer matches the default. Test for "database" as well.
zt migrate refuses a half-run migration-number clash
Two different migrations under one number, such as 0042_add_invoices and 0042_add_refunds
from two branches, are now refused by migrate on a database that has run one of them and not
the other. zt doctor fails on any clash, so CI catches one before merge.
What to change. Run bun zt doctor once. If it reports a clash, its message gives the fix:
renumber the later file if it has not run anywhere yet, or, if it has, keep it in place with a
letter after the number (0042b_add_refunds) and pin its recorded name with
static override id = "0042_add_refunds". A new database runs a clash in name order with a
warning, so nothing blocks a fresh environment. Migrations named by date are not numbered and
never clash.
A route name that two paths share is withheld
A generated route name leaves out [param] segments, so applications/act.ts and
applications/[id]/act.ts both came out as applications.act.store, and the route registered
last kept the name. Such a name now names neither: it is left out of the generated route types,
route() on it throws an error naming both paths, and bun zt route:list lists it.
What to change. Run bun zt route:list. If it lists a shared name, give one of the routes
its own name in the route file's meta (or with .name() in a routes file), and use that name
where you linked to it. Both routes keep answering requests either way.
Also worth knowing (not breaking)
database.backupBeforeMigrate: truetakes a SQLite snapshot beforemigrate,migrate:freshandmigrate:refreshin production. Off unless you turn it on.queue.visibilityTimeoutcan now be set. Raise it above your slowest job if you run more than one worker.- New test helpers:
withConfig(),withEnv(),Queue.settle(),Notify.settle(). Any hand-written settle loop or env restore in your tests can go. - An app created before this release can add the bare-
bun testguard with two lines inbunfig.toml; see Testing. - Run
bun zt arch:updateif the app has@zerotal/arch:AGENTS.mdnow lists the settings registry, and two skills were corrected.
1.17.4
A patch. No app needs a code change. One fix can change what an existing app sees.
bun zt serve listens on PORT
serve used to listen on 3000 unless given --port, whatever PORT or app.port said. It now
uses --port when given, else app.port, which defaults to PORT, else 3000. A PORT that is
not a port, such as 80800, stops serve with an error naming it.
What to change. Nothing, unless the host sets PORT and your proxy forwards to 3000 because
that is where the app always ended up. Point the proxy at PORT, or unset PORT.
Also worth knowing (not breaking)
bun zt arch:updateadds the newAGENTS.mdindex and skills in an app with@zerotal/arch. An app on thezerotalbundle also gets the package sections it was missing.- A new app ships with the coding-agent files. An existing app adds them with
bun add @zerotal/archandbun zt arch:install; see Agent Surface.
1.17.3
A patch. No app needs a code change. Two fixes can change what an existing app sees.
Carbon's ISO strings have three fraction digits
toISOString(), toJSON() and toDatabase() used to trim trailing zeros, so a whole second
printed as 2026-11-25T10:00:00Z and .940 as .94Z. They now always print three digits, as
Date.prototype.toISOString() does: 2026-11-25T10:00:00.000Z. Stored values now sort in time
order as strings, and match what the ORM writes.
What to change. Nothing in application code. A test that compares one of these strings
against a literal without the fraction needs .000 added to the literal.
A security header a route sets itself is kept
The security headers from app.secureHeaders are now defaults: a response that already carries
one keeps its own value, and the rest are still added. Before, the global value replaced it.
What to change. Nothing, unless a route sets one of these headers and you relied on the global value replacing it. Remove the route's header in that case.
Also worth knowing (not breaking)
http.files()andhttp.file()readname[]andname[0]fields, so files posted by the Inertia adapter asattachments[]arrive. If you readattachments[]by hand to work around this, the workaround still works and can go.- Routes under
app/routes/.well-known/are served. Remove any route you registered by hand to stand in for one. - A malformed URL is a 400 under a storage mount, and passes to your app elsewhere, instead of a 500.
1.17.2
A patch. No app needs a code change. Two fixes can change what an existing app sees.
Route types gain the verb of .name() routes
bun zt route:types used to leave a route named with .name() (Router.get(…).name("login"),
and likewise after Router.post, Router.flow or Router.view) out of METHODS in
types/routes.generated.ts. It now writes its verb, as it does for routes named by a file
route's meta.
What to change. Run bun zt route:types once and commit the file. Until then, a CI step
running bun zt route:types --check reports the file as out of date. route() is unaffected.
/health answers outside production
An app that never configured health checks now serves /health outside production, as
Health checks always said it would. Production is unchanged: the endpoint stays
off there unless you turn it on.
What to change. Nothing, unless you don't want the endpoint in development or staging: set
health: { enabled: false } in config/app.ts.
Also worth knowing (not breaking)
- More Flow pages compile ahead of time: pages registered with
Router.flow(), pages that extend a base class of your own, and pages with attribute values worked out on the server. They render the same HTML as before, and now also work undercspSafe, where the runtime fallback is refused. A page that still can't compile says why when you setZT_FLOW_COMPILE_LOG=1. - A missing route-bound record is no longer logged as an unhandled error. It still answers 404.
- The React, Vue and Flow starters are full first apps. This changes only what
bun create zerotalscaffolds; existing apps are not touched.
1.17.1
A patch. One of its fixes changes what an app on SQLite can see. No app needs a code change.
On SQLite, other requests wait for an open transaction
Bun keeps one connection to a SQLite database. While a request had a DB.transaction() open, a
statement from any other request ran inside it: a write reported success and was lost if the
transaction rolled back. Now an open transaction holds the connection, and other requests'
statements wait until it commits or rolls back.
A statement that waits longer than database.sqlite.busyTimeout (5000 ms by default) fails with
database is locked. A request that used to finish while a long transaction ran elsewhere can
now wait for it, or fail after the timeout.
What to change. Usually nothing. If you see database is locked:
- keep transactions short, and don't await outside work, such as an HTTP call or another request's result, inside one;
- pass
attemptstoDB.transaction(cb, attempts)to retry; - or raise
busyTimeoutinconfig/database.ts.
Transactions on SQLite has the details. PostgreSQL and MySQL are unchanged.
Also worth knowing (not breaking)
- A binary built by
bun zt compilenow serves the app. If you deploy with Bun and an installednode_modules, nothing changes. To deploy a binary instead, build assets first, then compile, and ship the binary with.envandpublic/: Compile to a single binary. - Admin apps scaffolded before 1.17.1 build their
users,productsandsettingstables withsynchronize, which is off in production. For a new database, copy0002to0004from the starter'sdatabase/migrations/and setsynchronize: false. Leave a database thatsynchronizealready built as it is, since those migrations would fail ontable users already exists.
1.16 to 1.17
A minor that installs less into an app. The packages it stops installing for you are the ones
only some apps use, so most of the steps below apply only to apps that use the feature. After
upgrading, run bun zt doctor. It names a missing passkey library, image driver, AI provider
SDK, Inertia framework package, and the admin panel's audit and notifications packages, each
with the command to install it. The other optional packages below are not checked: read their
steps.
Passkeys need their library installed
@zerotal/auth no longer installs @simplewebauthn/server or reflect-metadata. An app that never
uses passkeys no longer carries them.
What to change. If your app constructs PasskeyService, run:
bun add @simplewebauthn/server reflect-metadata
Without them the app still boots and serves. The first ceremony throws OptionalPeerMissingError
with that command in its message, and zt doctor and zt deploy fail until the packages are
installed.
PasskeyService now takes and returns Zerotal's own types, exported from zerotal/auth:
PasskeyRegistrationOptionsJSON, PasskeyRegistrationResponseJSON,
PasskeyAuthenticationOptionsJSON and PasskeyAuthenticationResponseJSON. Code typed with the
library's types still compiles. Code that reads attestationFormats, or extensions other than
credProps, from the returned options must drop the read.
Passkey registration accepts any authenticator
Registration no longer asks only for a platform authenticator, so a USB or NFC security key, or a phone reached by QR code, can now enrol. Sign-in is unchanged.
What to change. Nothing, if you want this. To keep 1.16's behaviour, pass
authenticatorAttachment: "platform" in the PasskeyService options. See
Authentication.
The panels run Tailwind v4
flowUiHead(), and so the admin panel and /monitor, loads Tailwind v4's browser build from
https://cdn.jsdelivr.net with an integrity hash, in place of the v3 script from
cdn.tailwindcss.com.
What to change.
-
Content-Security-Policy. If yours allows
https://cdn.tailwindcss.cominscript-src, replace it withhttps://cdn.jsdelivr.net. These pages also run two small inline scripts (dark mode and the copy buttons), so theirscript-srcneeds'unsafe-inline', and outside CSP-safe mode'unsafe-eval'as on every Flow page. Recommended CSP header has the policy. -
Your own markup under
flowUiHead(): custom admin pages, widgets, infolist entries and Flow pages are now compiled by v4. Rename the v3 classes whose meaning changed:v3 v4 shadow-sm,blur-smshadow-xs,blur-xsdrop-shadow-sm,backdrop-blur-smdrop-shadow-xs,backdrop-blur-xsbare ringring-3outline-noneoutline-hiddenbg-opacity-50(andtext-,border-)an opacity modifier, bg-black/50bg-gradient-to-rbg-linear-to-rhover:file:…file:hover:…hover:now applies only on devices that can hover, and the default palette is v4's. -
Your own stylesheet (
theme.stylesheet).- With your own v4 build: put
flowTailwindCss()(oradminTailwindCss()) andflowTokensCss()(oradminTokensCss()) in your entry, after@import "tailwindcss";. - With your own v3 build: move it to v4. The components now use class names that v3 does
not generate (
outline-hidden,shadow-xs,bg-linear-to-*), so under a v3 stylesheet focused buttons show the browser's outline, inputs lose their shadow and scroll areas their fade. Until you move, addborderColor: { DEFAULT: "hsl(var(--border))" }undertheme.extendin a hand-written config, or default borders turn light grey in dark mode;flowTailwindConfig()andadminTailwindConfig()already do this.
- With your own v4 build: put
-
Your own
bodyor*rules. The token border and page colours now sit in@layer base. An unlayeredbody { background }or* { border-color }rule of your own now wins over them.
See Components.
Flow no longer installs Alpine
Flow's client runtime ships prebuilt in @zerotal/flow, so alpinejs and the @alpinejs/* plugins
are no longer installed into your app.
What to change. Nothing, unless your own code imports alpinejs or an @alpinejs/* plugin.
Until now that import resolved through Flow. Add it to your app:
bun add alpinejs
Add any plugins you import as well.
Flow's route table has its own URL
Pages now load the app's route table from /__flow/routes/<hash>.js. In 1.16 it came inside
/__flow/runtime.js. Like that script, it passes through your app's global middleware, so it is
refused wherever a page would be.
What to change. If your own middleware turns away everything outside an allowlist of public
paths, add /__flow/* to the allowlist. Otherwise route() and navigate links stop working on
public pages, without an error on the page itself. Keep /__flow/* open at the proxy, as before.
A proxy rule or layout that names /__flow/runtime.js or /__flow/enhance.js keeps working; the
other scripts now load from content-hashed URLs. Those hashed scripts and /__flow/enhance.js are
answered before your global middleware runs, so headers it adds, such as CORS or security headers,
no longer reach them; set those at the proxy if you need them on every response.
A missing optional package throws
Zerotal packages now declare what they load from one another. An optional package that is missing
raises OptionalPeerMissingError, exported from zerotal/runtime. Its message includes the
command that installs the package. Before, the admin panel's options quietly did nothing, and
tenancy and notifications threw an error of their own.
What to change.
- Admin. A resource with
static history = trueneeds@zerotal/audit.Panel.notifications(databaseNotifications())needs@zerotal/notifications.importAction({ queue: true })anddispatchImport()need@zerotal/queue. Install each one, or remove the option. - Tenancy. If you catch
TenancyConfigErroraroundtenantCache()to detect a missing cache, catchOptionalPeerMissingErrorinstead, or install@zerotal/cache. - Notifications. If you catch
NotificationChannelUnavailableErrorfrom the broadcast channel to detect missing broadcasting, catchOptionalPeerMissingErrorinstead, or install@zerotal/broadcasting. - ORM without
zerotal. If your app installs@zerotal/ormon its own and uses the validator, runbun add @zerotal/validator. Apps on thezerotalpackage need nothing.
A missing sharp fails conversions
With driver: "sharp" in config/media.ts, a missing or unloadable sharp used to produce no
conversions, without an error. Now addMedia() into a collection with conversions throws
OptionalPeerMissingError once the original is stored, and queued conversions fail.
What to change. Run bun add sharp (0.33, 0.34 or 0.35 are supported), or set driver: "bun".
Code that caught MediaError for a missing sharp should catch OptionalPeerMissingError. See
Media.
.vue pages need @vue/compiler-sfc 3.3 or later
What to change. Install the compiler at the same version as vue:
bun add vue@^3.5 @vue/compiler-sfc@^3.5
New starters already have it. A Vue app with inertia.ssr: true and no compiler now fails at boot
instead of rendering the page's file path. React apps need nothing. Code that matched the old React
SSR error message should catch OptionalPeerMissingError instead.
On Bun 1.4, Carbon hands out Bun's own Temporal values
Carbon now uses the runtime's Temporal when there is one, and loads @js-temporal/polyfill only on
Bun 1.3.
What to change. Nothing on Bun 1.3. On Bun 1.4, an app that imports Temporal from
@js-temporal/polyfill and passes a Carbon ZonedDateTime to that import's ZonedDateTime methods
(compare, from, until, since, equals), or checks Carbon's values with instanceof against
it, must use the global Temporal. An app that runs on both Buns can define its own:
import { Temporal as Polyfill } from "@js-temporal/polyfill";
export const Temporal = (globalThis as { Temporal?: typeof Polyfill }).Temporal ?? Polyfill;
That is always the implementation Carbon runs on. See Carbon.
The ORM reads dates back as the instant saved
The ORM writes every date as UTC. It now reads them back that way too, whatever the server's TZ:
zone-less date-time text, such as MySQL's YYYY-MM-DD HH:MM:SS or SQLite's CURRENT_TIMESTAMP,
is read as UTC, and MySQL DATE, DATETIME and TIMESTAMP columns read the same on Bun 1.3 and
1.4. In 1.16, under a TZ other than UTC, a MySQL date moved by the zone's offset between a save
and the next load.
A value that something else wrote as local time is now read as UTC as well, so under a TZ other
than UTC it reads differently from 1.16. That covers a MySQL column that NOW() or
CURRENT_TIMESTAMP filled on a server outside UTC, and text written as local time by another
program or by hand-written SQL. Nothing stored changes.
What to change.
- If
TZis unset or UTC and your MySQL server runs in UTC, nothing. - Otherwise run
bun zt doctor. If it warns about MySQL's time zone, run the server in UTC (default-time-zone = '+00:00'under[mysqld], orSET GLOBAL time_zone = '+00:00'), then restart the app so its connections reopen. Bun 1.4.1 and later open every connection in UTC; Bun 1.3 and 1.4.0 keep the server's zone and cannot set one per connection. - Convert rows written in the old zone with
CONVERT_TZ, or read such a column through a custom cast. The MySQL server's time zone shows which rows move and the statement for each. - Remove any code that added the zone offset back to dates the ORM read. It now corrects twice.
- On Bun 1.3, prefer
TZ=UTC. Bun 1.3 cannot read back a MySQL time in the zone's daylight-saving gap, and it reads a PostgreSQLtimestamp without time zonecolumn queried with no bound values shifted the first time that query runs on a connection. Bun 1.4 reads both correctly.
A Carbon in where() now binds the way a save stores it, so a query that compared against a
Carbon can return different rows: on MySQL it now finds rows it used to miss, and on SQLite and
PostgreSQL an equality keeps its milliseconds.
Also worth knowing (not breaking)
NotificationFakemoves. Changeimport { NotificationFake } from "zerotal/testing"tofrom "@zerotal/notifications", and runbun add -d @zerotal/notificationsif yourpackage.jsondoes not list it. The old import is removed in 1.18.@zerotal/aibounds the Anthropic SDK to>=0.70.0 <2, so an app on SDK 2.x gets a peer warning.- Vue and api apps scaffolded before 1.17 can apply the starters' sign-in fix.
- In
app/models/User.ts, importAuthenticatablefromzerotal/authand extendModel.using(Authenticatable). - Add the
remember_tokenmigration thatbun zt doctorprints. - In a Vue app, also add
StorageProviderafterDatabaseProviderinbootstrap/providers.ts.
- In
bun zt compilewith no--entrynow compileszt.ts, so the--entry=zt.tsworkaround can go. The binary starts and runs console commands, but cannot serve an app yet: keep deploying with Bun and an installednode_modules, as Deployment describes.- On Bun 1.4,
bun build --outfilefails for an app that uses Flow or devtools, because their prebuilt scripts are written as separate files. Use--outdir, orbun zt compile.
1.16.4
A patch. Two of its changes can alter what an app sees; neither needs a code change in an app that configures passkeys correctly and lists what it imports.
A misconfigured passkey setup is thrown
PasskeyService.verifyRegistration() and verifyAuthentication() answered "passkey.invalid" for
every failure, including an origin ending in / or an rpId written in non-ASCII letters rather
than punycode. Those failed every ceremony while looking like a bad response from the browser. They
are now thrown, with a message that names the fix. A response that fails verification is still
"passkey.invalid".
What to change. Nothing, if passkeys work today. If they never have, the error now says why. See Authentication.
@zerotal/flow-ui no longer installs clsx
cn() flattens its input itself, with the same output. The lib/cn.ts that flow:add and
flow:init copy into an app imported clsx, and the commands asked you to add it only when it
did not already resolve, which in an app with flow-ui installed it usually did. Such an app was
using flow-ui's copy, and that copy is gone.
What to change. If your code imports clsx and your package.json does not list it, run
bun add clsx, or replace a copied lib/cn.ts with the new one, which needs only
tailwind-merge.
1.16.3
A patch. Two of its fixes change what an app can see; neither needs a code change unless a test relied on the old answer.
A thrown ValidationError answers the way validate() does
A ValidationError from @zerotal/core/errors used to get the handling of any other 4xx: a styled
422 page for a browser, and for every other client a 422 whose JSON had no errors. It now
follows validate(). A client whose Accept prefers JSON gets a 422 with your message and
every message per field. Anything else, a request with no Accept included, is redirected back
with 303, the first message per field flashed as errors and the body as old.
What to change. A test that throws one and expects a 422 should send
Accept: application/json, with asJson(). A test that expects the redirect needs nothing. See
Errors.
A failing response finalizer shows in development and tests
A callback registered with ctx.onResponseReady() that throws was logged and the response went
out anyway. Where development surfaces are on, which includes zt test, the error's response now
replaces it. The finalizer the framework registers is the session's, so the case you will meet is
a session too big for the cookie driver: the request answers with SessionCookieOverflowError,
whose message names the biggest keys, instead of sending the page without the cookie and losing
every flash, error and old input on it. Production still logs and sends the response.
What to change. Nothing, unless a test was passing over an overflowing session. Store an identifier rather than the object, or move to a server-side driver. See Session.
1.16.2
A patch, but five of its fixes change what an app can see. None needs a code change unless it relied on the old behaviour.
Mail refuses what it cannot send as written
An address that holds a control character, whitespace, <, >, , or ;, or that is longer
than 254 characters, throws InvalidMailAddressError, and so does a display name holding a line
break. The check runs when the address is set on a MailMessage, when a notifiable's email
becomes the recipient, and again in each driver. "Ada <ada@example.com>" is still accepted and
split into a name and an address, and mail.from.address may be written that way.
What to change. Validate addresses where users type them, with the validator's email rule,
so a bad one is a 422 on the form and not an exception when the mail goes out. A configured
sender the check would refuse now fails at boot, naming the key. See
Notifications.
A test that calls MailMessage.toPayload() itself must pass both arguments, the default sender
and the fallback recipients, as its signature always said. Called with no recipients set and no
fallback, it used to return a payload with to undefined; it now throws.
Idempotency keys are scoped
IdempotencyMiddleware keys a stored response by the signed-in user, or the session the client
sent back, plus the method, host, path, query string and the client's key. It used the key alone,
so one caller could be answered with another's response.
What to change. Nothing, for clients that retry the same request with the same key. Responses
stored before the upgrade are not replayed, so a retry that straddles the deploy runs its handler.
Register the middleware after session and authentication for the default scope to see the user,
or pass scope. See Cache.
A validation error answers JSON when Accept prefers it
validate(), FormRequest and the exception handler now agree: JSON when application/json has
a higher q-value than text/html, or the same and comes first, with or without X-Inertia. A
ValidationError you throw yourself joined them only in 1.16.3.
text/html, application/json used to get a 422 from the validator and now gets the redirect;
X-Inertia with Accept: application/json used to get a redirect and now gets the 422. Browsers
and Inertia's own visits are unchanged.
What to change. A test that posts and expects a 422 should send Accept: application/json.
String SQL counts its placeholders
A ? inside a string literal, a quoted identifier or a comment is no longer a placeholder in
DB.raw(), whereRaw() and the other string-SQL paths, and DB.raw(sql, bindings) throws when
the number of placeholders and bindings differ. A query that bound the wrong values before now
binds the right ones or fails loudly.
What to change. Nothing, if your queries worked. Write PostgreSQL's bare ? jsonb operator in
the tagged form. See Database.
A thrown 4xx is not reported
An HttpError below 500 and an abort(4xx) are expected outcomes: logged as one warning, and not
passed to report(). An error that only carries an upstream status, such as an HttpClientError
from a 401, is still reported.
What to change. If an error tracker counted 4xx responses through report(), count them from
the access log or RequestFailed instead, which carries expected.
Also worth knowing
- Queue: a chained job and a batch's
then,catchandfinallyjobs go to their own class's queue; make sure a worker polls it.retryFailed()throwsE_QUEUE_UNKNOWN_JOBfor a job whose class is not registered. ctx.body()returns{}for a JSON body that is a number, string, boolean ornull.- A file-route resolver's
ctx.middlewareno longer includes the group's middleware; the registrar adds it.
1.15 to 1.16
One breaking change, to what app.throttle.trustedProxies counts, and one place that now
follows it.
trustedProxies counts from the right, and the client is the last entry
Each proxy appends the address it received the request from to X-Forwarded-For, so behind
one proxy the client is the last entry. trustedProxies: 1 used to read the entry before it,
which is one the client can write. It reads the last entry now, and the same count is used
everywhere the framework needs the client's address: every throttle, the sign-in lockout,
the audit trail and Flow.
| Your proxy | Before | After |
|---|---|---|
Appends one entry (nginx $proxy_add_x_forwarded_for, Caddy, most load balancers) | 1 | 1, no change |
| Appends two entries, its peer and its own address | 1 | 2 |
| Two proxies, one entry each | 2 | 2, no change |
What to change. Look at one request's X-Forwarded-For as your app receives it, with no
header sent by the client. If it has one entry per proxy, leave the count alone. If it has
more entries than you have proxies, the count goes up by the difference. Getting it wrong
the other way is easy to see: every request reads as your load balancer's address, and the
first throttle to fill refuses everyone.
The audit trail stops reading X-Forwarded-For unless you say how many proxies there are
With captureRequest, an audit entry's ip_address was the leftmost X-Forwarded-For
entry, whatever trustedProxies said. It now follows the same rule as the throttles: the
socket address with no trustedProxies, otherwise the client counted from the right.
What to change. Nothing, if app.throttle.trustedProxies is already set. An app behind a
proxy without it will start recording the proxy's address on new entries; set the count, as
Deployment describes, and zt doctor warns about.
Entries already written keep the address they were written with.
Also worth knowing (not breaking)
ctx.clientIp()returns the client's address by the same rule, ornullwhen the request offers none. Use it where you used to readX-Forwarded-Foryourself;ctx.ip()is still the socket, which behind a proxy is the proxy.- An app scaffolded with 1.15.5 has a second Bun in
node_modules/bunand prints a warning about it. Add abunfig.tomlwith an[install]table holdingpeer = false, deletenode_modules, then runbun install. Adding the setting alone keeps the copy already installed. See 1.15.6.
1.14 to 1.15
Two breaking changes. Both replace something that was quietly wrong with something that says so.
createdAt, updatedAt and deletedAt are Carbon, not Date
They always hydrated as Carbon — every datetime column does — but were declared Date,
so the type was wrong on any row loaded from the database. Worse, the runtime class
depended on how you got there: a Carbon after a load, a raw Date after a save(), a
touch() or a soft delete(). The same property on the same model, matching its declared
type in neither case.
// before — compiled, and threw at runtime on a loaded row
const ms = order.createdAt.getTime();
// after
const ms = order.createdAt?.valueOf(); // epoch milliseconds
const iso = order.createdAt?.toISOString(); // "2026-09-04T08:15:00.000Z"
const native = order.createdAt?.toDate(); // a real Date, if something needs one
What to change. Compile and follow the errors: every one is code that would have thrown
if that line had run against a loaded row. Carbon has toISOString(), valueOf(),
toJSON() and toDate(), plus its own comparison and arithmetic — it does not have
getTime(), getFullYear() or the rest of the Date accessors.
If you were working around the old inconsistency, the workaround can go:
// before — needed because the class varied by path
const ms = ((value as any).toDate?.() ?? value).getTime();
// after
const ms = value.valueOf();
A cast that hid the mismatch (order.createdAt as unknown as string) now hides a different
one — .slice(0, 10) on a Carbon still throws. Use .toISOString().slice(0, 10).
A broken _middleware.ts stops the boot
Two ways a _middleware.ts could fail to apply used to be silent, leaving the routes it
was written to guard live and unguarded:
export default [Middleware]— the loader only ever readexport const middleware.export defaultis the natural guess, because every route file in the same directory default-exports its handler.- A file that fails to import — a typo, a bad import path, a circular import, a
SyntaxError. All shared acatchwith the missing-file case, so all read as "this directory has no middleware".
Both now fail the boot, naming the file and the fix. A directory with no _middleware file
is unchanged: absence is the convention working, and stays silent.
// app/routes/employer/_middleware.ts
// before — silently ignored, subtree served unguarded
export default [EmployerMiddleware];
// after
export const middleware = [EmployerMiddleware];
What to change. Boot the app once — bun zt route:list is enough. If nothing changes,
you had none of this. If a _middleware.ts file was never applying, you will be told which
one, and the routes under it were open until now.
Under zt dev a reload that hits this aborts and keeps serving the previously compiled
routes, so a guard never drops mid-session.
Also worth knowing (not breaking)
- A save or delete on a model with no primary-key value now raises an error (1.15.1).
It used to bind NULL, match no row, and resolve as though it had written. The one way to
reach it is a partially hydrated instance —
Post.query().select("title").get(), thensave()on a result — and in that state the write was already being thrown away. What changes is that you hear about it:E_NO_PRIMARY_KEY, naming the model and the key. Select the key column alongside whatever else you need, and the write works as intended. bun zt route:typesregenerates the Inertia page registry too. Adding a page and gettingTS2345: … not assignable to parameter of type 'PageName'is now fixed by the command whose name says it generates types.--checkgates on both files.bun zt testno longer inherits.env's mail, queue, session and cache drivers. They get their in-process defaults (log,sync,cookie,memory) so a suite cannot open a real SMTP or Redis connection because of how one machine is configured. A value set in the shell still wins,.env.testis read and merged last, and--keep-envturns it off. See Testing.zt doctor's secure-headers check probes the deployed URL instead of inferring HSTS from config, so an app behind a TLS-terminating proxy is no longer reported as downgradeable when the header is being sent.
1.13 to 1.14
One breaking change, and it is small in practice.
inertia.ssr: true no longer registers POST /__ssr. Rendering and the endpoint are
separate decisions now:
// config/inertia.ts — before
export default InertiaConfig({ ssr: true }); // rendered, and opened the route
// after
export default InertiaConfig({ ssr: true }); // renders, and opens nothing
export default InertiaConfig({ ssrEndpoint: true }); // opens the route, for an
// external renderer
Most apps need no change. If you set ssr: true for server rendering — which is what
the option is for — you keep exactly that, and you stop exposing a route you were not
using. The endpoint had no in-process caller before 1.13.5, so an app that set the flag was
getting the route and nothing else.
Add ssrEndpoint: true only if something outside the web process calls /__ssr — a
separate renderer, a second host. If you are not running one, you were not using it.
Why split them: turning rendering on should not open a route that renders arbitrary components from POST input, however well guarded. One switch, one thing.
1.12 to 1.13
Three retirements in one crossing, deliberately together: each is a small migration, and
three minors each asking an app to move costs more than one that asks properly. zt upgrade
does the mechanical half.
bun zt upgrade --to 1.13.0
Component.client(…) is removed — use the $ tagged template
The reason this did not wait: client() took a string and queued it to be evaluated in
the browser, so the caller owned the escaping. Its own docblock had to say never interpolate
unescaped user input, which is a warning about a footgun rather than a design. $ is a
tagged template, so every ${…} is encoded as a JS literal before it reaches the page.
// in a component class body — before
this.client(`$refs.titleInput.focus()`);
this.client(`toast(${JSON.stringify(this.search)})`); // escaping was yours to remember
// after
this.$`$refs.titleInput.focus()`;
this.$`toast(${this.search})`; // encoded for you
The codemod rewrites a call whose argument is a single literal. A call whose argument is a
variable or a concatenation is reported rather than rewritten, because those are exactly the
ones the security note was about — and wrapping the finished string as $`${expr}` would
encode it as a string literal and stop running it as code. Read those and interpolate through
$ instead.
Removing it also frees client as a property name on your components, the way removing
title did in 1.7.3.
LockDriver.extend() is required
Only affects a custom lock driver; the three built-in ones already implement it.
It shipped optional in 1.5.0 with acquire(key, owner, ttl) as the fallback, and the fallback
was correct only by coincidence: acquire happens to be an owner-guarded refresh on every
built-in driver, and nothing in the interface said it had to be. A driver whose acquire takes
a free lock — the ordinary reading of the word — would have had refresh() silently take a
lock another holder owned, which is the one thing a lock exists to prevent.
Implement extend(key, owner, ttlSeconds): push the deadline out, return false when the key
is free or held by someone else.
routes:types and serve --dev are retired
route:types and dev are the real names. The codemod rewrites both in scripts and CI config.
serve --dev fails loudly rather than being ignored. The flag is still declared for exactly
that reason: flag parsing is non-strict, so deleting it would have left serve --dev starting a
plain server with no watcher and no message — a retired flag that silently changes what a
command does.
1.11 to 1.12
One breaking change, and it is the intended kind: a minor, announced, with the reason.
A boolean written to a text column is refused. A bare @column() resolves to
{ type: "string" }, so a boolean property decorated with one was stored as text —
and a text column has text affinity, so false was stored as "0", which is truthy
in JavaScript. Every if (model.flag) on such a column took the wrong branch for a
stored false, on every row, with nothing in the app or the database registering a
fault. An app found it when a feature flag read as enabled for every record that had
it turned off.
// in a model class body — before, and silently wrong
@column() declare active: boolean;
// after
@column("boolean") declare active: boolean;
There is no correct coercion: 0 becomes "0" and "false" is truthy too, so the
value cannot survive the round trip. The write now throws ColumnTypeError, naming
the property and the fix.
What to do before upgrading
Find your boolean properties whose @column() declares no type. The decorator
cannot find them for you — declare active: boolean erases the TypeScript type at
runtime, so a bare @column() on a boolean is indistinguishable from one on a string
until a value arrives. A search of your models for @column() with no argument, read
against the property types beside them, is the reliable way.
The rows you already wrote are still text. This release stops new bad writes; it
does not migrate old ones. A column that has been holding "0" and "1" needs both
the decorator fixed and the stored values converted — on SQLite,
UPDATE widgets SET active = CAST(active AS INTEGER) after the column type is
corrected. Until then those rows keep reading truthy, which is the behaviour you are
upgrading to escape.
If a text column really should hold a boolean, say so explicitly and it is
honoured: @column({ type: "string", cast: "boolean" }). The guard is for the column
that says nothing, not for every string column.
1.11.2
One breaking change, and it is in a release that should not have carried one.
countTokens returns number | null. Ai.countTokens() and
AiDriver.countTokens() used to return number, with 0 standing in for "this
provider cannot count". Only Anthropic has a counting endpoint, and 0 is also a real
count for an empty prompt — so the old return value could not tell you which it meant,
and a budget built on it was quietly wrong for every other provider.
// before
const tokens = await Ai.countTokens(prompt);
if (tokens > 1000) shorten();
// after
const tokens = await Ai.countTokens(prompt);
if (tokens !== null && tokens > 1000) shorten();
A custom AiDriver needs no change — returning number still satisfies
Promise<number | null>. Only callers do.
Why this is in a patch. It was made while @zerotal/ai was still experimental
and therefore outside the compatibility promise, in the same release that then promoted
the package to stable. That ordering is real and it is not a distinction anyone
installing 1.11.2 can observe: what arrives is a patch that breaks a build. The rule
stands as written — a patch does not break — and this release is recorded as the
exception rather than as a reinterpretation of it. See
the support policy.
Everything else in 1.11.2 is additive. @zerotal/ai's other surface change — toSchema,
strippedConstraints, resetSpend and resetStats becoming @internal — leaves those
exports working; they are no longer covered by the promise, which is different from
being gone.
1.10 to 1.11
Two changes to how the database is treated. Both are BREAKING in the narrow sense that a working app can stop working on upgrade, and both refuse loudly rather than doing something quiet.
-
SQLite enforces foreign keys.
database.sqlite.foreignKeysdefaults totrue, soPRAGMA foreign_keys = ONis set on every connection. Until now SQLite ignored them, which meantconstrained()andcascadeOnDelete()in your migrations described behaviour the database would not perform — deleting a parent left its children, silently.The risk is data you already have. A child row whose parent is missing was legal without enforcement and is a constraint violation with it, so a write touching one now fails. Find them before deploying:
bun zt db:check-foreign-keysIt lists every offending row by table and rowid and exits non-zero, so a release script can gate on it.
zt doctorreports the same thing. Delete them or repoint them at a parent that exists.To take the release without dealing with it yet:
// config/database.ts export default DatabaseConfig({ sqlite: { foreignKeys: false } });Take that override back off afterwards. With it in place
cascadeOnDelete()is a comment. -
A renumbered migration is refused rather than re-run. A migration is recorded under its filename, so renaming one makes an applied migration look pending — the runner tries it again and fails on
table already exists. Renumbering001_to0001_to match the scaffold's convention is exactly the kind of tidying that causes it, and it takes every migration with it.migratenow recognises that shape and stops:"0001_create_users" looks like "001_create_users", which has already run — the same migration renumbered rather than a new one.If you meant to rename, pin the identity to what the database already holds and the filename is then free:
export default class CreateUsers extends Migration { static override id = "001_create_users"; }If it really is a new migration, give it a name that does not collide once the leading digits are removed.
1.9 to 1.10
Three settings changed meaning. Each is quiet if it does not apply to you, and each is worth thirty seconds of checking if it does.
-
scheduler.timezoneis honoured. It was documented as informational and read by nothing, so whatever you put there had no effect and your schedules ran in the server's zone. It is now the zone every schedule is evaluated in unless the task sets its own.Its default moved from the literal
"UTC"to the system zone, so an app that never set the key keeps doing exactly what it did. The case to check is an app that did:// config/scheduler.ts export default SchedulerConfig({ timezone: env("APP_TIMEZONE", "UTC") });On a server that is not on UTC, that line used to do nothing and now moves every schedule. Either set it to the zone you actually want your crons read in — which is the point of the setting — or delete the key to keep the server's zone.
bun zt schedule:listprints each task's next run in its own zone, which is the quickest way to see whether anything moved. -
Named rate limiters need
.trustedProxies(n)behind a proxy.RateLimiter's.byIp(),.byUser()and.byApiKey()ignored the proxy count entirely and readX-Forwarded-Forunconditionally. They now follow the same ruleThrottleMiddlewarealready did — the header is consulted only when you say how many proxies sit in front:RateLimiter.for("login").limit(5).every(60).byIp().trustedProxies(1).register();Without it the address used is the socket's, which behind a proxy is the proxy's, and every visitor shares one bucket.
bun zt doctorreports any limiter that needs this — it could not before, because its check exempted custom key resolvers and all three of these are one. -
React apps using SSR need
@inertiajs/reactinstalled. The same adapter your browser entry point already uses. Server-side rendering now goes through its<App>, which is what makes<Head>produce a title and an og: card in the HTML your server actually sends. If it is missing you get a named error at render time, not a silent omission.Nothing to change if you already have it as a dependency, which every React Inertia app does.
1.7.2 and 1.7.3
Two patch releases that broke, each on the judgement that the old form had no meaningful use yet. Both are a find-and-replace.
-
Rename
echo:listeners tosocket:(1.7.2).echo:,echo-private:andecho-presence:in@onare nowsocket:,socket-private:andsocket-presence:, and the browser global iswindow.Socket, notwindow.Echo. There is no alias, so an unrenamed listener never subscribes and nothing says so:- @on("echo-private:issues.5,CommentPosted") + @on("socket-private:issues.5,CommentPosted") -
Replace
this.title(…)withstatic title(1.7.3), as a string or a function of the component. It is resolved on every render, so a title that depends on state follows it:// Before override async mount(): Promise<void> { this.title(`Search: ${this.query}`); } // After static title = (c: SearchPage) => (c.query ? `Search: ${c.query}` : "Search");
The 1.7.2 and 1.7.3 release notes have the reasons.
1.4 to 1.5
-
Move query values into
route()'s third argument. A param that matches no:segmentused to be appended to the query string, so a typo'd param name produced a wrong URL instead of an error. Params are now exact, and an unknown key throws:route("search", { q: "zerotal", page: 2 }); // before route("search", {}, { q: "zerotal", page: 2 }); // nowThe same applies anywhere params are passed on their own —
redirect().to(name, params),redirectTo(),Url.route(),Uri.route(), and Flow'sredirectRoute(). Where those need a query string, build the URL withroute()and redirect to it.To find them: search for
route(calls whose second argument holds a key that is not a:segmentof that route.bun zt route:listprints the patterns to check against, and after step 2 the type-checker finds the rest for you. -
Generate and commit the route types — this is what turns the change above from a runtime error into a compile error, and it is the point of the release:
bun zt route:types # writes types/routes.generated.tsCommit the file.
zt devrefreshes it on every restart; addbun zt route:types --checkto CI so it cannot go stale. Skipping this step is supported —route()then behaves exactly as it did, minus the query-param change. -
Rebuild the Inertia page registry to get typed page names and props:
bun zt inertia:buildThen fix what it finds. Two are worth expecting: a page whose component declares a prop the controller never passes (add it, or make the prop optional), and a
defer()/optional()prop the component declares as required (make it?— it really is absent on first paint). Declare anyInertia.share()keys of your own on theSharedPropsinterface so pages that read them do not look unpassed; see Typed props.
1.2 to 1.3
-
Compose mixins with
using.ComponentWith(...)andBaseModelWith(...)are removed; the base class composes its own mixins:- class PostsPage extends ComponentWith(Pagination) {} + class PostsPage extends Component.using(Pagination) {} - class User extends BaseModelWith(Authenticatable, Roles) {} + class User extends Model.using(Authenticatable, Roles) {}A codemod in the repository,
scripts/codemod-mixin-composition.ts, rewrites the call sites and imports. How a mixin is written is unchanged, andBaseModelstays exported as an alias ofModel. The 1.3.0 release notes have the rest.
Pre-release checkout to 1.0
1.0 is the first public release, so there is no earlier published version to move from. If you have been building against a pre-release checkout of the source, these are the changes that need action. Full detail is in the 1.0.0 release notes.
-
Import storage from
@zerotal/core/storage. The separate@zerotal/storagepackage is gone — file storage ships inside core, as a subpath besidecore/loggerandcore/http. Drop the dependency frompackage.jsonand update the imports:// before import { Storage, StorageProvider } from "@zerotal/storage"; // after import { Storage, StorageProvider } from "zerotal/storage";Nothing else changes: the same
StorageProvider, the sameconfig/storage.ts, the same disks and driver API. -
Move public files to
storage/public. The public disk's root changed fromstorage/app/publictostorage/public, and it is served at/storage/publicrather than/storage. Everything else under the storage root is private: a local disk outsidestorage/publiccan only be served withserve: { signed: true }, and serving one openly now fails at boot.mv storage/app/public storage/publicAny hardcoded
/storage/...link becomes/storage/public/.... Better, ask for the URL instead:await Storage.publicUrl(path, { disk: "public" }). -
Expect logs on disk. Every entry now goes to the terminal and a date-rotated file under
./storage/logs, kept 14 days. If you ship stdout to a collector and want no files, setfile: falseinconfig/logging.ts. If you had adefault: "daily"channel to get files, you can delete it — and your terminal output comes back, since console is no longer a channel thatdefaultcan point away from. -
Add a
fillable(orguarded) list to every model written from user input. Models now guard mass assignment by default — a model declaring neither rejects every attribute passed tocreate()/fill()with aMassAssignmentError. For trusted, non-user writes useforceFill()/forceCreate(), wrap a block inModel.withoutGuard(fn), or setstatic unguarded = true. -
Ensure
APP_KEYis set in every environment.localstoragetemporaryUrl()now throwsStorageKeyMissingErrorinstead of falling back to a hard-coded key, and a key under 32 bytes now throws at boot in production-like environments (APP_ENV=production/prod/staging). Generate one withbun zt key:generate. -
Update merged-package imports.
@zerotal/lock→@zerotal/core/lockand@zerotal/logger→@zerotal/core/logger; remove both frompackage.json. No API changes. -
Re-check ops-surface gates. The devtools inspector, the monitor panel's default open access, and the dev error page now key off
APP_ENVand fail closed — an unset orstagingAPP_ENVno longer exposes them. The admin panel and the monitor/metricsendpoint are now default-deny/opt-in. Set an explicitmiddleware/authinconfig/admin.tsandconfig/monitor.ts, and setAPP_ENV=developmentlocally if you relied on the previous open-in-dev behaviour with an unset value. -
Redis cache prefix moved to
zerotal:cache:. If you run cache and queue on the same Redis DB,Cache.flush()no longer deletes queued jobs. Existing cache entries under the oldzerotal:prefix are effectively invalidated on upgrade (they are simply not read again) — no action needed beyond expecting a cold cache.
The managed zt.ts
zt.ts is framework-managed — the header says do not modify. If a release
changes the CLI entry point, re-scaffold it rather than hand-editing. Because you
never customized it, replacing the file is safe; your app lives in app/,
bootstrap/, config/, and routes/.
Things to check after a major upgrade
- Config shapes — a
*Config()factory may have new or renamed fields. Your editor's types will flag mismatches; re-checkconfig/*.tsagainst the Configuration docs. - Provider registration — confirm any package providers you list in
bootstrap/providers.tsstill export the same names. - Deprecations — a minor release may log deprecation warnings for APIs removed in the next major. Resolve them before taking the major.
- Lockfile — commit the updated
bun.lockso deploys install the same versions.
Next steps
- Release Notes — per-version changes and migration notes.
- Configuration — config factories whose shapes may change.
- Getting Started — the baseline project layout.