morphdom
turbo
morphdom | turbo | |
---|---|---|
14 | 155 | |
3,306 | 6,967 | |
1.1% | 1.0% | |
5.3 | 8.0 | |
12 days ago | 10 days ago | |
JavaScript | JavaScript | |
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
-
If Not React, Then What?
All of what I'm talking about is doable through libraries today (or you can write it yourself). But making things available through DOM APIs create a new baseline where the very same tools are made available for anyone, no matter the framework (think: document.querySelector APIs).
Regarding patch, morphdom explains very well the difference between replacing and patching the DOM [1]:
> Replacing an entire DOM tree is fast but loses internal state (e.g., scroll positions, input carets, CSS transitions). Instead, we aim to transform the existing DOM tree to match the new one, minimizing changes and preserving state.
---
1: https://github.com/patrick-steele-idem/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
-
how do i morph an entire html document dom?
no it actually looks like morphdom is what i'm looking for.
-
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.
-
Displaying Real-Time Data in Your Web Application Without Hassle: IHP Auto Refresh ✨
Whenever the JavaScript on the browser-side receives new HTML, it will update the current page using a DOM-diff approach (using morphdom). So only DOM nodes that have actually changed between the initial page load and the updated HTML will be updated.
turbo
-
Less Htmx Is More
There are two sides to the argument which I think should be treated separately: a) Is it a good idea overall? and b) is htmx implementation good enough?
a) I think so, yes. I've seen much more spa that have a completely broken page navigation. This approach does not fit all use cases, but if you remember that the whole idea of htmx is that you rely on webserver giving you page updates as opposed to having a thick js app rendering it all the way it makes sense. And yes, js libraries should be wrapped to function properly in many cases, but you would do the same with no react-native components in any react app for example
b) I don't think so. htmx boost functionality is an afterthought and it will always be like this. Compare it with turbo [1] where this is a core feature and the approach is to use turbo together with stimulus.js which gives you automagical component life cycle management. Turbo still has it's pains (my favorite gh issue [2]), but otherwise it works fine
[1]: https://turbo.hotwired.dev/
-
Type-Casting Doubt: How A TypeScript Re-Migration Revealed The Truth About Turbo
The TypeScript configuration used in previous attempts was fundamentally flawed. From tsconfig.json prior to removal in commit 0826b8152c0e97f19d459c1a1c364fa89cc62829
-
Types are the basic tool of software design
https://github.com/hotwired/turbo/pull/971/files
- Turbo – Single-page web application without having to write JavaScript
- The speed of a single-page web app without having to write any JavaScript
-
Superglue vs. Hotwire for modern frontend development
Turbo
-
Playing around with Hotwire ⚡️
As you can see in the example above, I'm using Turbo Frames to give a single-page application feel, while not having to write any JavaScript.
-
Turbo Streaming Modals in Ruby on Rails
I also recommend checking out the docs for Stimulus and Turbo to familiarise yourself with all their features and the APIs used in this series.
-
Htmx vs. React: A Complete Comparison – Semaphore
https://github.com/hotwired/turbo
- Turbo 8 has been released
What are some alternatives?
Phoenix - Peace of mind from prototype to production
inertia - Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
turbo - Build system optimized for JavaScript and TypeScript, written in Rust [Moved to: https://github.com/vercel/turborepo]
htmx - </> htmx - high power tools for HTML
reactor - Phoenix LiveView but for Django
stimulus_reflex - Build reactive applications with the Rails tooling you already know and love.