y-crdt / yrb-actioncable

An ActionCable companion for Y.js clients.
https://y-crdt.github.io/yrb-actioncable/
MIT License
47 stars 5 forks source link

Compatibility with import maps #55

Open slondr opened 1 year ago

slondr commented 1 year ago

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?

eliias commented 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.

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.

Phaengris commented 7 months ago

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/