Skip to content

Commit

Permalink
Release/16.0.0 (#6597)
Browse files Browse the repository at this point in the history
* INIT

* fix(datapath) must be equivalent for pull and push (#6019)

* ADD changes to changelog

* CHANGE `ignoreDuplicate: true` on `createRxDatabase()` must only be allowed in dev-mode

* Feature/rename destroy to close (#6602)

* RENAME .destroy() to .close()

* FIX types

* FIX typo

* FIX examples

* FIX lint

* FIX lint

* FIX lint

* FIX errors

* FIX vite

* FIX vite

* FIX schema

* FIX firestore replication

* FIX firestore conflict handler

* FIX nats test

* FIX nats replication

* CHANGE (internal) rename RX_PIPELINE_CHECKPOINT_CONTEXT to `rx-pipeline-checkpoint`

* CHANGE when dev-mode is enabled, a schema validator must be used (#6606)

* CHANGE when dev-mode is enabled, a schema validator must be used

* FIX dexie

* FIX ci

* FIX ci

* FIX stuff

* FIX electron

* FIX tests

* ADD logs

* REMOVE deprecated LokiJS RxStorage

* FIX remove unload

* REMOVE logs

* UPDATE changelog

* FIX graphql

* FIX ci

* FIX types

* CHANGE move stuff out of beta

* CHANGE rename `randomCouchString()` to `randomToken()`

* CHANGE rename `randomCouchString()` to `randomToken()` (#6618)

* ADD docs

* FIX test

* FIX test

* IMPROVE test speed (#6619)

* IMPROVE test speed

* FIX some todos

* FIX stuff

* UPDATE expo 52 (#6622)

* UPDATE expo 52

* FIX node version for expo

* TRY fix

* TRY fix

* FIX

* FIX ci

* REMOVE ohash

* FIX test

* FIX test

* FIX some TODOs

* FIX lint

* FIX tests

* FIX tests

* FIX tests

* FIX docs

* FIX random deno CI fails

* CHANGE allow using v15 database state

* FIX tests

* FIX tests

* FIX randomly failing test

* ADD database-lifecycle tests

* Bugfix/16 upstream initial sync (#6631)

* FIX missing push checkpoint decreased initial setup performance

* ADD docs

* FIX tests

* FIX lint

* FIX cancel duplicate replication state

* CHANGE Moved RxQuery checks into dev-mode

* Feature/16 remove emitted event bulk ids (#6632)

* THROW on duplicate event ids

* FIX stuff

* FIX types

* REMOVE unused dependecy

* FIX e2e tests

* CHANGE RxQuery.remove() now internally does a bulk operation for better performance.

* REFACTOR use less cpu on doc data processing

* ADD docs

* Only run interval cleanup on the storage of a collection if there actually have been writes to it.

* FIX circular imports

* FIX more todos

* FIX typings

* Feature/16 only map events if used (#6633)

* REFACTOR (internal) Only use event-bulks internally and only transform to single emitted events if actually someone has subscribed to the eventstream

* FIX lint

* REMOVE logs

* REFACTOR

* FIX types

* REMOVE todo

* REMOVE old test

* ADD test

* ADD call to action

---------

Co-authored-by: jwallet <[email protected]>
  • Loading branch information
pubkey and jwallet authored Nov 24, 2024
1 parent 3516a01 commit 633c0ab
Show file tree
Hide file tree
Showing 224 changed files with 3,278 additions and 27,211 deletions.
54 changes: 1 addition & 53 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,52 +135,6 @@ jobs:
with:
run: npm run test:performance:dexie

# run the node tests for the LokiJS RxStorage
storage-lokijs:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-loki-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-loki-x3-
- name: install npm dependencies
run: npm install

- name: build
run: npm run build

- name: npm run test:node:lokijs
run: npm run test:node:lokijs

- name: npm run test:fast:lokijs
run: npm run test:fast:lokijs

- name: npm run test:browser:lokijs
uses: coactions/setup-xvfb@v1
with:
run: npm run test:browser:lokijs

- name: performance test
uses: coactions/setup-xvfb@v1
with:
run: npm run test:performance:lokijs:browser
- run: npm run test:performance:lokijs:node

storage-memory:
runs-on: ubuntu-22.04
timeout-minutes: 30
Expand Down Expand Up @@ -215,7 +169,6 @@ jobs:
with:
run: npm run test:browser:memory

- run: npm run test:fast:memory-validation
- run: npm run test:fast:memory-random-delay

- name: performance test
Expand Down Expand Up @@ -765,11 +718,6 @@ jobs:
- name: build
working-directory: ./examples/graphql
run: npm run build
- name: test test:lokijs
uses: coactions/setup-xvfb@v1
with:
working-directory: ./examples/graphql
run: npm run test:lokijs
- name: test test:dexie
uses: coactions/setup-xvfb@v1
with:
Expand Down Expand Up @@ -909,7 +857,7 @@ jobs:
- uses: denoland/setup-deno@v1
with:
# https://github.com/denoland/deno/releases
deno-version: "1.44.1"
deno-version: "1.46.3"
- name: run deno tests:dexie
run: |
sudo npm i -g cross-env
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

<!-- CHANGELOG NEWEST -->

🚀 **RxDB v16 is released**

- A list of changes for RxDB v16 can be found [here](https://rxdb.info/releases/16.0.0.html)
<!-- ADD new changes here! -->

<!-- /CHANGELOG NEWEST -->
Expand Down
2 changes: 1 addition & 1 deletion docs-src/docs/alternatives.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ The last commit for hoodie was one year ago and the website (hood.ie) is offline
LokiJS is a JavaScript embeddable, in-memory database. And because everything is handled in-memory, LokiJS has awesome performance when mutating or querying data. You can still persist to a permanent storage (IndexedDB, Filesystem etc.) with one of the provided storage adapters. The persistence happens after a timeout is reached after a write, or before the JavaScript process exits. This also means you could loose data when the JavaScript process exits ungracefully like when the power of the device is shut down or the browser crashes.
While the project is not that active anymore, it is more *finished* than *unmaintained*.

RxDB supports using [LokiJS as RxStorage](./rx-storage-lokijs.md).
In the past, RxDB supported using [LokiJS as RxStorage](./rx-storage-lokijs.md) but because the LokiJS is not maintained anymore and had too many issues, this storage option was removed in RxDB version 16.

### Gundb

Expand Down
1 change: 0 additions & 1 deletion docs-src/docs/articles/angular-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ Angular provides the async pipe, which is a convenient way to subscribe to obser
RxDB supports multiple storage layers for persisting data. Some of the available storage options include:

- [Dexie.js RxStorage](../rx-storage-dexie.md): Dexie.js is a minimalistic IndexedDB wrapper that provides a simple API for working with IndexedDB. RxDB leverages Dexie.js as its default storage layer.
- [LokiJS RxStorage](../rx-storage-lokijs.md): LokiJS is an in-memory document-oriented database that can also persist data to IndexedDB. RxDB integrates with LokiJS to provide an alternative storage option.
- [IndexedDB RxStorage](../rx-storage-indexeddb.md): RxDB directly supports IndexedDB as a storage layer. IndexedDB is a low-level browser database that offers good performance and reliability.
- [OPFS RxStorage](../rx-storage-opfs.md): The OPFS [RxStorage](../rx-storage.md) for RxDB is built on top of the [File System Access API](https://webkit.org/blog/12257/the-file-system-access-api-with-origin-private-file-system/) which is available in [all modern browsers](https://caniuse.com/native-filesystem-api). It provides an API to access a sandboxed private file system to persistently store and retrieve data.
Compared to other persistend storage options in the browser (like [IndexedDB](../rx-storage-indexeddb.md)), the OPFS API has a **way better performance**.
Expand Down
3 changes: 1 addition & 2 deletions docs-src/docs/articles/data-base.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ RxDB introduces the concept of observable queries, which are powerful tools for
RxDB offers multi-tab support, allowing applications to function seamlessly across multiple [browser](./browser-database.md) tabs. This feature ensures that data changes in one tab are immediately reflected in all other open tabs, enabling a consistent user experience across different browser windows.

### RxDB vs. Other data base Options
When considering data base options for web applications, developers often encounter choices like Dexie.js, LokiJS, IndexedDB, OPFS, and Memory-based solutions. RxDB, while built on top of IndexedDB, stands out due to its reactive data handling capabilities and advanced synchronization features. Compared to other options, RxDB offers a more streamlined and powerful approach to managing data in web applications.
When considering data base options for web applications, developers often encounter choices like Dexie.js, IndexedDB, OPFS, and Memory-based solutions. RxDB, while built on top of IndexedDB, stands out due to its reactive data handling capabilities and advanced synchronization features. Compared to other options, RxDB offers a more streamlined and powerful approach to managing data in web applications.

### Different RxStorage layers for RxDB
RxDB provides various [storage layers](../rx-storage.md), known as RxStorage, that serve as interfaces to different underlying [storage](./browser-storage.md) technologies. These layers include:

- [Dexie.js RxStorage](../rx-storage-dexie.md): Built on top of Dexie.js, this storage layer leverages IndexedDB as its backend.
- [LokiJS RxStorage](../rx-storage-lokijs.md): Utilizing the in-memory data base LokiJS, this layer provides a lightweight alternative to persist data.
- [IndexedDB RxStorage](../rx-storage-indexeddb.md): This layer directly utilizes IndexedDB as its backend, providing a robust and widely supported storage option.
- [OPFS RxStorage](../rx-storage-opfs.md): OPFS (Operational Transformation File System) is a file system-like storage layer that allows for efficient conflict resolution and real-time collaboration.
- Memory RxStorage: Primarily used for testing and development, this storage layer keeps data in memory without persisting it to disk.
Expand Down
1 change: 0 additions & 1 deletion docs-src/docs/articles/ionic-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ RxDB seamlessly integrates with various JavaScript frameworks, ensuring compatib
RxDB doesn't limit you to a single storage solution. Instead, it provides a range of RxStorage layers to accommodate diverse use cases. These storage layers offer flexibility and customization, enabling you to tailor your data management strategy to match your app's requirements. Let's explore some of the available RxStorage options:

- [Dexie.js RxStorage](../rx-storage-dexie.md): Dexie.js is a popular JavaScript library for indexedDB, and RxDB offers a compatible RxStorage layer. This option leverages indexedDB's capabilities to provide efficient data storage and retrieval.
- [LokiJS RxStorage](../rx-storage-lokijs.md): LokiJS RxStorage integrates the LokiJS database with RxDB, giving you access to another powerful NoSQL database solution. LokiJS is known for its in-memory storage capabilities and ease of use.
- [IndexedDB RxStorage](../rx-storage-indexeddb.md): Leveraging the native browser storage, IndexedDB RxStorage offers reliable data persistence. This storage option is suitable for a wide range of scenarios and is supported by most modern browsers.
- [OPFS RxStorage](../rx-storage-opfs.md): Operating within the browser's file system, OPFS RxStorage is a unique choice that can handle larger data volumes efficiently. It's particularly useful for applications that require substantial data storage.
- [Memory RxStorage](../rx-storage-memory.md): Memory RxStorage is perfect for temporary or cache-like data storage. It keeps data in memory, which can result in rapid data access but doesn't provide long-term persistence.
Expand Down
2 changes: 1 addition & 1 deletion docs-src/docs/articles/json-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const mySchema = {
## Store JSON with RxDB in Browser Applications
RxDB offers versatile storage solutions for browser-based applications:

- **Multiple Storage Plugins**: RxDB supports various storage backends, including [IndexedDB](../rx-storage-indexeddb.md), [Dexie.js](../rx-storage-dexie.md), [In-Memory](../rx-storage-memory.md), and [Loki.js](../rx-storage-lokijs.md), catering to a range of browser environments.
- **Multiple Storage Plugins**: RxDB supports various storage backends, including [IndexedDB](../rx-storage-indexeddb.md), [Dexie.js](../rx-storage-dexie.md) and [In-Memory](../rx-storage-memory.md), catering to a range of browser environments.

- **Observable Queries**: With RxDB, you can create observable [queries](../rx-query.md) that work seamlessly across multiple browser tabs, providing real-time updates and synchronization.

Expand Down
1 change: 0 additions & 1 deletion docs-src/docs/articles/progressive-web-app-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Integrating RxDB into a Progressive Web App, driven by technologies like React,
RxDB caters to diverse needs through its various RxStorage layers:

- Dexie.js RxStorage: Leveraging the capabilities of the Dexie.js library for storage.
- LokiJS RxStorage: Utilizing the strengths of the LokiJS library for [storage](./browser-storage.md).
- IndexedDB RxStorage: Tapping into the browser's IndexedDB for efficient data storage.
- OPFS RxStorage: Interfacing with the Offline-First Persistence System for seamless persistence.
- Memory RxStorage: Storing data in memory, ideal for temporary data requirements.
Expand Down
1 change: 0 additions & 1 deletion docs-src/docs/articles/react-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ return (
RxDB offers multiple storage layers, each backed by a different underlying technology. Developers can choose the storage layer that best suits their application's requirements. Some available options include:

- [Dexie.js RxStorage](../rx-storage-dexie.md): Built on top of Dexie.js, a popular IndexedDB wrapper.
- [LokiJS RxStorage](../rx-storage-lokijs.md): Utilizes the LokiJS in-memory database.
- [IndexedDB RxStorage](../rx-storage-indexeddb.md): The default RxDB storage layer, providing efficient data storage in modern browsers.
- [OPFS RxStorage](../rx-storage-opfs.md): Uses the Operational File System (OPFS) for storage, suitable for [Electron applications](../electron-database.md).
- [Memory RxStorage](../rx-storage-memory.md): Stores data in memory, primarily intended for testing and development purposes.
Expand Down
6 changes: 1 addition & 5 deletions docs-src/docs/fulltext-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ slug: fulltext-search.html
---


# Fulltext Search (beta)
# Fulltext Search

To run fulltext search queries on the local data, RxDB has a fulltext search plugin based on [flexsearch](https://github.com/nextapps-de/flexsearch) and [RxPipeline](./rx-pipeline.md). On each write to a given source [RxCollection](./rx-collection.md), an indexer is running to map the written document data into a fulltext search index.
The index can then be queried efficiently with complex fulltext search operations.
Expand Down Expand Up @@ -38,10 +38,6 @@ The FlexSearch-based plugin allows for [sophisticated search queries](https://gi

As RxDB is designed with [offline-first applications](./offline-first.md) in mind, the fulltext search plugin supports this paradigm by ensuring that all search operations can be performed offline. This is crucial for applications that need to function in environments with intermittent or no internet connectivity, offering users a consistent and reliable search experience with zero latency.

:::warning beta
The flexsearch plugin is in **beta** mode and the API might be changed without a major RxDB release.
:::

## Using the RxDB Fulltext Search

The flexsearch search is a [RxDB Premium Package 👑](/premium) which must be purchased and imported from the `rxdb-premium` npm package.
Expand Down
2 changes: 1 addition & 1 deletion docs-src/docs/migration-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ myDatabase.addCollections({

## autoMigrate

By default, the migration automatically happens when the collection is created. Calling `RxDatabase.addRxCollections()` returns only when the migration has finished.
By default, the migration automatically happens when the collection is created. Calling `RxDatabase.addCollections()` returns only when the migration has finished.
If you have lots of data or the migrationStrategies take a long time, it might be better to start the migration 'by hand' and show the migration-state to the user as a loading-bar.

```javascript
Expand Down
16 changes: 6 additions & 10 deletions docs-src/docs/migration-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ The storage migration **drops deleted documents** and filters them out during th

## Usage

Lets say you want to migrate from LokiJs to the [Dexie.js](./rx-storage-dexie.md) RxStorage.
Lets say you want to migrate from [Dexie.js](./rx-storage-dexie.md) RxStorage to [IndexedDB](./rx-storage-indexeddb.md).

```ts
import { migrateStorage } from 'rxdb/plugins/migration-storage';
import {
getRxStorageLoki
} from 'rxdb/plugins/storage-loki';
import { getRxStorageDexie } from 'rxdb/plugins/storage-dexie';
import { getRxStorageIndexedDB } from 'rxdb-premium/plugins/storage-indexeddb';
import { getRxStorageDexie } from 'rxdb-old/plugins/storage-dexie';

// create the new RxDatabase
const db = await createRxDatabase({
Expand All @@ -40,7 +38,7 @@ await migrateStorage({
* new database has a different name.
*/
oldDatabaseName: 'myOldDatabaseName',
oldStorage: getRxStorageLoki(), // RxStorage of the old database
oldStorage: getRxStorageIndexedDB(), // RxStorage of the old database
batchSize: 500, // batch size
parallel: false, // <- true if it should migrate all collections in parallel. False (default) if should migrate in serial
afterMigrateBatch: (input: AfterMigrateBatchHandlerInput) => {
Expand All @@ -67,9 +65,7 @@ The you can run the migration by providing the old storage:
```ts
/* ... */
import { migrateStorage } from 'rxdb/plugins/migration-storage';
import {
getRxStorageLoki
} from 'rxdb-old/plugins/storage-loki'; // <- import from the old RxDB version
import { getRxStorageDexie } from 'rxdb-old/plugins/storage-dexie'; // <- import from the old RxDB version

await migrateStorage({
database: db as any,
Expand All @@ -79,7 +75,7 @@ await migrateStorage({
* new database has a different name.
*/
oldDatabaseName: 'myOldDatabaseName',
oldStorage: getRxStorageLoki(), // RxStorage of the old database
oldStorage: getRxStorageDexie(), // RxStorage of the old database
batchSize: 500, // batch size
parallel: false,
afterMigrateBatch: (input: AfterMigrateBatchHandlerInput) => {
Expand Down
1 change: 0 additions & 1 deletion docs-src/docs/react-native-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ const db = new PouchDB('mydb.db', {
There are multiple ways to use RxDB in React Native:

- Use the [memory RxStorage](./rx-storage-memory.md) that stores the data inside of the JavaScript memory without persistence
- Use the [LokiJS RxStorage](./rx-storage-lokijs.md) with the [react-native-lokijs](https://github.com/cawfree/react-native-lokijs) plugin or the [loki-async-reference-adapter](https://github.com/jonnyreeves/loki-async-reference-adapter).
- Use the [SQLite RxStorage](./rx-storage-sqlite.md) with the [react-native-quick-sqlite](https://github.com/ospfranco/react-native-quick-sqlite) plugin.

It is recommended to use the [SQLite RxStorage](./rx-storage-sqlite.md) because it has the best performance and is the easiest to set up. However it is part of the [👑 Premium Plugins](/premium) which must be purchased, so to try out RxDB with React Native, you might want to use one of the other three options.
Expand Down
1 change: 0 additions & 1 deletion docs-src/docs/reactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,5 @@ const signal = myRxLocalDocument.get$$('foobar'); // get signal that represents

## Limitations

- Custom reactivity is in beta mode, it might have breaking changes without a major RxDB release.
- TypeScript typings are not fully implemented, make a PR if something is missing or not working for you.
- Currently not all observables things in RxDB are implemented to work with custom reactivity. Please make a PR if you have the need for any missing one.
2 changes: 1 addition & 1 deletion docs-src/docs/releases/15.0.0.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 🆕 RxDB 15.0.0
title: RxDB 15.0.0
slug: 15.0.0.html
description: RxDB Major Release 15.0.0
---
Expand Down
Loading

0 comments on commit 633c0ab

Please sign in to comment.