question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make less assumptions on Yjs provider for collaboration

See original GitHub issue

TipTap2 is making some strong assumptions on Yjs providers. Although accessing a provider directly makes sense for the awareness protocol, it might conflict with other uses of a Y.Doc.

If technically possible, I would suggest providing a Y.XmlFragment instead of a provider (or optionally). Also destroying the provider from the component does not seem to be a good idea.

The benefit from that would be, that the component could be used for multiple editors using the same provider simultaneous on the same page.

Not sure if that makes sense anyway 😉

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:25 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
holtwickcommented, Feb 2, 2021

I see. I guess a rough priority ordering should still be possible for most cases, because you are ordering the extensions already now somehow 😉 If the priority ordering would already work for the extensions that come with TipTap itself, this is certainly a win. Those that do not need a priority could still keep the order they have in the configuration as it is right now. For example by default priority 0. All those that need to execute earlier a value > 0 and vice versa for the later ones.

2reactions
samwilliscommented, Jan 11, 2021

Perfect!

It would be something like this:

// Add Y.XmlFragment to root Y.Array
const yarray = ydoc.getArray('note_list')
const yxmlNested = new Y.XmlFragment()
yarray.push(yxmlNested)

// Retrieve fragment for TipTap
const yarray = ydoc.getArray('note_list')
Collaboration.configure({
  fragment: yarray.get(0),
})

The docs for Y.Doc and the fragments are here: https://docs.yjs.dev/api/y.doc

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Collaborative Editor - Yjs Docs
This guide will walk you through the main concepts of Yjs. First, we are going to create a collaborative editor and sync it...
Read more >
Transcript: A Deep Dive Into Yjs Part 2- Tag1 Team Talk #005
We're really interested in collaboration because it is how modern workforces get things done. All day long, I'm working with the Tag1 team...
Read more >
CRDTs go brrr - Seph
Improving the data structure. Luckily, there's a better way to implement CRDTs, pioneered in Yjs. Yjs is another (competing) opensource CRDT ...
Read more >
Yjs: A Framework for Near Real-Time P2P Shared Editing on ...
In this paper we present Yjs, a lightweight open-source JavaScript framework that can be used for collaborative editing of arbitrary data ...
Read more >
Challenges and barriers in virtual teams: a literature review
Furthermore, the level of technical infrastructure can also create collaboration challenges [193]. Technology for remote work fails without ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found