@hocuspocus/extension-redis 4.0.0-rc.6 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -5
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -4,11 +4,53 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@hocuspocus/extension-redis)
|
|
5
5
|
[](https://github.com/sponsors/ueberdosis)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
Scale [Hocuspocus](https://github.com/ueberdosis/hocuspocus) horizontally across multiple server instances. Uses Redis pub/sub to broadcast document updates and awareness between instances, so clients connected to different servers stay in sync on the same document.
|
|
7
|
+
Scale [Hocuspocus](https://github.com/ueberdosis/hocuspocus) horizontally across multiple server instances. Uses Redis pub/sub to broadcast document updates and awareness between servers, so clients connected to different instances stay in sync on the same document.
|
|
9
8
|
|
|
10
|
-
##
|
|
11
|
-
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @hocuspocus/extension-redis
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
Point every Hocuspocus instance at the same Redis:
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
import { Server } from "@hocuspocus/server"
|
|
21
|
+
import { Redis } from "@hocuspocus/extension-redis"
|
|
22
|
+
|
|
23
|
+
const server = new Server({
|
|
24
|
+
port: 1234,
|
|
25
|
+
extensions: [
|
|
26
|
+
new Redis({
|
|
27
|
+
host: "127.0.0.1",
|
|
28
|
+
port: 6379,
|
|
29
|
+
}),
|
|
30
|
+
],
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
server.listen()
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Bring your own Redis client
|
|
37
|
+
|
|
38
|
+
If you already have an `ioredis` client (including Cluster), pass it in directly instead of host/port:
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
import RedisClient from "ioredis"
|
|
42
|
+
|
|
43
|
+
new Redis({
|
|
44
|
+
redis: new RedisClient({ host: "127.0.0.1", port: 6379 }),
|
|
45
|
+
})
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Redis handles real-time sync — you still need a persistence extension (e.g. [`@hocuspocus/extension-sqlite`](../extension-sqlite), [`@hocuspocus/extension-s3`](../extension-s3), or your own [`Database`](../extension-database)) to store documents long-term.
|
|
49
|
+
|
|
50
|
+
## Documentation
|
|
51
|
+
|
|
52
|
+
Full scaling architecture and multi-instance deployment guide: [tiptap.dev/docs/hocuspocus/server/extensions/redis](https://tiptap.dev/docs/hocuspocus/server/extensions/redis).
|
|
12
53
|
|
|
13
54
|
## License
|
|
14
|
-
|
|
55
|
+
|
|
56
|
+
MIT — see [LICENSE.md](https://github.com/ueberdosis/hocuspocus/blob/main/LICENSE.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/extension-redis",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Scale Hocuspocus horizontally with Redis",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@hocuspocus/common": "^4.0.0
|
|
32
|
-
"@hocuspocus/server": "^4.0.0
|
|
31
|
+
"@hocuspocus/common": "^4.0.0",
|
|
32
|
+
"@hocuspocus/server": "^4.0.0",
|
|
33
33
|
"@sesamecare-oss/redlock": "^1.4.0",
|
|
34
34
|
"ioredis": "~5.6.1",
|
|
35
35
|
"kleur": "^4.1.4"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"y-protocols": "^1.0.6",
|
|
39
39
|
"yjs": "^13.6.8"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "1c1b34800f702a06e1ce236e8a175c82876bff42",
|
|
42
42
|
"repository": {
|
|
43
43
|
"url": "https://github.com/ueberdosis/hocuspocus"
|
|
44
44
|
},
|