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.

Sam Ruby

@marcoroth Wasn't taken as an attack. But can Turbo Boost work with import maps? I tried to "pin" it and I'm getting "Error: <turbo-stream action="invoke" target="DOM">: unknown action"

@samruby It should, but you might also need to pin it's sub-dependencies. The `invoke` action is provided by the `@turbo-boost/streams` package.

@marcoroth Here's the result of the pin which did not work for me:

pin "@turbo-boost/streams", to: "ga.jspm.io/npm:@turbo-boost/st"

@samruby Just to be clear, you've got both `@turbo-boost/commands` and `@turbo-boost/streams` pinned?

@marcoroth Even with adding

bin/importmap pin @turbo-boost/commands@0.0.8

I'm still seeing:

Error: <turbo-stream action="invoke" target="DOM">: unknown action

@samruby If you are just using `@turbo-boost/streams` then you wouldn't need the `commands` package pinned.

Do you have the `import '@turbo-boost/streams'` in your `application.js`?

@marcoroth Hello World!

I'm now going to update my post. 😃

@samruby I'm glad you figured it out!

And I'm going to prepare a PR to improve this to make it easier for folks 🙃