Skip to content

Commit

Permalink
Draft: New Redis extension (#285)
Browse files Browse the repository at this point in the history
* wip

* progress

* messy, but passing messages

* ci: fix code style linting errors

* doc

* lift MessageReceiver

* test: Awareness propagation

* fix: persistWait not configurable, add onPersist test

* docs

* fix: Query awareness from other servers on load

* fix: Change import path (for now)

* refactor

* fix: Sync step propagation

* docs

* test: onDisconnect

* Add onCreatedDocument hook, reduce blocking

* fix build? Prefer src if available

* ci: fix code style linting errors

* docs: update navigation

* install dependencies

* update pubsub package.json, rename folder

* update imports to use package names

* move pubsub class to separate class

* refactor tests

* fix tests

* fix package-lock.json

* remove yarn lock file

* ci: fix code style linting errors

* update the ESLint config

* add some debugging output to check what happens in CI

* add more debugging output

* enable all other tests

* merge changes

* database: story the recent state, and only restore from the recent state

* rocksdb: revert change

* update dependencies

* fix eslint config

* refactor tests

* rewrite package-lock.json

* rewrite package-lock.json

* fix types

* ci: fix code style linting errors

* wip

* fix tests

* wip

* upgrade redis to 4.0

* update dependencies

* refactoring

* clean up

* replace old redis extension with the new approach

* ci: fix code style linting errors

* rename test context

* add new onStoreDocument hook

* add onStoreDocument to the logger extension

* make sure documents are removed from the memory after they are persisted, but only when they don’t have new connections

* skip a failing test

* debounce the onStoreDocument hook

* clean up

* wip

* update database and sqlite extensions to use the new onStoreDocument hook

* add two redis instances and two editors to the playground example

* fix status bar

* add onAwarenessUpdate hook

* redis: use unique ids instead of the hostname

* introduce new afterStoreDocument hook, rename onLoadedDocument to afterLoadDocument

* use global onStoreDocument hook

* refactoring

* make sure to only store document when changes came in through the WebSocket connection

* refactoring

* remove Redis specific onPersist hook

* fix tests

* add a priority to extensions

* server: add support for custom reply channels in the server MessageReceiver

* migrate the server/onStoreDocument test to AVA

* migrate more Redis tests to AVA

* refactor the tests

* migrate the onChange test

* provider: improve typings, make removeAllListeners public

* migrate the onAwarenessChange test

* ci: try to fix parcel build

* ci: remove dashboard build

* tests: minor refactorings

* clean up

* migrate more tests

* migrate more tests, add a few known failures for the redis extension

* increase the timeout for the redis/onChange test

* migrate even more tests

* restore broken test

* migrate another test

* server: allow to pass the configuration to the constructor

* disable workerThreads for AVA

* merge changes

* redis: use new tests, remove old ones

* redis: enable new tests, fix the MessageReceiver initialisation

Co-authored-by: Tom Moor <tom.moor@gmail.com>
Co-authored-by: tommoor <tommoor@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 21, 2022
1 parent 887e685 commit eed75c6
Show file tree
Hide file tree
Showing 14 changed files with 405 additions and 236 deletions.
187 changes: 156 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions packages/extension-redis/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hocuspocus/extension-redis",
"version": "1.0.0-alpha.61",
"description": "hocuspocus persistence driver for Redis",
"description": "Scale Hocuspocus horizontally with Redis",
"homepage": "https://hocuspocus.dev",
"keywords": [
"hocuspocus",
Expand All @@ -26,10 +26,19 @@
"src",
"dist"
],
"devDependencies": {
"@types/ioredis": "^4.28.7",
"@types/lodash.debounce": "^4.0.6",
"@types/redlock": "^4.0.3"
},
"dependencies": {
"@hocuspocus/server": "^1.0.0-alpha.98",
"y-redis": "^1.0.3",
"yjs": "^13.5.29"
"@hocuspocus/server": "^1.0.0-alpha.91",
"ioredis": "^4.28.2",
"lodash.debounce": "^4.0.8",
"redlock": "^4.2.0",
"uuid": "^8.3.2",
"y-protocols": "^1.0.5",
"yjs": "^13.5.23"
},
"gitHead": "b3454a4ca289a84ddfb7fa5607a2d4b8d5c37e9d"
}
Loading

0 comments on commit eed75c6

Please sign in to comment.