Zero 1.4

Performance and Reliability Improvements

Installation

npm install @rocicorp/zero@1.4

Upgrading

userID: "anon"

If you are using userID: 'anon' for logged-out users, change it to userID: null or userID: undefined. Passing userID: 'anon' is being deprecated in advance of upcoming security work in Zero 1.5.

Change this:

import {ZeroProvider} from '@rocicorp/zero/react'
 
return (
  <ZeroProvider userID={userID ?? 'anon'}>
    <App />
  </ZeroProvider>
)

To this:

import {ZeroProvider} from '@rocicorp/zero/react'
 
return (
  <ZeroProvider userID={userID}>
    <App />
  </ZeroProvider>
)

Features

  • Kysely Adapter: Added zeroKysely, so Zero server mutators can run against a Kysely transaction.
  • Analyze Query Library: Added @rocicorp/zero/analyze, for easier CLI-based query analysis.
  • Shadow Sync: zero-cache can now periodically test initial sync in the background, to catch schema drift and full-resync failures earlier.
  • Client Log Sink: Added a logSink param to Zero constructor for redirecting Zero client logs.
  • Cloud Zero Ad 🙃: Added a small notice about Cloud Zero in the zero-cache-dev startup output. Disable with ZERO_ENABLE_STARTUP_MESSAGE=0.

Performance

Fixes

Breaking Changes

None. One API was deprecated:

  • userID: 'anon' for logged-out clients

See Upgrading for more information.