Episodes
brian PRO said 7 months ago on From Webpacker to esbuild :
This is great, thank you. I just upgraded one of my apps.

Quick question. I assume we can get rid of actioncable and activestorage from the package.json file? I just created a rails 7 app, and they are not there. 

"@rails/actioncable": "^6.1.4-1",
 "@rails/activestorage": "^6.1.4-1",

old application.js
require("@rails/activestorage").start();
require("./channels");


David Kimura PRO said 7 months ago on From Webpacker to esbuild :
That does appear to be the case, but it could be included in the libraries elsewhere in a Rails 7 app. I haven’t looked too deeply where Rails 7 or which library would pull those in. It could be Hotwire related as far as the way we should approach channels and broadcasts.

Personally, seeing ActionCable moving into a "background" resource that is consumed via Hotwire is a good thing. But for existing applications, we may still need to import in the custom channels that we used in the past which means that we would need to keep the @rails/actioncable library.

The edge guides still show importing this in on custom channels. https://edgeguides.rubyonrails.org/action_cable_overview.html#client-side-components 

brian PRO said 7 months ago on From Webpacker to esbuild :
Did you do anything with UJS to make it work?

I am getting: Rails is not defined.

application.js
import Rails from "@rails/ujs"
window.Rails = Rails



David Kimura PRO said 7 months ago on From Webpacker to esbuild :
I didn't make any changes with Rails UJS. I wonder if there is anything else going on that could affect it. Are you able to confirm that the asset builds are being created?

Patrick PRO said 7 months ago on From Webpacker to esbuild :
Very nice episode!! Thanks for share!

Login to Comment