Check the StimulusReflex Expo for interactive demos w/ code samples: https://expo.stimulusreflex.com/
StimulusReflex, or LiveView for Rails
11–20 of 93 posts
Re: StimulusReflex, or LiveView for Rails
#12Earlier 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?
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
#13DHH 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 :-)
Re: StimulusReflex, or LiveView for Rails
#14Re: StimulusReflex, or LiveView for Rails
#15DHH recently introduced Hotwire https://hotwire.dev/ which already does something similar. Any idea what the difference is?
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
#16Earlier 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...
Re: StimulusReflex, or LiveView for Rails
#17To 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 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
#18Re: StimulusReflex, or LiveView for Rails
#19DHH 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.
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
#20I'm curious why would one would choose this over Phoenix LiveView for a new project? How are the two different?