ruby.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
If you are interested in the Ruby programming language, come join us! Tell us about yourself when signing up. If you just want to join Mastodon, another server will be a better place for you.

Administered by:

Server stats:

1.1K
active users

Introducing Live Elements: Rails TurboStream applications. Without WebSockets or long polling. Or you needing to write even a single line of JavaScript code.

fly.io/ruby-dispatch/introduci

@samruby This looks a lot like what we've been doing with StimulusReflex and Turbo Boost!

@marcoroth I mention StimulusReflex in my post.... that's more heavyweight and if you go that way you don't need my library. I was not aware of Turbo boost, but that looks like something that can immediately be used with this library. I'll investigate further and likely update the post.

@samruby Yeah fair enough, this wasn't meant as an attack! StimulusReflex is definitely more heavyweight and currently still requires WebSockets.

This is also why we started Turbo Boost, which should be a more lightweight and WS-free alternative with the same concept, but built with the new Turbo-tech in mind.

@samruby But if I may add, StimulusReflex/CableReady are not just built for Webpacker. All asset bundling solutions for both Rails 6 and Rails 7 are supported, including Import maps.

You also don't need to write JavaScript/Stimulus controllers, that's just for the more advanced use-cases if you want to control certain things in the flow or want to use lifecycle-callbacks.

The upcoming CableReady 5.0 release doesn't require web sockets anymore, it also works over HTTP.

@samruby We also experimented with the things you mentioned in your last paragraph, we built a custom `<cable-ready>` element that can execute the operations. But decided to put it into a separate repo as we think it's not the path-forward: github.com/cableready/element

That's also why Turbo Power exists, it's meant to port over all the CableReady operations to Turbo Streams so you have the same action diversity as CableReady: github.com/marcoroth/turbo_pow

GitHubGitHub - cableready/element: `<cable-ready>` element`<cable-ready>` element. Contribute to cableready/element development by creating an account on GitHub.
Marco Roth

@samruby But I agree, it's still rough around the edges and hard to oversee. But I'd love to streamline all of this. Ideally including upstream Turbo/Hotwire.