Thomas Cannon

Cat's a bit out of the bag on this one it seems 😅

I'm working on a detailed breakdown of Little CRM's networking stack, complete with real code samples and everyone's favorite: diagrams!

 

Turbo relies heavily on DOM morphing, a core tenant being "write your server-rendered pages, and let turbo morph the DOM & browser history API for SPA-like responsiveness. That introduces major & frustrating points of failure for 2 of the most foundational parts of a web browser.
Trying to muck around with how the browser handles large-scale page rewrites and browser history using morphing and heavily mucking with the History API introduces a ton of gotchas.
When you factor in browser caching, HTTP2/3, network speeds, and the complexity of browser engines; I think it's better to have your standard request/ response flow where it loads an entirely new page in reaction to a form submission or link click, than trying to programmatically diff the changes and morph the page to match what has changed and change the browser's history
It's the same class of problems as a virtual
DOM. Even if you're using something like morphdom, the principle of how it's operating is the same.

While you can opt out of these behaviors, you have to explicitly do so with a boatload of meta tags, configuration, and
remembering to do so. Turbo wants to do all this work, it thinks this is the way to handle behavior. Which I disagree with, because most of the conversations around Turbo I see outside of codepens & simple examples are seasoned programmers asking why it's not working as expected.
And if the default behavior of a framework as critical as your frontend stack causes that, maybe its approach is fundamentally flawed.
CableReady does have DOM Morphing and browser history manipulation; but they are opt-in. It's very clear when those behaviors occur, because you choose to enable them.
And you only write code for the behaviors you want, not to rip out the behaviors that cause problems.
Turbo Streams are not an easily grokable/ adjustable API & format
Turbo Streams are how Turbo allows you to send incremental changes as part of remote form submissions, but they're hard to use outside of the very basic cases.