A way less marketed version of this is htmx [1]. It is a single javascript file that enables this functionality. I mostly see people using it with Go backends but I think it is flexible. I have been meaning to try it out for a year or so.<p>1. <a href="https://htmx.org/" rel="nofollow">https://htmx.org/</a>
For those looking for something similar in PHP/Laravel, I strongly recommend checking out Livewire:
<a href="https://laravel-livewire.com/" rel="nofollow">https://laravel-livewire.com/</a><p>I still use React for more complex projects but it’s always a breath of fresh air to be able to write everything in Blade/PHP while keeping the reactive UI elements.<p>Edit: Although I have not used, I remember seeing this package which lets you render React/Vue components within Livewire when you need it: <a href="https://minglejs.unitedbycode.com/" rel="nofollow">https://minglejs.unitedbycode.com/</a> an interesting escape hatch for when you want to pull in existing packages
I used to be really negative on Hotwire/Livewire but I now realize it’s a horses-for-courses kind of thing. Sending partials over the wire is a hypermedia thing, and I just don’t write hypermedia apps nowadays. It was htmx and re-reading RTF’s REST paper that got me to this place: I still don’t think hypermedia is inherently the superior architecture, but it is a legit peer among several, and it’s nice to see it keep evolving, even if slowly.
This is by far the easiest way to do PWA without getting into the rabbit hole of react/Vue/svelte. I used them, and are awesome, don't misunderstand me.<p>While comparing with htmx it feels more developer focus than tech focus, but I believe the race between the two will depend on which one is integrated with your backend framework.
Here's the HN conversation from 2020 [1], a little closer to when this came out.<p>- [1] <a href="https://news.ycombinator.com/item?id=25507942">https://news.ycombinator.com/item?id=25507942</a>
We’ve come almost full circle. I remember using this approach back in 2005 or 2006 by intercepting clicks and appending a parameter that just returned rendered html partials that just .innerHTML replace the main contents.
I haven’t worked with web apps that need highly interactive frontends, but for our e-commerce stores and internal rails apps turbo and stimulus have really lowered the bar on how much new developers must learn to build a nice to use website.
So... I'm a paying customer for Hey since it launched. And frankly, if the experience of the Hey webapp is an example of the best of Hotwire, no fucking thanks. On a slow connection, it's <i>bad</i>. Maybe that's the developers not adding loading or error states. Maybe it's just a lot of complexity. Maybe it's bugs in Hey. I don't know, but it's not good.<p>In the face of medium-high latency, stuff behaves in an unpredictable/buggy way. Boxes open with no content. Links don't work like you'd hope. Lots of actions in quick succession don't abort in a way I'd find intuitive. It just feels off.<p>As bad as an SPA might be, this is a step <i>away</i> from UI feeling native and natural, in my opinion.
For anyone curious why this is popping up now:<p>Last week, someone posted online how Hey (created by DHH, who also created Hotwire and Rails) is slow when opening a modal: <a href="https://x.com/noahflk/status/1795758603577545035" rel="nofollow">https://x.com/noahflk/status/1795758603577545035</a><p>It created a bunch of heated conversation (DHH saying the original video was throttled, other people saying Hotwire is too reliant on the network if a modal needs time to load, people defending Rails/Hotwire, people disagreeing with its approach, etc...).<p>Basically, it's been a big topic on Twitter the past week.
With the same idea but more minimalistic, I have done Swap JS two years ago :<p><a href="https://github.com/josephernest/Swap">https://github.com/josephernest/Swap</a><p>Used it for a few projects it works well !
I've used Hotwire for a few sites. I much prefer it to HTMX since it's significantly easier to implement.<p>My No-React tech stack is Alpine.js, Hotwire, EJS, and Express. Works very nicely for simpler sites.<p>Though for the majority of the sites I make, React wins almost every time since it's way easier to use as a templating and interactivity engine. And Tailwind works a lot better with React.
Turbo’s morphing is insane. With 2 lines of code: 1 in the model and 1 in the view, you can make any previously static page an instant updating multiplayer experience.
Very cool. It's interesting to see REST become REST again. Also cool to see this come from 37signals. I use Basecamp for a makerspace that I am a part of, and it works quite well for our needs.
It's perplexing to me that Hotwire isn't more popular. The main documentation site doesn't mention this prominently, but it's basically <i>the</i> canonical way to do this sort of stuff with Rails now, as it's all originally from Basecamp.<p>It may be intentional that it's relatively low key, or broader promotion is at least a non-goal of the project. But if you're still doing anything with jquery - rails or not - you owe it to yourself to look at this as a great replacement, and a very strong competitor to bloated client side frameworks for most webapps.<p>There are also helpers to build webview apps for both IOS and Android too [0].<p>[0] <a href="https://strada.hotwired.dev/" rel="nofollow">https://strada.hotwired.dev/</a>
For what it's worth, Hotwire isn't very interesting. The real magic is in Turbo or Turbolinks (the pre-Turbo version of Turbo).<p>Turbolinks is the HTMX-Boost before HTMX was HTMX.
I love the idea of Hotwire and I'm already using it in one of my production project. Overall it saved me a lot of time and frustration having to deal with a separate frontend project, and the frustration having to manually manipulate the DOM with JavaScript in traditional MVC project.<p>However I faced some other new frustration, such as when trying to make a dynamic nested form (similar to cocoon gem) but only with hotwire stack (turbo frame/stream). It is also hard to think of each hotwire controller as a component, you might face some problems when trying to do some nesting.<p>I think Hotwire will be a perfect fit if you want a traditional websites with a few dynamic, interactive features. If your website is too much app-like, you should consider switching the frontend part to SPA entirely.
For frontend, one has to decide - am I making a website (informational pages) or an app (interactive widgets) ?<p>For a website, SEO is important hence good ol html server rendering wins. There isn’t much interactivity.<p>For an app, how fast UI responds to user input matters. This is where JavaScript shines because interactive logic lives in the client device. User could be under a tunnel or offline, and a well written app will work.<p>Hey app had some Twitter discussions (can’t find thread), that it slows down to respond to clicks on 3G speeds. Because it had to call the server to load what UI snippet to show to user.<p>Essentially - choose the tech that fixes the best user experience.
A bit late to the party here, but I’ve used Hotwire for a little while now.<p>Turbo is wonderful and seemingly straightforward, but also has some real hidden gems that aren’t well-documented (a problem which plagues Stimulus as well).<p>Stimulus is also great, but you can’t go into it expecting React. State management can get very tedious.<p>I use Turbo and Stimulus for most interactions in my current project, but I pull in Preact and HTM where I really need them. It’s trivial to have a Stimulus controller mount a Preact component and sync state between them, so it’s all very transparent.
It looks like the only way to get a sense for what this does and how it works is to watch videos? If so, blegh.<p>Surprised something like this wouldn't have any example code or demos to look at.
I’ve been using Hotwire for a greenfield project for the last year. The hotwire framework they’ve created is pretty nice but I miss React and will probably choose it for my next project.<p>Not just because it’s decoupled from the backend api. The React/Vue ecosystems have a lot more useful open source components, and you can build faster, more cache friendly front ends, among other benefits.<p>I agree React is more complex, but as with many things if you are gonna need it then it’s great to have started with it.
Here we go again! I have been using it 15 years ago.<p>I am a user of Hey and what I can say is the UX is dreadful. I am seeing spinner way more than I can handle, really.<p>I assume this proposal is to moving backwards.<p>Instead we would need to sort of data on client and full-body client app, doesn’t matter if it’s for web, ios, android. And the data should be given back to us - users.<p>The problem with that is that services like Hey become a true commodity and doesn’t lock users by keep exclusive access to their data anymore. So it’s to be figured out what is the new business model.
Glad to see this is getting attention again. But for those that don't know, this is several years old. See <a href="https://news.ycombinator.com/item?id=25507942">https://news.ycombinator.com/item?id=25507942</a>
Been some developments since 2020, this isn't new.<p>Context for why this might be coming up now:<p><a href="https://news.ycombinator.com/item?id=40555541">https://news.ycombinator.com/item?id=40555541</a>
ASP.NET WebForms had an "Ajax component" called UpdatePanel, that was just a div and a HTTP call to rewrite the whole div from server. Seems like the same to me :D
I thought “HTML over the wire” was literally what the web has always been about from the very start.<p>Even if you redefine “the wire” to “XHR requests” or “Ajax requests” it’s still weird to treat this as a revolutionary thing since the “X” in XHR and Ajax is “XML” which is just a sibling markup language to HTML.<p>Also, IIRC the original Rails approach to Ajax like 15 years ago or so was sending page partials like this.<p>It feels like we’re going in circles.<p>(I’ve also never been impressed with their “turbo links” which just seem like “we think we can do caching better than the browser makers” and thus dubious. Core Rails seems great but I’m always wary of this stuff at the edges with the extra dollop of hype.)
Theo dug into Hey and Hotwire only a day ago and has a less than flattering take. Not on the concept necessarily but some implementations.<p><a href="https://m.youtube.com/watch?v=5jIwILYjXrU" rel="nofollow">https://m.youtube.com/watch?v=5jIwILYjXrU</a>