Skip to content

Commit

Permalink
RxDB Version 15.0.0 (#5001)
Browse files Browse the repository at this point in the history
* CHANGE eventReduce: true by default

* FIX orga

* v15 storage interface optimizations (#5002)

* CHANGE bulkWrite return arrays instead of objects

* FIX tests

* IMPROVE performance

* IMPROVE performance

* OPTIMIZE performance of write row categorizing

* IMPROVE memory write performance

* FIX tests

* CHANGE string regex (#5000)

* CHANGE string regex

* FIX lint

* Feature/async hashing (#5013)

* CHANGE async hash function

* FIX tests

* CHANGE hash attachments in rxdb instead of the RxStorage

* FIX mongodb random test failures

* TRIGGER push

* CHANGE use webcrypto API for hashing

* FIX test

* FIX not dependend on specific hash function

* TRY fix

* FIX hashing in replication states

* FIX types

* FIX tests

* FIX tests

* FIX vue

* RENAME replication-p2p to replication-webrtc

* ADD docs page redirect

* FIX random failures

* CHANGE RxLocalDocument.$ must emit a document instance, not the plain data

* FIX tests

* TRY fix react native

* ADD dev-mode check for dissalowed $ref #4926 (#5019)

* RENAME send$ to sent$ (#5020)

* UPDATE faker

* ADD attachment replication (#5039)

* ADD attachment replication

* FIX tests

* FIX tests

* FIX typos

* FIX tests

* FIX tests

* FIX ensure meta instance does not contain attachments data

* ADD context to debug

* FIX types

* FIX randomly failing test

* ADD(docs) attachment replication

* ADD .info call (#5045)

* ADD .info call

* FIX types

* REFACTOR data migrator (#5025)

* REFACTOR data migrator

* FIX maxLength

* ADD stuff

* CHORE migration

* CHORE migration

* CHORE migration

* CHORE migration

* REMOVE old

* FIX close broadcast channel

* FIX flutter

* FIX closing of storages

* CHORE migration

* FIX tests

* FIX types

* FIX test

* ADD log

* FIX

* ADD log

* ADD log

* FIX mongo

* FIX

* FIX spelling

* FIX docs

* FIX

* REFACTOR bulkUpsert (#5057)

* REFACTOR bulkUpsert

* FIX docs

* FIX docs

* FIX version

* REMOVE obsolete setter code from RxDocument

* IMPROVE property access performance (#5063)

* IMPROVE property access performance

* FIX #4949 RxDocument.get() on additonalProperty

* IMPROVE performance

* IMPROVE performance

* FIX bun

* FIX image

* ADD helpfull error message for #5046 (#5068)

* FIX types

* clear cache

* FIX types

* FIX npm ignore

* REMOVE is-blob

* CHORE type module (#5074)

* CHORE type module

* CHORE

* CHORE

* FIX build

* FIX

* cHORE

* FIX typecheck

* CHORE

* CHORE

* FIX typing tests

* CHORE

* CHORE

* CHORE

* CHORE

* CHORE

* ADD stuff

* FIX typings test

* FIX lint

* REMOVE deps

* ADD deno test

* FIX

* FIX

* FIX imports

* FIX test

* FIX test

* FIX browser tests

* FIX loki test

* FIX testes

* FIX root import

* FIX newline

* FIX karma test

* FIX lint

* FIX

* FIX build

* FIX perf tests

* FIX test

* FIX stuff

* FIX deno tests

* FIX require

* FIX loki

* FIX

* FIX deno

* FIX landingpage build

* ADD side effects false

* FIX deno

* FIX async storage init

* FIX init

* FIX deno tests

* FIX deno tests

* FIX empty tests

* ADD deno performance tests

* FIX types

* FIX test

* FIX

* FIX tests

* FIX tests

* FIX ci

* FIX ci order

* FIX test

* FIX init

* FIX lint

* FIX deno tests

* REMOVE browserify output

* REMOVE browserify index

* FIX missing dep

* FIX bigint not defined

* FIX flutter
  • Loading branch information
pubkey authored Oct 12, 2023
1 parent cf2ee31 commit 46f3636
Show file tree
Hide file tree
Showing 305 changed files with 6,358 additions and 4,932 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ test_tmp/
tmp/
dist/
package.json
plugins/
examples/angular
examples/electron
examples/electron-remote
Expand Down
9 changes: 5 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"extraFileExtensions": [
".json"
],
"ecmaVersion": 2018,
"ecmaVersion": 2022,
"sourceType": "module",
"project": "./tsconfig.lint.json"
},
Expand All @@ -30,6 +30,10 @@
"@typescript-eslint/no-redundant-type-constituents": "off",

"@typescript-eslint/consistent-type-definitions": "off",
// "import/extensions": [
// "error",
// "always"
// ],
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
Expand Down Expand Up @@ -167,7 +171,6 @@
"no-prototype-builtins": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/ban-ts-comment": "off",

"@typescript-eslint/no-unused-vars": [
"error",
{
Expand All @@ -194,8 +197,6 @@
"prefer-spread": "off",
"@typescript-eslint/prefer-as-const": "off",
"@typescript-eslint/prefer-regexp-exec": "off",


// These rules must stay turned off
// because the take too long to run.
// Use 'npm run lint:debug:time' to check
Expand Down
63 changes: 36 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-core-x8-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-npm-core-x9-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-core-x8-
${{ runner.os }}-npm-core-x9-
- name: install npm dependencies
run: npm install
Expand Down Expand Up @@ -64,9 +64,9 @@ jobs:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-loki-x8-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-npm-loki-x9-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-loki-x8-
${{ runner.os }}-npm-loki-x9-
- name: install npm dependencies
run: npm install
Expand Down Expand Up @@ -108,9 +108,9 @@ jobs:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-memory-x8-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-npm-memory-x9-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-memory-x8-
${{ runner.os }}-npm-memory-x9-
- name: install npm dependencies
run: npm install
Expand Down Expand Up @@ -162,9 +162,9 @@ jobs:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-remote-x8-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-npm-remote-x9-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-remote-x8-
${{ runner.os }}-npm-remote-x9-
- name: install npm dependencies
run: npm install
Expand Down Expand Up @@ -196,9 +196,9 @@ jobs:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-storage-dexie-x8-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-npm-storage-dexie-x9-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-storage-dexie-x8-
${{ runner.os }}-npm-storage-dexie-x9-
- name: install npm dependencies
run: npm install
Expand Down Expand Up @@ -239,9 +239,9 @@ jobs:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-storage-foundationdb-x8-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-npm-storage-foundationdb-x9-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-storage-foundationdb-x8-
${{ runner.os }}-npm-storage-foundationdb-x9-
- name: install FoundationDB client and server
working-directory: ./scripts
Expand All @@ -264,7 +264,7 @@ jobs:

storage-mongodb:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- name: Set node version
Expand All @@ -280,9 +280,9 @@ jobs:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-storage-mongodb-x8-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-npm-storage-mongodb-x9-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-storage-mongodb-x8-
${{ runner.os }}-npm-storage-mongodb-x9-
- name: Start MongoDB
uses: supercharge/[email protected]
Expand Down Expand Up @@ -319,9 +319,9 @@ jobs:
./node_modules
./examples/angular/node_modules
# invalidate cache when any package.json changes
key: ${{ runner.os }}-npm-angular-x8-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-npm-angular-x9-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-angular-x8-
${{ runner.os }}-npm-angular-x9-
- name: prepare RxDB core
run: |
Expand Down Expand Up @@ -369,9 +369,9 @@ jobs:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-test-builds-x8-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-npm-test-builds-x9-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-test-builds-x8-
${{ runner.os }}-npm-test-builds-x9-
- name: prepare RxDB core
run: |
Expand Down Expand Up @@ -402,9 +402,9 @@ jobs:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-test-code-style-x8-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-npm-test-code-style-x9-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-test-code-style-x8-
${{ runner.os }}-npm-test-code-style-x9-
- name: prepare RxDB core
run: |
Expand Down Expand Up @@ -778,18 +778,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: prepare RxDB core
run: |
npm install
npm run build
- run: npm run test:bun:dexie
- run: npm run test:performance:memory:bun

- run: npm run test:replication-couchdb
- run: npm run test:replication-firestore
- name: nats replication
Expand All @@ -799,6 +793,21 @@ jobs:
docker pull nats:2.9.17
npm run test:replication-nats
# bun
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: npm run test:bun:dexie
- run: npm run test:performance:memory:bun

# deno (must be last because it messes up with file permissions)
- uses: denoland/setup-deno@v1
with:
deno-version: "1.37.1"
- run: npm run test:deno:dexie
# TODO fix deno performance test
#- run: npm run test:performance:memory:deno

# I found out that people are stupid and use the npm downloads count
# to measure the quality of an open source project.
# But this is a bad metric so I destroy it by obfuscating the actual download count.
Expand Down
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ ISSUE_TEMPLATE.md
PULL_REQUEST_TEMPLATE.md
pouch__all_dbs__/
config.json
.nvmrc
release-body.md

perf.md
log.txt
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.9.0
20.7.0
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ Bugfixes:

### 13.11.0 (19 November 2022)

- ADD [replication-p2p](./docs-src/replication-p2p.md) which can be used to replicate data peer-to-peer without a backend server.
- ADD [replication-webrtc](./docs-src/replication-webrtc.md) which can be used to replicate data peer-to-peer without a backend server.

### 13.10.1 (10 November 2022)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
RxDB (short for <b>R</b>eactive <b>D</b>ata<b>b</b>ase) is an <a href="https://rxdb.info/offline-first.html">offline-first</a>, NoSQL-database for JavaScript Applications like Websites, hybrid Apps, Electron-Apps, Progressive Web Apps and <a href="https://rxdb.info/nodejs-database.html">Node.js</a>.
Reactive means that you can not only query the current state, but <b>subscribe</b> to all state changes like the result of a query or even a single field of a document.
This is great for UI-based <b>realtime</b> applications in a way that makes it easy to develop and also has great performance benefits but can also be used to create fast backends in Node.js.<br />
RxDB provides an easy to implement <a href="https://rxdb.info/replication.html">protocol</a> for realtime <b>replication</b> with your existing infrastructure or one of the plugins for <a href="https://rxdb.info/replication-graphql.html">GraphQL</a>, <a href="https://rxdb.info/replication-couchdb.html">CouchDB</a>, <a href="https://rxdb.info/replication-websocket.html">Websocket</a>, <a href="https://rxdb.info/replication-p2p.html">P2P</a>, <a href="https://rxdb.info/replication-firestore.html">Firestore</a>, <a href="https://rxdb.info/replication-nats.html">NATS</a>.<br />
RxDB provides an easy to implement <a href="https://rxdb.info/replication.html">protocol</a> for realtime <b>replication</b> with your existing infrastructure or one of the plugins for <a href="https://rxdb.info/replication-graphql.html">GraphQL</a>, <a href="https://rxdb.info/replication-couchdb.html">CouchDB</a>, <a href="https://rxdb.info/replication-websocket.html">Websocket</a>, <a href="https://rxdb.info/replication-webrtc.html">WebRTC</a>, <a href="https://rxdb.info/replication-firestore.html">Firestore</a>, <a href="https://rxdb.info/replication-nats.html">NATS</a>.<br />
RxDB is based on a storage interface that enables you to swap out the underlying storage engine. This increases <b>code reuse</b> because you can use the same database code for different JavaScript environments by just switching out the storage settings.
</p>

Expand All @@ -70,7 +70,7 @@ Use the [quickstart](https://rxdb.info/quickstart.html), read the [documentation
</h2>

RxDB provides an easy to implement, <b>battle-tested</b> <a href="https://rxdb.info/replication.html"> replication protocol</a> for realtime sync with your existing infrastructure.<br />
There are also plugins to easily replicate with <a href="https://rxdb.info/replication-graphql.html">GraphQL</a>, <a href="https://rxdb.info/replication-couchdb.html">CouchDB</a>, <a href="https://rxdb.info/replication-websocket.html">Websocket</a>, <a href="https://rxdb.info/replication-p2p.html">P2P</a>, <a href="https://rxdb.info/replication-firestore.html">Firestore</a> or <a href="https://rxdb.info/replication-nats.html">NATS</a>.
There are also plugins to easily replicate with <a href="https://rxdb.info/replication-graphql.html">GraphQL</a>, <a href="https://rxdb.info/replication-couchdb.html">CouchDB</a>, <a href="https://rxdb.info/replication-websocket.html">Websocket</a>, <a href="https://rxdb.info/replication-webrtc.html">WebRTC</a>, <a href="https://rxdb.info/replication-firestore.html">Firestore</a> or <a href="https://rxdb.info/replication-nats.html">NATS</a>.


<h2>
Expand Down
2 changes: 2 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ let presets = [
[
'@babel/typescript',
{
rewriteImportExtensions: true,
loose: true,
modules: false
}
Expand All @@ -35,6 +36,7 @@ if (process.env['NODE_ENV'] === 'es5') {
[
'@babel/typescript',
{
rewriteImportExtensions: true,
loose: true,
targets: {
edge: '107',
Expand Down
9 changes: 0 additions & 9 deletions config/.mocharc.js → config/.mocharc.cjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
'use strict';

const mochaSettings = {
bail: true,
timeout: 10000,
exit: true,
reporter: 'spec'
};

if (process.env.TRAVIS) {
// this is so high because travis has different machines
// that are randomly slow
mochaSettings.timeout = 120 * 1000;
mochaSettings.reporter = 'min';
}

if (process.env.NODE_PROF) {
console.log('profiler activated:');
mochaSettings.prof = true;
Expand Down
4 changes: 2 additions & 2 deletions config/bundle-size.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
createRxDatabase
} from '../';
} from '../plugins/core/index.mjs';
import {
getRxStorageMemory,
} from '../plugins/storage-memory';
} from '../plugins/storage-memory/index.mjs';

function run() {
createRxDatabase({
Expand Down
Loading

0 comments on commit 46f3636

Please sign in to comment.