# Switching realtime provider (removing Hocus Pocus)

**URL:** <https://forum.xwiki.org/t/switching-realtime-provider-removing-hocus-pocus/16867>\
**Category:** Cristal\
**Tags:** development\
**Created:** [April 22, 2025, 7:20am UTC](https://forum.xwiki.org/t/switching-realtime-provider-removing-hocus-pocus/16867 "2025-04-22T07:20:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClementEXWiki](https://forum.xwiki.org/user_avatar/forum.xwiki.org/clementexwiki/32/8428_2.png) [@ClementEXWiki](https://forum.xwiki.org/u/ClementEXWiki)\
**Post date:** [April 22, 2025, 7:20am UTC](https://forum.xwiki.org/t/switching-realtime-provider-removing-hocus-pocus/16867/1 "2025-04-22T07:20:16Z")

</div>

Currently Cristal uses [Hocus Pocus](https://tiptap.dev/docs/hocuspocus/) as the realtime provider (client + backend).

After experimenting with it, it seems like it has a considerable set of drawbacks for our use case. First of all, Hocus Pocus is specifically designed to be used inside TipTap, and this shows when you read the docs or check code examples.

- Lots of synchronization errors that seemingly come from nowhere - we have a very basic server with almost no customization, same for the client. Yet synchronization with other clients very often fail without any error being shown, replacing the editor’s content for all realtime players with an empty text
- There is a lack of correct typing for some parts of the library, notably events which are not typed at all. This is not a major issue but it’s still unfortunate for a library to require manual typing in a TypeScript project.
- Recurring troubles with WebSocket which for some reason doesn’t work reliably - very often it stops working and I can’t figure out why. This may be a misconfiguration in Cristal but I can’t find what the problem could be given the very low amount of configuration we do.
- Lack of configuration options - you can’t for instance configure the timeout for the client when trying to connect to the server, and the default is way too high for our need. The only way to do it is to create a WebSocketProvider ourselve, which comes with its own set of troubles.
- Some events are confusing - there is no clear way to know when the initial connection to the server failed, only that it closed. Which makes code harder to write and read.

For all these reasons, and given we don’t have any specific need for the provider other than “just working” and a few configuration options, I think it would be best to look at alternatives to replace Hocus Pocus.

There are many options, the most interesting one for me would be [LiveBlocks](https://liveblocks.io/docs/get-started/yjs-slate-react), which seems to be really mature, editor-agnostic (not specifically tailored to TipTap or anything else), with complete typing, and it’s used in many different products which means it should be pretty battled-tested.

---

<div class="post-metadata">

**Author:** ![MichaelHamann](https://forum.xwiki.org/user_avatar/forum.xwiki.org/michaelhamann/32/3813_2.png) [@MichaelHamann](https://forum.xwiki.org/u/MichaelHamann)\
**Post date:** [April 22, 2025, 9:11am UTC](https://forum.xwiki.org/t/switching-realtime-provider-removing-hocus-pocus/16867/2 "2025-04-22T09:11:29Z")

</div>

Is LiveBlocks a free and open source software solution that is free to use? [Pricing | Liveblocks](https://liveblocks.io/pricing) doesn’t sound like it to me. It doesn’t seem useful for me to try to use a software that is only free for up to 50 monthly active users (unless I completely misunderstood the goals of this proposal).

---

<div class="post-metadata">

**Author:** ![pjeanjean](https://forum.xwiki.org/user_avatar/forum.xwiki.org/pjeanjean/32/5901_2.png) [@pjeanjean](https://forum.xwiki.org/u/pjeanjean)\
**Post date:** [April 22, 2025, 9:32am UTC](https://forum.xwiki.org/t/switching-realtime-provider-removing-hocus-pocus/16867/3 "2025-04-22T09:32:22Z")

</div>

Right, they announced an open source server some time ago but it doesn’t look like their main focus anymore: [[FEATURE\_REQUEST] Self-hosting? · Issue #682 · liveblocks/liveblocks · GitHub](https://github.com/liveblocks/liveblocks/issues/682)

---

<div class="post-metadata">

**Author:** ![ClementEXWiki](https://forum.xwiki.org/user_avatar/forum.xwiki.org/clementexwiki/32/8428_2.png) [@ClementEXWiki](https://forum.xwiki.org/u/ClementEXWiki)\
**Post date:** [April 22, 2025, 9:32am UTC](https://forum.xwiki.org/t/switching-realtime-provider-removing-hocus-pocus/16867/4 "2025-04-22T09:32:30Z")

</div>

Good point, from what I can see the pricing is for their own hosting offering.  
The libraries themselves are licensed under Apache 2.0 [liveblocks/LICENSE at main · liveblocks/liveblocks · GitHub](https://github.com/liveblocks/liveblocks/blob/main/LICENSE)

---

<div class="post-metadata">

**Author:** ![ClementEXWiki](https://forum.xwiki.org/user_avatar/forum.xwiki.org/clementexwiki/32/8428_2.png) [@ClementEXWiki](https://forum.xwiki.org/u/ClementEXWiki)\
**Post date:** [April 22, 2025, 9:36am UTC](https://forum.xwiki.org/t/switching-realtime-provider-removing-hocus-pocus/16867/5 "2025-04-22T09:36:17Z")

</div>

I wasn’t aware of that, thanks for pointing it out.

Another option that could be considered would be WebRTC, which is pretty standard, but the plugin ([GitHub - yjs/y-webrtc: WebRTC Connector for Yjs](https://github.com/yjs/y-webrtc)) seems to not be very well maintained.

There’s also the WebSocket route with [GitHub - yjs/y-websocket: Websocket Connector for Yjs](https://github.com/yjs/y-websocket) and [GitHub - yjs/y-websocket-server: A basic backend for y-websocket](https://github.com/yjs/y-websocket-server/)

Another option to consider would be [https://partykit.io/](https://partykit.io/)

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [April 22, 2025, 3:33pm UTC](https://forum.xwiki.org/t/switching-realtime-provider-removing-hocus-pocus/16867/6 "2025-04-22T15:33:09Z")

</div>

I think we need to have a more detail comparison matrix of the alternatives before making a choice.  
With criterias like:

- license
- risk of becoming close source (or a very limited open core)
- sustainability of the project (i.e., how likely maintained in the long term)
- current support for Blocknote

Also, if you identified bugs with HP integration with Blockbnote, it might be interesting to raise them to the maintainers. If we are lucky, they might fix them.

---

<div class="post-metadata">

**Author:** ![ClementEXWiki](https://forum.xwiki.org/user_avatar/forum.xwiki.org/clementexwiki/32/8428_2.png) [@ClementEXWiki](https://forum.xwiki.org/u/ClementEXWiki)\
**Post date:** [April 23, 2025, 6:43am UTC](https://forum.xwiki.org/t/switching-realtime-provider-removing-hocus-pocus/16867/7 "2025-04-23T06:43:20Z")

</div>

Absolutely, this topic was mainly focused on “do we remove Hocus Pocus?”  
Choosing a new provider will be another subject.

---

<div class="post-metadata">

**Author:** ![MichaelHamann](https://forum.xwiki.org/user_avatar/forum.xwiki.org/michaelhamann/32/3813_2.png) [@MichaelHamann](https://forum.xwiki.org/u/MichaelHamann)\
**Post date:** [April 23, 2025, 8:25am UTC](https://forum.xwiki.org/t/switching-realtime-provider-removing-hocus-pocus/16867/8 "2025-04-23T08:25:20Z")

</div>

> [@mleduc](#):
>
> With criterias like:

A criterion I’m missing is the ability to use XWiki as realtime backend. As we want to integrate the editor in XWiki, too, it would be quite a showstopper if realtime synchronization required running a separate server.

---

<div class="post-metadata">

**Author:** ![ClementEXWiki](https://forum.xwiki.org/user_avatar/forum.xwiki.org/clementexwiki/32/8428_2.png) [@ClementEXWiki](https://forum.xwiki.org/u/ClementEXWiki)\
**Post date:** [April 23, 2025, 9:52am UTC](https://forum.xwiki.org/t/switching-realtime-provider-removing-hocus-pocus/16867/9 "2025-04-23T09:52:50Z")

</div>

Does XWiki expose a Y.js-compatible server? I’m only seeing Hocus Pocus in the codebase…

---

<div class="post-metadata">

**Author:** ![mflorea](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mflorea/32/49_2.png) [@mflorea](https://forum.xwiki.org/u/mflorea)\
**Post date:** [April 28, 2025, 1:16pm UTC](https://forum.xwiki.org/t/switching-realtime-provider-removing-hocus-pocus/16867/10 "2025-04-28T13:16:07Z")

</div>

> [@ClementEXWiki](#):
>
> Does XWiki expose a Y.js-compatible server?

It does not.

> [@MichaelHamann](#):
>
> it would be quite a showstopper if realtime synchronization required running a separate server

For BlockNote integration, initially we’ll be using a separate server, but on the long run we’ll have to think about how to “embed” (or implement) this synchronization backend in XWiki.
