Live data from Hacker News

StimulusReflex, or LiveView for Rails

docs.stimulusreflex.com

11–20 of 93 posts

Re: StimulusReflex, or LiveView for Rails

#12
post #9

Earlier quoted context omitted.

in one word: morphdom ( https://github.com/patrick-steele-idem/morphdom ) also, StimulusReflex predates Hotwire for 1 year and is already pretty hardened :-)

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?

Exactly.

Basically all you to is to call a remote procedure, which you can do by adding a simple `data-reflex="click->Todo#toggle`. In the remote method you change something about the state (for example db, redis). The server rerenders the page and morphs the difference.

If you need more control you can get it by defining which elements to render and to morph.

Re: StimulusReflex, or LiveView for Rails

#13
post #6

DHH recently introduced Hotwire https://hotwire.dev/ which already does something similar. Any idea what the difference is?

in one word: morphdom ( https://github.com/patrick-steele-idem/morphdom ) also, StimulusReflex predates Hotwire for 1 year and is already pretty hardened :-)

Well Hotwire is running on Basecamp (or Hey?) , its not some half arsed solution...

Re: StimulusReflex, or LiveView for Rails

#14
post #10

Wish I had the time to really study Phoenix's LiveView and implement the same in Java. AFAIK there's no equivalent for this in Java and I mean the same not kinda-the-same but not really like Vaadin or God forbid GWT.

Wish?

thks

Re: StimulusReflex, or LiveView for Rails

#15
post #6

DHH recently introduced Hotwire https://hotwire.dev/ which already does something similar. Any idea what the difference is?

They don't really have any overlap.

Hotwire is for replacing frames with content when navigating through anchors or form posts.

StimulusReflex is performing RPC, then diffs the old page and the new page, updating changed elements.

Re: StimulusReflex, or LiveView for Rails

#16

Earlier quoted context omitted.

in one word: morphdom ( https://github.com/patrick-steele-idem/morphdom ) also, StimulusReflex predates Hotwire for 1 year and is already pretty hardened :-)

Well Hotwire is running on Basecamp (or Hey?) , its not some half arsed solution...

For sure! It just doesn’t really overlap.

Re: StimulusReflex, or LiveView for Rails

#17

To me, this looks like one of the few real ways out of the madness that is modern frontend development. Excited to see the approach gaining adoption!

I don’t think this holds up anymore. Tooling has come so far.

I have never in my life been as productive as I am inside of a Vue/Tailwind code base at this point.

One of my clients is a fairly vanilla Rails 4 app (which is arguably a friendly place to be - although slow) and it’s not even close. I miss Vue and having a full “app” environment on the front-end side constantly. Jumping back and forth between these projects is like going from a hot and steamy comfy jacuzzi into an icy cold pool.

Re: StimulusReflex, or LiveView for Rails

#19
post #6

DHH recently introduced Hotwire https://hotwire.dev/ which already does something similar. Any idea what the difference is?

They don't really have any overlap. Hotwire is for replacing frames with content when navigating through anchors or form posts. StimulusReflex is performing RPC, then diffs the old page and the new page, updating changed elements.

One difference is that liveview / reflex are stateful whereas Hotwire (turbo) is not. This has varying performance implications. Turbo will do repeat work server side and payloads will typically be bigger, however development may be simpler due to lack of state and memory usage server side may be lower.

Turbo also has the possibility to gracefully degrade when js is not available (although I doubt this will be taken advantage of much in practice).

Re: StimulusReflex, or LiveView for Rails

#20
I appreciate the work put into this, glad to see SPA alternatives and can understand using this for existing Rails projects.

I'm curious why would one would choose this over Phoenix LiveView for a new project? How are the two different?

Post reply on HN