ElMassimo / vite_ruby

⚡️ Vite.js in Ruby, bringing joy to your JavaScript experience

Home Page:https://vite-ruby.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rails turbo import

chmich opened this issue · comments

Hi

little thing:

On `vite:install', it generates these two lines in application.js

//import * as Turbo from '@hotwired/turbo'
//Turbo.start()

For using turbo thats right, but for using action-cable and turbo to get running you need this:

import '@hotwired/turbo-rails'

Not a big thing, but getting ActionCable up and running has a few more steps and I spent half a day looking for it.

see issue on turbo-rails

Thanks,
Christian

Hi Christian!

Thanks, this info might be useful to someone setting up ActionCable, so I'll convert it to a Discussion.

I think I'd prefer dropping these "examples" from the installation script, as they will likely change and need to be updated over the years. In addition, not every Vite Rails user is using these libraries, and I don't want beginners to assume they are necessary (nor recommended).