frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Hocuspocus 4 – self-hosted Yjs collaboration backend

https://github.com/ueberdosis/hocuspocus
25•philipisik•5h ago
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.

Comments

Terretta•3h ago
Making this plug and play is fantastic, and the live "editor types" demo on tiptap.dev is spectacularly convincing.

So, say a data-privacy conscious prospect is interested a click up from the editor, considers the service, and pokes around. Can't find anywhere clarifying how you cannot even if you are ordered to by warrant see a customer's documents content. You have a sample app for legal; that type of client is going to care about this.

Also not readily seeing how security or auth actually works. Requests over TLS are sufficient for the "end to end military grade encryption" type marketing claims; every site with HTTPS or an S3-type storage can make the same claims about encryption in motion and encryption at rest. That relies on transport and provider. It's more interesting if the content is encrypted against you as the provider, like Apple's Advanced Data Protection for iCloud-stored content (e.g. Messages, Reminders, Bookmarks, iCloud Drive, Notes, Voice Memos…).

Any time a SaaS is asking a firm to keep all their documents on or run them through the SaaS, the data protection story should be stronger than this present security page.

Even Cybersecurity & Infrastructure Security Agency (CISA) might randomly write passwords into a notes document…

Alternatively, say HIPAA and etc. shouldn't be on it yet, and talk about when that is on the roadmap. But security story is generally best when baked into design from start.

philipisik•2h ago
I can definitely see your point for SaaS hosted documents, which, to some extent, applies to a lot of startup cloud services, and that's exactly why we open-sourced Hocuspocus: so you can host it yourself :)
curtisblaine•2h ago
When I try to do this kind of thing with y.js in a non-trivial way I always battle against two issues and ultimately quit because they're really hard to do efficiently:

1) Materializing documents. Assuming you don't have "live" yjs documents and you only merge diffs with diffUpdate, when one or more user are connected, it's always worth to have the blob in RAM to quickly merge diffs in it and save it periodically; when the usages of a document go away, you save it for the last time and you "ice" it in long term storage, offloading from RAM. I typically use a LRU cache for that. The problem is when too many users are working on too many docs and they all have to fit in RAM. How do you solve that?

2) GC. Again, assuming you don't have live documents but you only merge diffs, those blobs need to be garbage collected to compact them after a while iirc (if the doc is live it's done automatically). This normally is a periodic process that eventually GCs all documents in turn, one after the other. If you handle that, how do you manage to not make your server essentially unpredictable when it comes to compacting big blobs? GC'ing takes a toll on your CPU, and not GC-ing takes a toll on your RAM and secondary storage.

Show HN: Lance – image/video generation and understanding in one model

https://github.com/bytedance/Lance
37•cleardusk•4h ago•12 comments

Show HN: I built Istanbul live transit map

https://tarif.ist/
3•berkaycubuk•59m ago•0 comments

Show HN: I made a tool for learning scales, chords, and how to combine them

https://projects.alesh.com/intervalkit/
4•aleshh•2h ago•4 comments

Show HN: expo-callkit-telecom – easily integrate CallKit/Core-Telecom

https://github.com/mfairley/expo-callkit-telecom
2•mfairley•1h ago•0 comments

Show HN: Hocuspocus 4 – self-hosted Yjs collaboration backend

https://github.com/ueberdosis/hocuspocus
25•philipisik•5h ago•3 comments

Show HN: Forge – Guardrails take an 8B model from 53% to 99% on agentic tasks

https://github.com/antoinezambelli/forge
637•zambelli•1d ago•231 comments

Show HN: IgniteMS – batch text embeddings at 253K msg/s on 8x A100

https://github.com/Artain-AI/ignite-ms
2•ddayanov•3h ago•0 comments

Show HN: Superlog (YC P26) – Observability that installs itself and fixes bugs

https://superlog.sh/
67•Magnanten•1d ago•44 comments

Show HN: Gaussian Splat of a Strawberry

https://superspl.at/scene/84df8849
513•danybittel•1d ago•195 comments

Show HN: Open-Source Agentic QA Harness with Memory

https://vostride.com/agent-qa
13•pranshuchittora•9h ago•2 comments

Show HN: Number Gacha, a gacha game distilled to its essence

https://isabisabel.com/gacha/
252•babel16•1w ago•137 comments

Show HN: I made a 3D pose maker for artists

https://setpose.com/
83•augustvdv•1d ago•32 comments

Show HN: Haystack – Review the PRs that need human attention

https://haystackeditor.com/
41•akshaysg•2d ago•13 comments

Show HN: Files.md – Open-source alternative to Obsidian

https://github.com/zakirullin/files.md
708•zakirullin•2d ago•344 comments

Show HN: Yt-x v0.8.0 – Browse, play, and download YouTube from the terminal

https://github.com/Benexl/yt-x
26•Benex254•1d ago•3 comments

Show HN: Id-agent – Token efficient UUID alternative for AI agents

https://github.com/vostride/id-agent
40•pranshuchittora•1d ago•54 comments

Show HN: Pg_deltax, Apache-licensed alternative to TimescaleDB

https://github.com/xataio/deltax
35•tee-es-gee•1d ago•1 comments

Show HN: Hsrs – Type-Safe Haskell Bindings Generator for Rust

https://github.com/harmont-dev/hsrs
53•suis_siva•1d ago•7 comments

Show HN: Rust Database from Scratch

https://github.com/ayoubnabil/aiondb
7•ayoubnabil•9h ago•4 comments

Show HN: InsForge – Open-source Heroku for coding agents

https://github.com/InsForge/InsForge
59•mrcoldbrew•2d ago•7 comments

Show HN: IResearch – C++ search that beat Lucene and Tantivy on their benchmark

https://github.com/serenedb/serenedb/tree/main/libs/iresearch
11•gnusi•10h ago•3 comments

Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep

https://github.com/MinishLab/semble
441•Bibabomas•3d ago•150 comments

Show HN: Rocksky – Music scrobbling and discovery on the AT Protocol

https://tangled.org/rocksky.app/rocksky
117•tsiry•4d ago•44 comments

Show HN: Javalamp – A glowing terminal screensaver that keeps your Mac awake

https://github.com/breschio/javalamp
3•tbreschi•17h ago•4 comments

Show HN: Mezz, a curl-able WiFi sandbox for IoT pentesting

https://github.com/ABGEO/mezz
39•ABGEO•5d ago•10 comments

Show HN: Watch a neural net learn to play Snake

https://ppo.gradexp.xyz/
203•c1b•6d ago•47 comments

Show HN: LibreOffice-rs – I built a pure-Rust LibreOffice using autoresearch

https://github.com/clark-labs-inc/libreoffice-rs
9•stan_kirdey•1d ago•1 comments

Show HN: Auto-identity-remove – Automated data broker opt-out runner for macOS

https://github.com/stephenlthorn/auto-identity-remove
324•stephenlthorn•2d ago•135 comments

Show HN: The user agents crawling HN today

https://ai.realhackers.org/user_agents.txt
5•Bender•20h ago•4 comments

Show HN: claude-autopilot, autonomous dev pipeline with multi-model review

https://github.com/axledbetter/claude-autopilot
4•axledbetter01•21h ago•2 comments