Open slondr opened 1 year ago
There shouldn't be a hard blocker using this package itself with import maps, but the dependencies are a problem. In other words, yjs
could be a bit tricky to get right.
There are three dependencies, you could try adding them to the import map and run the bare minimum example app.
yjs
The client-side CRDT library (This might be hard to get right)@y-rb/actioncable
The Websocket bridge for CRDTs (this URL should work for the import map https://ga.jspm.io/npm:@y-rb/actioncable@0.2.1/dist/index.js)@rails/actioncable
for Rails Actioncable (I think Rails supports that out of the box already)I can try to find some time setting up a Rails demo app with import maps as well, but if you already have something, happily taking PRs.
In case anyone else will find this thread.
This is how I made it work in my Rails app.
https://phaengris.art/stories/2024-02-21_how-to-use-yjs-in-rails-with-importmap/
I'm looking into using yrb-actioncable with my rails app, but am blocked on the requirement to use yarn… Is there a way to use this project with import maps, which is the standard way to load JavaScript in a rails app since 7.0?