pubkey / rxdb

A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
https://rxdb.info/
Apache License 2.0
21.65k stars 1.06k forks source link

ANNOUNCEMENT: Planned changes for the next major version of RxDB v16 #6594

Open pubkey opened 6 days ago

pubkey commented 6 days ago

Hello everyone. The next major version of RxDB is in the plannings. This version is mostly for fixing things that are confusing to RxDB users. If you have any other ideas for how to improve RxDB, please write a comment here.

The next major version will be compatible with already stored data in of RxDB version 15 for most RxStorage implementation. So migration will be easy. Only the node-filesystem RxStorage and the OPFS RxStorage will required people to migrate the data itself with the storage migration plugin.

Planned changes:

Split conflict handler into "isEqual" and "mergeConflict" functions

Because the handler is used in so many places it becomes confusing to write a proper conflict handler. Also having a handler that requires user interaction is only possible by hackingly using the context param. By splitting the functionalities it will become easier to learn where the handlers are used and how to define them properly.

Ensure schema validator is used in devmode

Many reported issues come from people storing data that is not valid to their schema. To fix this, in dev-mode we should ensure that at least one schema validator is used.

ignoreduplicate must never be allowed in non-devmode

ignoreduplicate is only usefull for tests and should never be used in production. Throw an error if it is set to true in non-dev-mode.

rename .destroy() to .close()

Destroy was adapted from PouchDB, but people often think this deletes the written data. Close is better.

Removed deprecated LokiJS RxStorage

The LokiJS RxStorage was deprecated because LokiJS itself is no longer maintained. Therefore it will be removed completely. If you still need that, you can fork the code of it and publish it in an own package and link to it from the third party plugins page.

Remove the memory-synced RxStorage

The memory-synced storage used many hacks and workarounds to have multi-instance support and correct conflict handlings. By removing it the whole codebase become more simple and using the new memory-mapped storage is the better option anyways.

OPFS storage has default jsonPositionSize=8 but should be 14

Set the default to 14 and also remove all occurences of jsonPositionSize.

(internal) Change the RX_PIPELINE_CHECKPOINT_CONTEXT to rx-pipeline-checkpoint in the rx-pipeline.ts file

This was not possible before because it requires adding the new value to the schema enum.

(internal) migration-storage plugin: Remove catch from cleanup

In the migration-storage plugin we run a catch on oldStorageInstance.cleanup(0) to fix v14->v15 migration. We should remove that catch in the next major release.

brunovinicius commented 1 day ago

Hey Daniel! Not sure if here is the place for asking for changes, but I think one the things that were the hardest for me to pull off was the authorization integration with SAML/OAuth2. I currently use Microsoft Entra ID (old Azure AD) with a graphal/ws setup, and it would help immensely if we had a callback function to set headers dynamically on each request, instead of having to do it as a method call the way we currently do it.