Skip to content

Commit fc7b08c

Browse files
committed
docs: v3 upgrade help
1 parent 041d481 commit fc7b08c

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

docs/provider/examples.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,7 @@ const provider2 = new TiptapCollabProvider({
260260
name: 'document2',
261261
token: '',
262262
})
263+
264+
provider1.attach() // when passing a socket manually, you need to call attach explicitly
265+
provider2.attach() // when passing a socket manually, you need to call attach explicitly
263266
```

docs/upgrade.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,33 @@
11
# Upgrade Guide
22

3-
## Upgrading to 3.0 from 2.x
3+
## Upgrading to 3.0 from 2.x (Provider)
4+
5+
The TiptapCollabProvider has been moved to `@tiptap-pro/provider`.
6+
7+
When using multiplexing, the providers now need to explicitly call `attach` to attach to the websocket.
8+
9+
```typescript
10+
import {
11+
TiptapCollabProvider,
12+
TiptapCollabProviderWebsocket
13+
} from "@tiptap-pro/provider";
14+
15+
const socket = new TiptapCollabProviderWebsocket({
16+
appId: '', // or `url` if using `HocuspocusProviderWebsocket`
17+
})
18+
19+
const provider1 = new TiptapCollabProvider({
20+
websocketProvider: socket,
21+
name: 'document1',
22+
token: '',
23+
})
24+
25+
provider1.attach() // when passing a socket manually, you need to call attach explicitly
26+
```
27+
28+
More information can be found here: https://github.com/ueberdosis/hocuspocus/releases/tag/v3.1.0
29+
30+
## Upgrading to 3.0 from 2.x (Server)
431

532
With the upgrade to the new version, the initialization of hocuspocus has changed. As described on the [usage](/server/usage)
633
side, there are two ways on how you can use hocuspocus. With the built-in server. Or like a library with other

0 commit comments

Comments
 (0)