Zero 0.22
TODO
Install
npm install @rocicorp/zero@0.22
Upgrading
This release reworks and simplifies the concept of query TTLs.
Previously the TTL simply measured normal "wall clock time" from when a query inactivated, including any time the app wasn't running at all. This encouraged very long or infinite TTLs, especially for preload queries, which developers always wanted registered. These infinite TTLs caused many problems, including:
- Slow connections because of hydrating tons of old queries with long TTLs.
- Thrashing the client store because large queries would blow through the "client row limit".
Now, the TTL measures "TTL time" which only elapses while Zero is running. This means that preload queries usually don't need a TTL at all, since they run the entire time Zero is active. This in turn means we can clamp the TTLs to low values, which means queries evict naturally and we don't need the client row limit.
You don't need to do anything specific to upgrade. Zero will clamp your TTLs at 10m
and print a warning. But for best results, please review the new TTL documentation. In particular, see the recommendations about how to set your TTLs (TL;DR: You can often just remove them, the defaults should usually just work).
Features
- Rework and simplify query TTLs – TTLs no longer include time that Zero isn't running, allowing TTLs to be clamped to much lower values, which allows removing the concept of the client row limit (docs, upgrading).
- SolidJS bindings now edit view entries rather than replacing them, improving performance and enabling fine-grained reactivity (PR).
- Restore
ZERO_CHANGE_STREAMER_URI
option (doc, PR). - Add
useZeroOnline
to React and SolidJS bindings (doc).
Fixes
- Handle naming
public
schema explicitly in aliases, like.from('public.table')
(PR). - Handle sorting by columns with
null
values correctly (PR). - In queries with limits, editing the node at the bound of the limit could cause incorrect results (PR).
- Fix copy runner more reliably reuse connections (PR).
- Queries early in startup could not contain non-latin chars (PR).
- Added
ttl
torun()
(PR). - SolidJS: Export
createUseZero
(PR). - Support parallel rollouts of replication-manager and view-syncer (PR).
- Fix upgrade path for already replicated array types (PR).
Breaking Changes
- Require Node v22+ (see discussion)