# RxDB 17.0.0

> RxDB 17 introduces improved reactivity APIs, better debugging, breaking storage fixes, and multiple plugins graduating from beta.

# RxDB 17.0.0 - Local-First to the Moon (beta)

RxDB 17 focuses on **better reactivity**, **improved debugging**, and **important storage fixes**, while also graduating several long-standing plugins out of beta.

Most applications can upgrade easily, but **users of OPFS and filesystem-based storages must review the migration notes carefully**.

:::note
RxDB version 17 is currently in **beta**. For testing, please install the latest beta version [from npm](https://www.npmjs.com/package/rxdb?activeTab=versions) and provide feedback or report issues [on GitHub](https://github.com/pubkey/rxdb/issues/7574).
:::

## Migration

RxDB 17 is mostly backward-compatible, but please review the following points before upgrading:

### Storage migration required
If you use any of the following storages, **you must migrate your data** using the [storage migrator](../migration-storage.md):

- OPFS RxStorage  
- Filesystem RxStorage (Node)
- IndexedDB RxStorage (if you use attachments)

For all other RxStorages, data created with RxDB v16 can be reused directly in RxDB v17.

### Other migration notes

- The GitHub repository **no longer contains prebuilt `dist` files**.  
  Install RxDB from npm or run the build scripts locally.
- `toggleOnDocumentVisible` now defaults to **`true`**. [#6810](https://github.com/pubkey/rxdb/issues/6810)
- Schema fields marked as `final` **no longer need to be explicitly listed as `required`**.
- Some integrations now use **optional peer dependencies**. You may need to install them manually:
  - `firebase`
  - `mongodb`
  - `nats`

## Features

### Improvements for our Vibe-Coders 💻✨

To improve vide-coding with RxDB, we made the following DX-for-LLM improvements:

- **ADD** [https://rxdb.info/llms.txt](https://rxdb.info/llms.txt) for LLM-friendly documentation access.
- **ADD** `ERROR-MESSAGES.md` to the root of the RxDB package so your LLM knows about all possible errors.
- **ADD** Errors now contain a `cause`, `fix` and `docs` property which tells your LLM what went wrong and where to find information about possible fixes.
- **ADD** `@example` tags to TypeScript comments in many parts of the typings.

To improve vibe-coding when working with RxDB directly we:

- ADD [.aiexclude](https://developer.android.com/studio/gemini/aiexclude?hl=de) file to reduce context.
- ADD [.agent Skill](https://antigravity.google/docs/skills) to verify code changes.
- ADD `.claudeignore` file to reduce context.
- ADD `.claude/settings.json` to improve post-generation testing.
- ADD `CLAUDE.md`

### Better/More Integrations

- **ADD** [WebMCP Plugin](../webmcp.md) to expose RxDB collections to AI Agents via the Model Context Protocol.
- **ADD** [Google Drive Replication](../replication-google-drive.md) plugin to replicate client data to a clients Google Drive folder without any server.
- **ADD** [react-hooks plugin](../react.md).

### 🔁 Reactivity & APIs

- **ADD** `RxDatabase.collections$` observable for reactive access to collections
- **ADD** support for the JavaScript `using` keyword to automatically remove databases in tests
- **ADD** new `reactivity-angular` package
- **CHANGE** moved `reactivity-vue` and `reactivity-preact-signals` from premium to core
- **FIX** query results becoming incorrect when changes occur faster than query update [#7067](https://github.com/pubkey/rxdb/issues/7067)

### 🧠 Debugging & Developer Experience

- **ADD** `context` field to all RxDB write errors for easier debugging
- **ADD** improved OPFS RxStorage error logging in `devMode`, including:
  - strict `TextDecoder` mode
  - detailed decoding error output
- **ADD** internal `WeakRef` TypeScript types so users no longer need to enable `ES2021.WeakRef`
- **CHANGE** `toggleOnDocumentVisible` now defaults to `true` [#6810](https://github.com/pubkey/rxdb/issues/6810)
- **ADD** docs page about [testing with RxDB](../testing.md).

### 🗄️ Storage, Queries & Replication Fixes

- **FIX** OPFS RxStorage memory and cleanup leaks
- **FIX** memory-mapped storage not purging deleted documents
- **FIX** `RxCollection.cleanup()` ignoring `minimumDeletedTime`
- **FIX** short primary key lengths not matching replication schema [#7587](https://github.com/pubkey/rxdb/issues/7587)
- **FIX** retry DenoKV commits when encountering `"database is locked"` errors
- **FIX** close broadcast channels and leader election **after** database shutdown, not during
- **FIX**: migration memory leak: old collection meta doc not deleted [#7792](https://github.com/pubkey/rxdb/pull/7792)
- **CHANGE**: Store data as binary in IndexedDB to use less disc space.
- **CHANGE**: Pull-Only replications no longer store the server metadata on the client.
- **FIX**: downstream replication issues [#7804](https://github.com/pubkey/rxdb/pull/7804)
- **FIX** add event guard to count and findByIds in _execOverDatabase [#7864](https://github.com/pubkey/rxdb/pull/7864)
- **FIX**: memory leak in migratePromise() [#7787](https://github.com/pubkey/rxdb/pull/7787)
- **ADD** enforce maximum length for indexes and primary keys (`maxLength: 2048`)
- **CHANGE** `final` schema fields no longer need to be marked as `required`
- **UPDATE** [z-schema](https://github.com/zaggino/z-schema/blob/main/CHANGELOG.md) to version 9.
- **CHANGE** replace `appendToArray()` with `Array.concat()` for better browser-level optimizations
- **ADD** ensure indexes and primary keys are validated consistently across replication schemas
- **CHANGE**: Reduce `NON_PREMIUM_COLLECTION_LIMIT` from `16` to `13`.
- **ADD** Support `extendedLifetime` when using the [SharedWorker](../rx-storage-shared-worker.md).

### 🔌 Plugins Graduating from Beta

The following plugins are **no longer in beta** and are now considered production-ready:

- Replication Appwrite
- Replication Supabase
- Replication MongoDB
- RxStorage MongoDB
- RxStorage Filesystem (Node)
- RxStorage DenoKV
- Attachment replication
- CRDT Plugin
- RxPipeline

## You can help!

There are many things that can be done by **you** to improve RxDB:

- Check the [BACKLOG](https://github.com/pubkey/rxdb/blob/master/orga/BACKLOG.md) for features that would be great to have.
- Check the [breaking backlog](https://github.com/pubkey/rxdb/blob/master/orga/before-next-major.md) for breaking changes that must be implemented in the future but where I did not have the time yet.
- Check the [todos](https://github.com/pubkey/rxdb/search?q=todo) in the code. There are many small improvements that can be done for performance and build size.
- Review the code and add tests. I am only a single human with a laptop. My code is not perfect and much small improvements can be done when people review the code and help me to clarify undefined behaviors.
- Update the [example projects](https://github.com/pubkey/rxdb/tree/master/examples) some of them are outdated and need updates.

## LinkedIn

Stay connected with the latest updates and network with professionals in the RxDB community by following RxDB's [official LinkedIn page](https://www.linkedin.com/company/rxdb)!

<!--

## MIGRATION
RxDB 17 is mostly backward-compatible, but please review the following before upgrading:
  - If you use one of the following plugins, you need to migrate your data with the [storage migrator](../migration-storage.md)
    - OPFS RxStorage
    - Filesystem RxStorage
    - For other storages, you can use your data stored with v16 inside of a v17 RxDatabase.

  - The GitHub repository no longer contains prebuilt `dist` files.
  - `toggleOnDocumentVisible` now defaults to `true`.
  - Final schema fields no longer need to be explicitly marked as `required`.
  - Some dependencies may need to be installed manually due to optional peer dependency changes.

## CHANGES

- ADD (OPFS RxStorage) In `devMode`, log errors on the TextDecoder, use `strict` decoding mode and show details for debugging.
- ADD `RxDatabase.collections$`
- ADD support for the `using` keyword to auto-remove databases inside of tests.
- FIX query results not correct if changes happen faster then the query updates [#7067](https://github.com/pubkey/rxdb/issues/7067)
- FIX close broadcast-channel and leader election AFTER the database is closed, not in between the closing steps.
- Replace `appendToArray()` with `Array.concat()` which is nowadays optimized by browsers and faster.
- ADD  `reactivity-angular` package.
- CHANGE moved `reactivity-vue` and `reactivity-preact-signals` from premium to core.
- ADD `databaseNamePrefix` option to premium SQLite RxStorage
- ADD [llms.txt](https://rxdb.info/llms.txt)
- CHANGE These dependencies are now optional peer dependencies: `firebase`, `mongodb`, `nats`
- ADD ensure indexes and primaryKey have a maximum `maxLength` of `1000`.
- ADD use internal types for `WeakRef` so people do not have to add `ES2021.WeakRef` to their TypeScript config.
- We no longer have the `dist` folder in the github repository. Either install RxDB from npm, or run the build scripts locally.
- ADD `context` field to all RxDB write errors for easier debugging.
- CHANGE `toggleOnDocumentVisible` is now `true` by default.
- CHANGE final fields no longer must be `required`.
- FIX OPFS-Storage memory and cleanup leaking
- FIX memory-mapped-storage: deleted docs must be purged
- FIX `RxCollection.cleanup()` does not respect the provided `minimumDeletedTime`.
- FIX short primary key lengths does not match replication schema [#7587](https://github.com/pubkey/rxdb/issues/7587)
- FIX retry DenoKV commits on "database is locked" error
- Add QueryCompositeFilterConstraint support to Firestore replication plugin [#7616](https://github.com/pubkey/rxdb/pull/7616)
- ADD ensure indexes and primaryKey have a maximum `maxLength` of `2048`.
- ADD use internal types for `WeakRef` so people do not have to add `ES2021.WeakRef` to their TypeScript config.
- We no longer have the `dist` folder in the github repository. Either install RxDB from npm, or run the build scripts locally.
- ADD `context` field to all RxDB write errors for easier debugging.
- CHANGE `toggleOnDocumentVisible` is now `true` by default.
- CHANGE final fields no longer must be `required`.
- The following plugins are no longer in beta mode:
  - Replication Appwrite
  - RxStorage MongoDB
  - RxStorage Filesystem Node
  - Attachment replication
  - Replication Supabase
  - RxPipeline
  - RxStorage DenoKV
  - CRDT Plugin
  - Replication MongoDB

-->
