Zero 0.26

Schema Backfill and Scalar Subqueries

Installation

npm install @rocicorp/zero@0.26

Features

  • Schema Backfill: Zero now natively supports adding columns with non-constant defaults, or adding existing columns to a custom publication. There is no longer a need to touch every row in the database to backfill data manually.
  • Scalar Subqueries: Added a new optional optimization for exists queries that filter by related data with a one-to-one relationship. This can improve query performance significantly for cases where the subquery result changes rarely.
  • Virtual Scroll: Added zero-virtual library for efficient infinite scrolling in React.
  • Support for time and timetz columns: Added support for time and timetz columns (thanks GRBurst).
  • Comparing to undefined: Added a new convenience for comparing to undefined. This is useful for filtering by nullable fields.
  • zero.delete(): Added a more convenient way to delete all data from the browser's IndexedDB database.

Fixes

Breaking Changes

Just two very minor breaking changes this time, that are unlikely to affect most users:

  1. If you send custom headers to query or mutate endpoints, you must now allowlist them via ZERO_MUTATE_ALLOWED_CLIENT_HEADERS or ZERO_QUERY_ALLOWED_CLIENT_HEADERS. By default, no client-provided headers are forwarded.
  2. If you have very large mutations, note that WebSocket messages are now limited to 10MB by default. Increase ZERO_WEBSOCKET_MAX_PAYLOAD_BYTES if needed.