Ho

Hocuspocus 4 – self-hosted Yjs collaboration backend

Hacker News

Hocuspocus 4 – self-hosted Yjs collaboration backend

Hi HN! I'm Philip, one of the founders of Tiptap. Next to our open-source rich text editor framework, we started developing Hocuspocus about five years ago and open-sourced it too, to solve one of our biggest challenges back then: real-time collaboration in web editors. We found Yjs by Kevin Jahns, a CRDT library that handles concurrent edits without conflicts. Basically, Yjs merges changes from users without conflicts and in real-time. Hocuspocus is the WebSocket server built on top of Yjs. It handles real-time sync, presence/awareness, persistence, and Redis-based scaling. While we use Hocuspocus at Tiptap as the collaboration backend for our cloud services, it also works with any Yjs client (Slate, Quill, Monaco, ProseMirror, or your own setup), and Yjs documents aren't limited to text at all. You can sync any structured data through them, and in the meantime we see projects that rely on Hocuspocus without using the Tiptap editor. We released Hocuspocus v4 under the MIT license a few weeks ago, and the biggest change is that it's no longer tied to Node. The previous versions depended on the ws package, which meant you couldn't run Hocuspocus on Bun, Deno, or Cloudflare Workers. We moved to crossws, a universal websocket adapter, so the same server now runs on Node, Bun, Deno, Cloudflare Workers, and Node with uWebSockets. That also lets you run collaboration at the edge. The other changes are smaller but are important if you're using Hocuspocus in production: 1. Every core class and hook payload takes a generic Context type now, so the auth/session shape you build in onAuthenticate flows through every other hook with full type safety (defaults to any so existing code doesn't break). 2. Document updates are now processed sequentially per connection through an internal queue, which fixes a correctness bug where async hooks could cause CRDT updates to apply out of order under load. 3. Transaction origins are structured objects now with a source field instead of raw values and there's an isTransactionOrigin() helper for narrowing. 4. Hook payloads use web-standard Request and Headers instead of Node's IncomingMessage. 5. The wire protocol is backward compatible in both directions, so you can roll out servers and providers independently. If you want to test Hocuspocus: npm install @hocuspocus/server @hocuspocus/provider Docs at: https://tiptap.dev/docs/hocuspocus Source at: https://github.com/ueberdosis/hocuspocus Because running real-time collaboration on Workers or Durable Objects is new in v4, that's the use case we'd most like to hear your questions and feedback on.

Share card

Actual performance

38points
8comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: started, compatible · Missing: supports, reddit linkedin, podcasting
95%95% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Product HuntOn track for Day 1 leaderboard · Strong signals: user, new, context · Missing: mac, agents, macos
90%90% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: exist, existing, ide · Missing: https docs, excited, just released
69%69% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Strong signals: users · Missing: mobile apps, ios, personal
47%47% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Strong signals: host, users · Missing: plus, platform, intuitive
39%39% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: arr · Missing: mrr, revenue, profit
19%19% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Se
Self-hosted, django-based backend for use with Reeder58%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Self-hosted, django-based backend for use with Reeder

Hacker News1
In
Instanote – self-hosted pinboard68%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Instanote – self-hosted pinboard

Hacker News8
Mo
Mob – Self Hosted Polling67%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Mob – Self Hosted Polling

Hacker News2
Mo
Mob – Self Hosted Polling67%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Mob – Self Hosted Polling

Hacker News12
Se
Self-Hosted Literate K3s Cluster60%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Self-Hosted Literate K3s Cluster

Hacker News1
A
A Self-Hosted Podcatcher68%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A Self-Hosted Podcatcher

Hacker News2
Se
Self hosted x86-64 assembler75%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Self hosted x86-64 assembler

Hacker News4
Se
Self Hosted WebSocket Filesharing74%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Self Hosted WebSocket Filesharing

Hacker News4
Ro
Rove – Self-hosted container deployments63%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Rove – Self-hosted container deployments

Hacker News6
Se
Self-hosted Thunderclap68%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Self-hosted Thunderclap

Hacker News2