Google Docs-style editing in Gutenberg with the YJS framework
Here at PublishPress, we’re focused on the publishing experience in WordPress.
And lately we've been learning about new publishing features that may be coming to WordPress.
The WordPress team want to bring Google Docs-style editing to the new Gutenberg editor. This means that multiple people can be updating the same document at the same time.
I wrote a detailed post on that goal and concluded that it looks like a really tough problem.
Collaborative editing is easy for Google because they have almost complete control over the servers. However, a WordPress solution must work everywhere, including on cheap, shared hosting.
Fortunately, there may be a solution. After my post, I was contacted by Kevin Jahns who's working on a project called Yjs. He already has a live demo of collaborative editing with Gutenberg!
After Kevin introduced me to Yjs, I learned a lot more about this framework. I eventually ended up sitting down for a chat with Kevin, Michael Meyers, and Fabian Franz from the Tag1 Consulting team.
Here's a video of our chat:
I'll pull out three highlights from this conversation:
- Yjs has ambitious goals: Kevin's goal is bring collaborative editing to everything we do online. Editing might be an early use-case, but why not drawing, 3D modeling, and other tasks?
- Yjs is ready to use now: Not only is a Gutenberg demo already live, but Yjs is currently deployed for some very large customers, including one with a Drupal-based network.
- Yjs is a great open source solution: This approach fits in very well with the overall ethos of WordPress.
More about Yjs
Yjs is a framework for real-time collaborative editing. It was not specifically built to use with WordPress or Gutenberg. In fact, Yjs enables developers to add shared editing capabilities to any application with relatively little effort.
YJS is a peer-to-peer solution. In my original post, I mentioned that one technical hurdle was that collaborative editing required a server. Some initial attempts at collaborative editing looked at requiring your WordPress site to start a resource-intensive server. Other approaches relied on a centralized server. Yjs side-steps this problem by creating a peer-to-peer network between the users who are editing together.
Here are some useful links to learn more about Yjs.
- Yjs website
- Yjs on Github
- Yjs discussion board
- Yjs editor demos
- Pull request for the Gutenberg-Yjs integration
- Tag1 blog posts on Yjs
Follow the last link to the Tag1 blog, and you'll find this video which Kevin talks about the origins of Yjs and shows demos.
I can't guarantee that Yjs will be the chosen solution for collaborative editing in Gutenberg. And, even if it is accepted, it will be at least a couple of years before we see it in the WordPress core.
But Yjs is very promising technology and I'm excited to see what can be done with it in WordPress and beyond.