Live data from Hacker News

StimulusReflex, or LiveView for Rails

docs.stimulusreflex.com

31–40 of 93 posts

Re: StimulusReflex, or LiveView for Rails

#31
post #26
post #9

Earlier quoted context omitted.

So this receives the full HTML page and does a near-zero-damage “morphing” as opposed to Hotwire which either does full page dumb replacement or asks you to define which sections to replace? Does that sound right?

> as opposed to Hotwire which either does full page dumb replacement or asks you to define which sections to replace It's not that dumb in practice because for a lot of things Hotwire uses HTTP instead of WebSockets which means you can take advantage of what HTTP has to offer such as caching. That means if you decide to dynamically load a menu's contents with a Hotwire Turbo Frame then it's only sent over the wire on…

There are a lot of wonderful upsides to this approach, yes.

It’s just... people think those technologies are congruent but the overlaps are actually minimal.

For any rather sophisticated UI you can (and will want) to use both.

For example: repaint a data visualization. With Hotwire you can only replace it and start fresh, with SR you can just surgically morph data attributes without disconnecting your stimulus controllers

Re: StimulusReflex, or LiveView for Rails

#33

Does python have anything like this?

htmx [1] (formerly intercooler) is sort of similar, although the server instead returns html fragments.

Here's an example [2] of using it for infinite scroll (instead of pagination).

I'm pretty excited to try out django-sockpuppet from an adjacent comment!

[1]: https://htmx.org/ [2]: https://engineering.instawork.com/iterating-with-simplicity-...

Re: StimulusReflex, or LiveView for Rails

#36
It's worth pointing out that the Phoenix Web Framework (which LiveView is built on) came into being because the creator Chris McCord tried to build something like LiveView in Ruby and eventually ran into fundamental limitations due to how concurrency was handled. He looked around, discovered Elixir and the rest is history.

I'm very interested to learn what has changed since then that made this possible, or made it work better. Or whether those problems are just being "lived with".

Re: StimulusReflex, or LiveView for Rails

#38
post #36

It's worth pointing out that the Phoenix Web Framework (which LiveView is built on) came into being because the creator Chris McCord tried to build something like LiveView in Ruby and eventually ran into fundamental limitations due to how concurrency was handled. He looked around, discovered Elixir and the rest is history. I'm very interested to learn what has changed since then that made this possible, or made it wo…

There's a project called AnyCable which replaces ActionCable to give Rails the real-time performance equivalent of LiveView.

See this https://evilmartians.com/chronicles/anycable-actioncable-on-...

Looks like having 20,000 idle clients connected to a server sits at only 380MB and Erlang is at 737MB.

Re: StimulusReflex, or LiveView for Rails

#39
In many ways, this is very cool.

But, I have to admit, I don't love it. I would love to have an integrated environment where client/server doesn't matter, but I don't think this gets far enough. Working in a spread of html.erb with special tags plus some Javascript doesn't feel great to me compared to React.

I like their TodoMVC app, since that gives a simple, minimal starting point. Getting persistence in that few lines of code is nice.

However, it has also at least one bug compared to canonical TodoMVC. I think the problem of this kind of too-clever binding is that it makes this kind of bug easy to introduce; whereas something with clear one-way data-binding like React, for all it can be verbose and annoying, tends to make it easier to get this sort of thing right.

(The bug? Click an existing todo to edit it, start typing, then press escape. The edit is meant to be discarded, but instead you'll see a flash of the old value and then the new value is persisted. It's not the worst bug ever, but shows that even in a simple app, experts can subtly screw up important behaviour.)

Re: StimulusReflex, or LiveView for Rails

#40

In many ways, this is very cool. But, I have to admit, I don't love it. I would love to have an integrated environment where client/server doesn't matter, but I don't think this gets far enough. Working in a spread of html.erb with special tags plus some Javascript doesn't feel great to me compared to React. I like their TodoMVC app, since that gives a simple, minimal starting point. Getting persistence in that few l…

[deleted]
Post reply on HN