yjs / y-prosemirror

ProseMirror editor binding for Yjs
https://demos.yjs.dev/prosemirror/prosemirror.html
MIT License
344 stars 119 forks source link

Use setMeta for all trs dispatched by ySyncPlugin #74

Closed TeemuKoivisto closed 2 years ago

TeemuKoivisto commented 2 years ago

So this is continuation for #66 and it is the fix I have been using with a locally linked version of y-prosemirror. Why I need this is because I'm intercepting transactions as in track changes functionality and I can't really detect whether the transaction was originally from ProseMirror or from ySyncPlugin.

With the added booleans in the meta field I can omit those transaction that are caused by for example rendering a snapshot. Also I think it is better DX if you can immediately see from a transaction that "ah this was dispatched by ySyncPlugin". It doesn't seem there are major downsides, without having the meta payload typed it is I guess a little harder to see what are the passed values.

dmonad commented 2 years ago

Great, thanks! I published a new release with your patch.