Introducing Live Elements: Rails TurboStream applications. Without WebSockets or long polling. Or you needing to write even a single line of JavaScript code.
@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.
@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: "https://ga.jspm.io/npm:@turbo-boost/streams@0.0.8/app/assets/builds/@turbo-boost/streams.js"
@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