morphdom
stimulus_reflex
Our great sponsors
morphdom | stimulus_reflex | |
---|---|---|
13 | 45 | |
3,075 | 2,189 | |
- | 1.0% | |
4.2 | 7.5 | |
2 months ago | 5 days ago | |
JavaScript | Ruby | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
morphdom
-
HTML Streaming and DOM Diffing Algorithm
morphdom
-
The Ultimate Search for Rails - Episode 1
And sure enough, it works! So what's going on here? Well, clicking the link invokes our reflex, which gets executed right before our current controller action runs again. It allows us to execute any kind of server-side logic, as well as play with the DOM in various ways, but with ruby code. Then, the DOM gets morphed over the wire.
-
Build a JS Framework with 80 lines of Javascript
It's super simple actually. And that is in large part to (Morphdom)[https://github.com/patrick-steele-idem/morphdom] which I'm using to compare the output of render() to what is already on the DOM. Morphdom will patch the differences.
-
Using hotwired/turbo but patch the DOM vs Replacing
I'm using morphdom to patch our DOM. Its a very simple library that compares two DOM elements and updates only the differences. It is extremely performant and does not even use a Virtual DOM, just the DOM you already have!
-
Turbo 7.2: A guide to Custom Turbo Stream Actions
using HTML-diffing libraries like morphdom to efficiently update elements on the page
-
ssceng demo: Hacker News Client
It tries to morph into existing DOM (with https://github.com/patrick-steele-idem/morphdom). In case of fail, there is fallback to HTML replacement with outerHTML. All DOM operations after action occurs on component level, not the whole page.
-
Building a Live Search Experience with StimulusReflex and Ruby on Rails
Today, we’re going to build a live search experience once more. This time with StimulusReflex, a “new way to craft modern, reactive web interface with Ruby on Rails”. StimulusReflex relies on WebSockets to pass events from the browser to Rails, and back again, and uses morphdom to make efficient updates on the client-side.
-
Why Virtual DOM is considered faster that directly updating the real DOM.
Updating the DOM is not slow. In fact, there are libraries and frameworks that emphatically reject the virtual dom approach. morphdom is one such example of a DOM modification library. Svelte's author Rich Harris has been proclaiming for a while that virtual dom is an overhead (see e.g. this article). Google's lit-html and lit-element do much of what react does without the virtual dom.
-
HTML over-the-wire is the future of Web Development
Sockpuppet is a new way to craft modern, reactive web interfaces with Django. It extends the capabilities of both Django and Stimulus by intercepting user interactions and passing them to Django over real-time websockets. These interactions are processed by Reflex actions that change application state. The current page is quickly re-rendered and the changes are sent to the client. The page is then updated using a fast and lightweight DOM diffing/patching library called morphdom to reflect the new application state. This entire round-trip allows us to update the UI in 20-30ms without flicker or expensive page loads.
-
StimulusReflex, or LiveView for Rails
in one word: morphdom (https://github.com/patrick-steele-idem/morphdom)
also, StimulusReflex predates Hotwire for 1 year and is already pretty hardened :-)
stimulus_reflex
-
Coming to grips with JS: a Rubyist's deep dive
Then there are stack-specific libraries: StimulusReflex for Rails, Phoenix LiveView, Laravel Livewire, Unicorn and Tetra for Django, Blazor for .NET, … and the list goes on.
- Почему я программирую на Ruby
-
RailsWorld 2023: Hotwire Edition
Morphing and the concept to do refreshes after broadcast are hardly new. Stimulus Reflex has employed morphing to update the page for years, and CableReady::Updatable, which allows listening to model requests for refreshes, has also been around for a while. But I am excited to see these concepts being adopted in Turbo and becoming more mainstream.
-
Unicorn – A full-stack web framework for Django
Stimulus Reflex (Ruby), which predates Hotwire, also deserves a mention, though most of its momentum seemed to stall when Hotwire was announced.
-
Is there Ruby LiveView Framework?
Hi there, not crazy experienced on the topic but after some research i made for personal reasons i found https://mayu.live/ whick looks interesting (and as mentioned already https://docs.stimulusreflex.com/, seems to be close to Liveview)
-
Rails 7 - Turbo Frame and Turbo Stream
StimulusReflex Docs pretty easy to use and release 3.5.0 is coming soon.
-
Announcing elm-express
However, the timing may be a little off. In some ways, it feels like the "Express" way of developing for the backend is dying. We are seeing tools that blur the line between backend and frontend, trying to unify how we develop web applications. Tools like Phoenix LiveView, StimulusReflex, Laravel Livewire, Remix, Next.js, and many others are being developed.
-
A powerful search feature with what Rails provides out of the box
Reading the article and the source code, I learned a ton of stuff, as always. In his implementation, Louis is using StimulusReflex (built on top of Stimulus) to achieve this. I was curious about several points:
-
The Ultimate Search for Rails - Episode 1
First things first: on the frontend, we’ll use StimulusReflex (a.k.a SR) to build a super reactive and friendly search experience with very little code, and little to no JavaScript. For those unfamiliar:
Now that we know that our backend is working as it should, let’s wire up our stuff. I’m gonna skip on Stimulus Reflex setup and configuration and dive right in. You can easily follow the official setup or, if you use import-maps, follow @julianrubisch’s article on the topic. I also know that leastbad has been working on an automatic installer that detects your configuration and sets everything up for you if you care to try it before the next version of SR gets released.
What are some alternatives?
hotwire-rails - Use Hotwire in your Ruby on Rails app
turbo - The speed of a single-page web application without having to write any JavaScript
Phoenix - Peace of mind from prototype to production
solid - A declarative, efficient, and flexible JavaScript library for building user interfaces. [Moved to: https://github.com/solidui/solid]
jsbundling-rails - Bundle and transpile JavaScript in Rails with esbuild, rollup.js, or Webpack.
intercooler-js - Making AJAX as easy as anchor tags
hotwire-livereload - Live reload gem for Hotwire Rails apps.
Stimulus - A modest JavaScript framework for the HTML you already have
webtransport - WebTransport is a web API for flexible data transport
turbo - Incremental bundler and build system optimized for JavaScript and TypeScript, written in Rust – including Turbopack and Turborepo.