yjs / y-quill

Quill Editor binding for Yjs
https://demos.yjs.dev/quill/quill.html
MIT License
79 stars 18 forks source link

Support for Quill v2 #16

Closed mjwweb closed 2 months ago

mjwweb commented 6 months ago

I see this project isn't maintained anymore. Are there any plans to keep it updated, or should I switch over to using y-prosemirror? Quill v2 official beta is out quill@2.0.0-beta.0, but not yet supported in y-quill. I have verified the official beta release of Quill v2 here:

https://github.com/quilljs/quill/issues/3806#issuecomment-1878090324

Quill v1 is using a deprecated DOMNodeInserted mutation event which will be removed from Chrome in July 2024, making Quill v1 obsolete along with y-quill. You can learn more about the issue in the link I provided. As of now, I see y-quill has no support for Quill v2 and I get these errors when building y-quill with v2:

npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: y-quill@0.1.5 npm ERR! Found: quill@2.0.0-beta.0 npm ERR! node_modules/quill npm ERR! quill@"^2.0.0-beta.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer quill@"^1.3.7" from y-quill@0.1.5 npm ERR! node_modules/y-quill npm ERR! y-quill@"^0.1.5" from the root project npm ERR! npm ERR! Conflicting peer dependency: quill@1.3.7 npm ERR! node_modules/quill npm ERR! peer quill@"^1.3.7" from y-quill@0.1.5 npm ERR! node_modules/y-quill npm ERR! y-quill@"^0.1.5" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! /home/ubuntu/.npm/_logs/2024-01-05T15_39_57_532Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /home/ubuntu/.npm/_logs/2024-01-05T15_39_57_532Z-debug-0.log

dmonad commented 6 months ago

This project is still maintained ;)

I wasn't aware that the stable quill@v1 releases uses a deprecated APi. Is that documented somewhere? If I recall correctly, the v2 release has been in beta-status for a few years now. So I'm a bit hesitant to upgrade y-quill right now.

Regarding the deprecation of APIs and quill v1 not working anymore: I'm not sure where you read that, but I don't think this will happen. Quill v1 is used by A LOT of websites. Chrome won't just remove the feature and break the internet.

Once Quill makes a release, I'll get started on upgrading y-quill to the current stable release. Please ping me here once that happens.

In the meantime, if you are interested in building it yourself, I'd be happy to help!

mjwweb commented 6 months ago

The DOM mutation event (DOMNodeInserted) will indeed be removed from in Chrome in July 2024 which Quill v1 does rely on to some extent.

You can read more on the Chrome deprecation here

The Quill maintainers are hinting they wont be updating Quill v1 to fix this issue https://github.com/quilljs/quill/issues/3806#issuecomment-1598891407

Another comment regarding the support of Quill v1 after Chrome deprecates dom mutation events: https://github.com/quilljs/quill/issues/3806#issuecomment-1886077331

I very briefly looked into y-quill.js and I assume as long as the quill deltas remain the same in Quill v2 then y-quill should work fine with v2. I don't see any major changes in v2 as of now.

Updating the peer dependencies in the package.json of y-quill should suffice. I haven't done any testing so don't take my word for it. If I get around to do any testing I'll post back in this thread.

  "peerDependencies": {
    "yjs": "^13.0.0",
    "quill": "1.3.6 || 2.0.0"
  }
dmonad commented 5 months ago

Wel.. I hope the Chrome Team knows that they gonna break the internet next July.

dmonad commented 5 months ago

meme-this-is-fine

Chrome Dev Team in July

dmonad commented 2 months ago

Quill@v2 was finally released. I made this library ready for v2 and upgraded all the build tools. I will publish a y-quill@v1 release soon that will be compatible with quill@v2.