yjs / y-prosemirror

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

sync-plugin: make `y-prosemirror` build against new `yjs`. #144

Open jmoudrik opened 10 months ago

jmoudrik commented 10 months ago

Issue: Currently, y-prosemirror does not build against yjs newer (or equal) than v13.5.45, it npm run dist throws:

src/plugins/sync-plugin.js:662:36 - error TS2554: Expected 0 arguments, but got 1.

662     const attrs = el.getAttributes(snapshot)
                                       ~~~~~~~~
Found 1 error in src/plugins/sync-plugin.js:662

Cause: In yjs, the el.getAttributes(snapshot) was changed to el.getAttributes(), (the implementation did not use the snapshot arg anyway) here - if I am git blaming correctly :-) https://github.com/yjs/yjs/compare/v13.5.44...v13.5.45#diff-c299d1b6aeba1b81704fa26fd317da05091111fc72ac264c0772d2563ed9f6f8L1237

Fix: