TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Hotwire: HTML over the Wire

1073 pointsby samenameover 4 years ago

102 comments

SahAssarover 4 years ago
I&#x27;ve never seen one of these &quot;logic in html-attributes&quot; systems take error checking seriously. In stimulus they start to mention it in &quot;Designing For Resilience&quot; (though only for feature-checking), but in &quot;Working With External Resources&quot; where it uses calls network&#x2F;IO bound calls they never mention how to handle errors or if the framework just leaves it up to you. Stimulus is also where you need to write your own js code, so I guess you could handle it yourself but in turbo when I skimmed the handbook I find no mentions of what&#x2F;how to handle errors (or even what happens when turbo gets one), and when loading stuff over the network that is pretty much crucial.<p>From the turbo handbook: &quot;An application visit always issues a network request. When the response arrives, Turbo Drive renders its HTML and completes the visit.&quot; Using the phrase &quot;When the response arrives&quot; begs the question of what happens if it doesn&#x27;t arrive, or if it takes a minute for it to arrive, or if it arrives but with a faulty status code.
评论 #25510701 未加载
评论 #25509005 未加载
评论 #25509353 未加载
评论 #25514441 未加载
评论 #25509978 未加载
yashapover 4 years ago
As others have noted, seems reasonably similar to LiveView, Livewire and Blazor. I’m somewhat bullish on these approaches - server side rendered monoliths (Rails, Django, etc.) are SO productive, at least for the first few years of development, but lack of interactivity is a big issue, and this solves it well.<p>However, another big issue is the dominance of mobile. More and more, you’ve got 2-3 frontends (web and cross-platform mobile, or explicitly web, iOS and Android), and you want to power them all with the same backend. RESTful APIs serving up JSON works for all 3, as does GraphQL (not a fan, but many are). This however is totally web-specific - you’ll end up building REST APIs and mobile apps anyways, so the productivity gains end up way smaller, possibly even net negative. Mobile is a big part of why SPAs have dominated - you use the same backend and overall approach&#x2F;architecture for web and mobile.<p>I’d strongly consider this for a web-only product, but that’s becoming more and more rare.
评论 #25512236 未加载
评论 #25511804 未加载
评论 #25516035 未加载
评论 #25512301 未加载
评论 #25515831 未加载
评论 #25513907 未加载
评论 #25513516 未加载
评论 #25511826 未加载
mmastracover 4 years ago
What&#x27;s old is new again. I recall ASP.NET had some interesting tech around this in the 2000s where it could dynamically update parts of the page.<p>If I recall correctly, this made use of that new technology of the time called &quot;XMLHttpRequest&quot; (&#x2F;s) which pretty much jump-started web 2.0.
评论 #25508471 未加载
评论 #25508262 未加载
评论 #25509314 未加载
评论 #25509827 未加载
评论 #25510611 未加载
评论 #25513687 未加载
评论 #25508116 未加载
评论 #25513669 未加载
评论 #25509537 未加载
评论 #25513541 未加载
评论 #25514291 未加载
webmavenover 4 years ago
Okay this is a bit meta, but the whole cluster of &quot;everything old is new again&quot;, &quot;the pendulum of fashion has swung&quot;, &quot;nothing new under the sun&quot; takes is ignoring what tends to drive this sort of change: relative costs.<p>The allure of xmlhttprequest was that over connections much slower than today, and with much less powerful desktop computers, a user didn&#x27;t have to wait for the whole page to redownload and re-render (one can argue that focusing on better HTTP caching on the server and client might have been smarter) after every single user interaction. This was also much of the draw of using frames (which were also attractive for some front-end design use-cases later re-solved with CSS).<p>As apps got more complex, clients got more compute, bandwidth grew, and as web audiences grew, offloadingl much of the page rendering to the client helped to both contain server-side costs and increase or maintain responsiveness to user interactions.<p>Now, as desktop client performance improvement slows down (this isn&#x27;t just the slowing of computer speeds, computers are also replaced less frequently), average bandwidth continues to grow, app complexity and sophistication continues to grow, but as server compute cost falls faster than audience size grows, shifting rendering to HTML back to the server and sending more verbose pre-rendered HTML fragments over the wire can make sense as a way of giving users a better experience.
评论 #25514564 未加载
评论 #25515440 未加载
sourc3over 4 years ago
This is so exciting to see, especially for older folk like me.<p>Almost 20 years ago, one of my professors told us before graduation that hot tech is mostly about the idea pendulum swinging back and forth. I immediately chalked it up to 65+ above white wise men snobbery.<p>However, this is exactly that. We started with static pages, then came Ajax and Asp.net and the open source variants, then we went full SPA, now we are moving back to server side because things are too complicated.<p>Obviously tech is different, better, more efficient but the overall idea seems to be the same.
评论 #25510320 未加载
评论 #25510339 未加载
评论 #25510632 未加载
评论 #25511150 未加载
评论 #25511998 未加载
评论 #25512252 未加载
评论 #25511531 未加载
评论 #25510077 未加载
评论 #25513640 未加载
评论 #25512740 未加载
评论 #25510154 未加载
评论 #25509930 未加载
评论 #25510334 未加载
评论 #25509931 未加载
评论 #25510929 未加载
评论 #25509797 未加载
评论 #25510076 未加载
评论 #25510600 未加载
评论 #25509773 未加载
llimosover 4 years ago
It sounds a lot like Laravel Livewire[1]<p>Also a lot like React Server Components that we saw on HN yesterday[2]<p>It seems like this is the next wave of web apps. Hopefully once the hype settles, we&#x27;ll be able to decide which approach is best for which project.<p>[1] <a href="https:&#x2F;&#x2F;laravel-livewire.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;laravel-livewire.com&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=25497065" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=25497065</a>
评论 #25509074 未加载
评论 #25508535 未加载
评论 #25510700 未加载
1f60cover 4 years ago
I wonder how long it will take before we reinvent SPAs?<p>I like Hacker News in part because the tech is so boring. Server-side rendered, static HTML with a minimal amount of JS[0].<p>[0]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;hn.js" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;hn.js</a>
评论 #25509891 未加载
评论 #25539486 未加载
评论 #25510233 未加载
评论 #25511851 未加载
jack_rimintonover 4 years ago
Most of the comments here are along the lines of: this is old tech!<p>But this isn’t really about the tech, it as much a productivity hack that allows people to be much closer to that old fashioned concept of a full stack developer<p>This is what has allowed Basecamp to create Hey with a team just a fraction of the size of their competitors
评论 #25509945 未加载
评论 #25510373 未加载
modernerdover 4 years ago
Pure JS developers trying to jump off the JS train have a few decent choices now:<p>- Elixir &#x2F; Phoenix<p>- .NET &#x2F; Blazor<p>- Laravel &#x2F; Livewire<p>- Rails &#x2F; Hotwire<p>Or hold on for the JS ecosystem to figure out good patterns that balance performance&#x2F;maintainability (React Server Components look ok, and will probably trickle into Next.js for those who want a framework).<p>Does one of the above stand out as a good thing to learn from a career perspective, say, for a JS developer growing tired of frontend?<p>Is the thirst for React developers ever likely to dry up and leave devs who know these frameworks with an advantage?
评论 #25511940 未加载
评论 #25511600 未加载
评论 #25511442 未加载
staticelfover 4 years ago
I love that these new techniques come out to make web dev simple again. I however think Phoenix Liveview is still the best from all the alternatives I have seen so far and that is mainly because Elixir as a language seems to be very stable and suited for having a lot of websocket connections open at the same time.<p>It seems easier to accomplish this with Liveview and perhaps Alpine.js for displaying stuff like modals etc. It&#x27;s a really good way to build applications I think for places that need a server roundtrip anyway which is most of the stuff in a modern app.<p>I write a SPA app for work in javascript and about 90% of the issues that occurs are mainly state issues where the state differs or is in a bad state for some reason. State management is very hard to do right and I think solutions like these simplyfies it a lot!<p>I urge people to check out Elixir and Phoenix Liveview which I think is the &quot;original gangsta&quot; when it comes to sending small updates over websockets and if you try it I will guarantee you will be blown away of the speed of which you can develop web apps as a solo dev.
评论 #25510479 未加载
fuball63over 4 years ago
I read a little about Turbo, not sure I get it, is this like htmx? <a href="https:&#x2F;&#x2F;htmx.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;htmx.org&#x2F;</a>
评论 #25508271 未加载
metta2uallover 4 years ago
Isn&#x27;t this replacing the complexities of JS libraries like react&#x2F;redux-saga with the complexities of these new server-side libraries..? Reduced bundle size looks like a big advantage &amp; this will hopefully encourage the adoption of lighter front-end tech like preact&#x2F;inferno&#x2F;svelte. But the downside seems to be more resource consumption on the back-end, especially if using websockets, and so higher cost &amp; more vulnerability to a DDOS? Also, what about offline support?
评论 #25512823 未加载
评论 #25513492 未加载
corytheboydover 4 years ago
I get the feeling it will draw a bit of criticism from this crowd. IMO it’s fine to experiment with tech like this, but I have to wonder where sending HTML fragments over Websockets instead of HTTP falls apart.<p>Curious to hear about the success&#x2F;horror stories in a few months&#x2F;years from any adopters :)
评论 #25508187 未加载
评论 #25508200 未加载
评论 #25508644 未加载
rajangdavisover 4 years ago
A few years ago, I had this bright idea of updating a site I maintained to be a single page application (SPA). I was very inspired by this site (<a href="https:&#x2F;&#x2F;pocketjavascript.com&#x2F;blog&#x2F;2015&#x2F;11&#x2F;23&#x2F;introducing-pokedex-org" rel="nofollow">https:&#x2F;&#x2F;pocketjavascript.com&#x2F;blog&#x2F;2015&#x2F;11&#x2F;23&#x2F;introducing-pok...</a>) and thought it would make the user experience a lot better by making the site easier to navigate.<p>I preloaded data such that a user could navigate via search or clicking through some drill-down menus without having to wait for a full page refresh. The data would hydrate the views so that the transition time between views was almost always fast, even on slow mobile traffic.<p>One aspect that was very difficult to figure out was incorporating views that would require more data from the server. Once a user drilled down to such a view, the challenge became how to load the view via AJAX without having to make another AJAX call to load more data.<p>The solution was to return server side rendered HTML instead of JSON...<p>Looking at the demo, this seems very similar to some of the things I had to do minus 95% of the hacky Angular&#x2F;PHP code I had to set up.<p>This is a killer feature to have in Rails and I am looking forward to learn more of the conventions that will surround the implementation.
评论 #25511868 未加载
jstummbilligover 4 years ago
The crucial missing piece in this and LiveView, Livewire, etc is optimistic handling of client-side updates. It is not okay standard behaviour to have to wait a roundtrip to visually add a todo list item on the client.<p>Afaik Meteor is the only major full-stack framework handling this. Any other takers?
评论 #25516327 未加载
OJFordover 4 years ago
&#x27;HTML over the wire&#x27; is an unfortunate tagline, but it does actually seem interesting, I&#x27;d suggest looking at the &#x27;Turbo&#x27; docs before reacting.<p>I have thought in the past I wish I could have a frameworky component-style frontend, but where the component is HTML rendered by my rust (or whatever) backend. This would seem to get me a lot closer to that.
评论 #25510980 未加载
fergieover 4 years ago
Gentlemen, we have come full circle.
评论 #25511172 未加载
评论 #25508866 未加载
评论 #25509469 未加载
评论 #25508748 未加载
codethiefover 4 years ago
In case anyone from Basecamp sees this thread:<p>The introductory video is far too long, far too technical (I know a lot about web dev but don&#x27;t know a lick of Ruby or Rails) and far too fast to follow. I was really interested in Hotwire because of the comments here and now… not so much anymore.<p>(Which of course doesn&#x27;t say anything about the quality of the tech. I just thought I&#x27;d post my first impression of the website.)
评论 #25514595 未加载
评论 #25511633 未加载
评论 #25512022 未加载
lxeover 4 years ago
These folks literally invented Ruby on Rails and were building web applications for over 20 years now. This tech seems &quot;old&quot; but it&#x27;s solid.
mfbx9da4over 4 years ago
Products like Slack, Figma and VSCode will not benefit from this kind of technology. Get off of your old school horse. Not all websites are just websites. Performance is not determined solely by load time.
tarsingeover 4 years ago
This is exciting! I am less convinced by the Stimulus part though. I currently prefer the Htmx (ex Intercooler) + AlpineJS combo, or VueJS components sprinkled into views for heavier stuff (setup is a bit tricky but then it’s very easy to enhance views with augmented html). Am I missing something?
评论 #25509920 未加载
dorkandstormyover 4 years ago
Am I the only one who was very, very surprised when the screencast immediately jumped into Rails? There&#x27;s no mention of Rails anywhere on the landing page.
评论 #25511334 未加载
评论 #25513215 未加载
somurzakovover 4 years ago
Sounds like Phoenix LiveView. I love phoenix &lt;3
ashton314over 4 years ago
Can someone familiar with this please diff it with Phoenix LiveView?<p><a href="https:&#x2F;&#x2F;github.com&#x2F;phoenixframework&#x2F;phoenix_live_view" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;phoenixframework&#x2F;phoenix_live_view</a>
评论 #25516242 未加载
naikrovekover 4 years ago
amazing. This used to be called &#x2F;cgi-bin&#x2F; with templates and XMLHttpRequest (a Microsoft invention initially supported only in IE then adopted by everyone) and now it&#x27;s suddenly a new technology&#x2F;approach but with a new name so you&#x27;re not ridiculed for using it?<p>I gotta give them credit for revisiting server-side page assembling though; moving application logic and templating mostly to the front end was a HUGE mistake. JS is very fast now, but it&#x27;s still absolutely glacial in its speed compared to server-side code written in compiled languages.
评论 #25509437 未加载
评论 #25509363 未加载
elamjeover 4 years ago
This is the Ruby on Rails version of what Elixir Phoenix Live View and .NET Blazor do.<p>For those not familiar, rather than using a standard web framework where a lot of processing is done client side, these frameworks allow html buttons etc to call native Ruby, C#, or Elixir functions on the server rather than using some sort of post&#x2F;get request to do that. Every UI interaction goes over the wire, which is where performance can be hurt.<p>Having used Blazor in production for nearly a year, it speeds up development, but your server is doing a lot more processing and will not be able to handle an equivalent amount of users that a normal web app would because it’s keeping a copy of the clients DOM in memory. It’s updates the dom on the server then streams that update through websockets to the clients dom, creating your magic Single Page App experience.<p>I think it’s cool tech, but not necessarily scalable due to the increased server load. I’d be interested to hear from people using it to serve large orders of magnitude of clients at once.
评论 #25508468 未加载
评论 #25509232 未加载
评论 #25509809 未加载
评论 #25508402 未加载
评论 #25509009 未加载
评论 #25508347 未加载
ghego1over 4 years ago
A while ago, way before SPA were cool and even AngularJS was around, I had done something sort of like this, based on Ajax calls though, so the underlying tech was definitely different.<p>While this is truly clever and being based on sockets does seem to simplify communications between client and server, I&#x27;m not fully convinced.<p>Currently I see client side rendering as a way to delegate some computing to the clients. Which is a nice way to lower operating costs.<p>I can see the benefit of this and the reasoning behind it. Because SPA still need a server (serverless still implies server side coding) as long as you are executing code on the client you need two codebases. One for the client, one server side.<p>With this solution it would seem that it&#x27;s possible to serve a web app with only one codebase, so that&#x27;s definitely a plus. But then performance and costs do preoccupy me a little.<p>Perhaps the ideal scenario for this tech would be for (enterprise) apps to be deployed on proprietary servers, where scale is a minor concern.
评论 #25508988 未加载
dperfectover 4 years ago
Is this the &quot;new magic&quot; that DHH teased on Twitter, or are we still waiting to see what that is? Also, should we expect this to be included in a future version of Rails?<p>My first impression is that the API seems a little convoluted, but that might just be me. In an ideal world, I&#x27;d love to just build components (similar to React components) on the server side, and let the framework intelligently handle synchronizing state over the network (Phoenix LiveView seems closer to that), but this feels like it involves a lot more framework-specific logic (and markup) with special cases - stuff that&#x27;s likely to change as the framework evolves, so I&#x27;m not sure how I feel about it.<p>I guess it makes sense in terms of making this easier to add to an existing rails app incrementally (since it&#x27;s more-or-less &quot;opt-in&quot; for each model, view, and controller), but if I&#x27;m building a new project with this and want it on everything, it feels like it will necessitate a lot of code duplication. Either that, or I use it judiciously only when absolutely needed (and use traditional rails behavior for everything else), but that feels like a mess of two very different approaches bundled together in one codebase.
评论 #25508965 未加载
评论 #25511984 未加载
评论 #25511722 未加载
dmitriidover 4 years ago
Without reading the details, LiveView in Phoenix (Elixir) sends HTML&#x2F;DOM updates only. Hotwire sounds pretty similar (and it&#x27;s a good thing IMO)
grumpleover 4 years ago
This is a continuation of existing Rails ideas: &quot;This is a conceptual continuation of what in the Rails world was first called RJS and then called SJR, but realized without any need for JavaScript. The benefits remain the same&quot; [1]. So if this doesn&#x27;t wow you, that&#x27;s why; Rails already largely can do this, but you have to write some javascript yourself. This does seem simpler for the toy example. I&#x27;m curious as to how it works with nested templates, there are no examples for it that I noticed.<p>1. <a href="https:&#x2F;&#x2F;turbo.hotwire.dev&#x2F;handbook&#x2F;introduction" rel="nofollow">https:&#x2F;&#x2F;turbo.hotwire.dev&#x2F;handbook&#x2F;introduction</a>
paxysover 4 years ago
It&#x27;s hilarious that web servers rendering HTML and sending it to the browser over a TCP connection is now &quot;cool new tech&quot;.
评论 #25508258 未加载
评论 #25509397 未加载
评论 #25508420 未加载
评论 #25509060 未加载
danjacover 4 years ago
So far, this looks very much tied to some Rails gems : documentation for installing outside of Rails is pretty much non-existent, I guess to be expected for a beta. My issue with Turbolinks&#x2F;Stimulus is really that it&#x27;s developed pretty much behind closed doors at Basecamp and we maybe get a shiny new release every few years, instead of being developed as a more open source project with incremental improvements and input from a wider group of contributors with diverse needs and insights than one small team at one company.
评论 #25513188 未加载
z3t4over 4 years ago
I think the complexity&#x2F;level is too high. You could easily do the chat from the example video in vanilla JavaScript with a Node.js server and Websocket, that would also be faster and smaller.<p>The video was however a great tutorial, although a bit too fast. (I had to pause and replay a few times). But it did not sell me on the concept.<p>A more simple approach would be to send a (head) request to the server every 5 second asking if the source&#x2F;HTML&#x2F;state has changed. Then do a sophisticated diff&#x2F;replace of the DOM (like in React, but without React) making the smallest change to the DOM as possible (only change what was updated). eg. no full page refresh, nor iframes. (and also send a diff over the wire, not the full page).<p>If you would make the app fully functional&#x2F;pure you would then be able to cache many states (input-&gt;output) and predict them on the client and prefetch, for example a link click, would instantly do the DOM&#x2F;diff and update the page with the new content. For example in a tic-tac-toe game you could pre-render all states and have the client pre-fetch them.
sdevonoesover 4 years ago
Is this a joke? What&#x27;s new about sending HTML over a TCP connection?
评论 #25508664 未加载
评论 #25508306 未加载
poisontaover 4 years ago
It took a decade for the industry to realize that JS frameworks were overhyped and the degraded productivity because of them was not worthy. I think they will be replaced by Hotwire-like technologies in the next decade.<p>The same thing will happen to micro services (especially, distributed monolith) and Kubernetes. They are just overhyped.<p>Productivity matters most!
评论 #25510927 未加载
评论 #25510840 未加载
kevlar1818over 4 years ago
As a non web developer, writing less JS appeals to me, and I&#x27;ve found HTMX[1] to be simple to use. I&#x27;ll add that the HTMX website&#x2F;docs are much more approachable than this site.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;bigskysoftware&#x2F;htmx" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bigskysoftware&#x2F;htmx</a>
ivanhoeover 4 years ago
Laravel&#x27;s crew had a very similar idea with Livewire (even the name sound similar, probably not intentionally) and it also created a lot of buzz back when it was released - but I don&#x27;t think it really got past &quot;let&#x27;s play with it a bit&quot; step for most of teams. We&#x27;ll see how well this one does...
zemnmezover 4 years ago
from a security engineer&#x27;s perspective, these things seem great, but ultimately become really tricky where DOM nodes need to be produced safely. string concatenation doesn&#x27;t cut it for obvious reasons, then you have mXSS from mismatches between the backend server and the browser&#x27;s interpretation of the HTML
a-dubover 4 years ago
Chiming in like all the other old farts...<p>This is how I used to build web apps 20 years ago! :)<p>Render all HTML on the server side using a lightweight templating engine, make page loads fast and make all interactions reload the current page avoiding all client side JavaScript for validation and logic. (except for hotkeys for quick nav)
danjacover 4 years ago
After playing for some hours with the new Turbo on a side project (with Django as backend), it mostly works fine.<p>One thing that is kind of broken out of the box is form submissions: so a common pattern with server side rendering is to re-render the form with validation errors, but otherwise redirect to wherever.<p>The workaround here I think is to use turbo-streams and just re-render the invalid form HTML snippet rather than the whole page. While this is probably ok for most cases, I have some forms (3rd party library stuff) where this is going to be more work than I&#x27;d like, and due to a bug in the beta release you can&#x27;t override the default form submission behavior - Turbo throws an error if a form POST returns anything other than a redirect. So it&#x27;s probably not quite ready for production yet.
saltcodover 4 years ago
This all seems super cool, but mega complicated. I&#x27;m not in the Rails ecosystem at all, so would love someone&#x27;s assessment.<p>Is this a new, giant complexity or a nice add-on? A huge mental&#x2F;development shift or a nicely paved new path to something better?
评论 #25508989 未加载
评论 #25509174 未加载
评论 #25509323 未加载
评论 #25509557 未加载
评论 #25512879 未加载
评论 #25509112 未加载
rubyfanover 4 years ago
This is sort of ironic because many years ago what caused me to move functionality to client side was the fact that Ruby on Rails was slower on server side and required horizontal scale and things like memcached to meet my demands.
评论 #25510452 未加载
esroyoover 4 years ago
Generally people argue that static HTML is more <i>energy efficient</i> than server side rendering. I wonder If that is true in the case of static HTML &quot;that loads an SPA&quot;, versus a server-side rendering with a proper cache in place. The SPA loading will still consume good energy on each client computer. Would love to see some numbers. Lots of hype, lots of projects and approaches, and lots of opinons about what is more convenient, but few numbers measurements of resources (space, time, what more?). May be It silly me, and the difference in energy terms is irrelevant.
评论 #25514476 未加载
benatkinover 4 years ago
I&#x27;m currently more interested in processing content as JSON serializable abstract syntax trees, whether it comes from Markdown, HTML, or something else. The popular Markdown renderer Remark (<a href="https:&#x2F;&#x2F;remark.js.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;remark.js.org&#x2F;</a>) supports this. It&#x27;s based on Unified.js which has markdown abstract syntax trees (mdast) and HTML abstract syntax trees (hast). <a href="https:&#x2F;&#x2F;unifiedjs.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;unifiedjs.com&#x2F;</a>
umaarover 4 years ago
Two points on client-side JS have been a constant for me for many years:<p>- Noticed excessive JavaScript contributes to poor web performance - Things cause JS to break, which breaks other interactivity, often I end up using incognito<p>During lockdown, I struggled ordering groceries because 20 seconds of JavaScript execution on the main thread made my &quot;delivery slot&quot; expire!<p>Similar to heydonworks.com stating &quot;Please disable JavaScript to view this site&quot;, I&#x27;m glad Hotwire is encouraging folks to think about things a little differently.
ausjkeover 4 years ago
SPA moves all the routing&#x2F;templating to the browser side.<p>server side rendering does it all on the server and spits out html(legacy cgi style)<p>between these two: static html template downloaded from the server, then use ajax to update json in the html pages, which is the old boring way but it might still be the best middle ground?<p>Unless I need make a desktop complex GUI program where SPA could be a reasonable choice, I will just do the html&#x2F;ajax old way, not fully geared towards to server or client side rendering, life is much easier.
wdiamondover 4 years ago
I didnt see html, just ruby bindings. Anyone can make easy bindinds on server but it costs flexibility on components, imagine for deep nested levels customized components and syncing.
cs510over 4 years ago
I&#x27;m a big fan of pure HTML pages because of performance and simplicity, but the techniques presented here are neither of those.<p>For performance, server-side rendering is just bad. It won&#x27;t scale to high volume traffic, cost too much money and is complicated to maintain. Hosting a static HTML files is more performant than that.<p>For simplicity, the current protocol relies on so much &quot;magics&quot; to give the impression of simplicity. I think that&#x27;s just an illusion of simplicity.
评论 #25512072 未加载
iamleppertover 4 years ago
I prefer to send updates to my web application as bitmaps. I do all the rendering of the HTML on the server to an image and just loop over the pixels and send a pixel if something changes from the last update. I call these updates “frames” and the client can even gracefully degrade — it can request a certain frame rate, or I can only send the luminosity value of a pixel, or randomly sample pixels to reduce detail for poor connections.
jessehattabaughover 4 years ago
As a web developer 20+ years, I&#x27;m just happy to see how much job security I have since none of you are smart enough to manage a React app and Webpack config.
评论 #25512968 未加载
评论 #25513203 未加载
ilakshover 4 years ago
Is the basic idea that you only transmit the new content when they click a link? Rather than a JavaScript application rendering it?<p>So it&#x27;s effectively similar to just a normal HTML page, but without things like headers and sidebars etc. being retransmitted?<p>I guess I am old but I don&#x27;t understand why this requires a multi-million dollar marketing effort and all of the other stuff they invented on top of it.
stanislavbover 4 years ago
For those interested in the source code, here they are the repost of the mentioned tech:<p>- Turbo (HotWire) <a href="https:&#x2F;&#x2F;github.com&#x2F;hotwired&#x2F;turbo" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hotwired&#x2F;turbo</a> - Stimulus <a href="https:&#x2F;&#x2F;github.com&#x2F;hotwired&#x2F;stimulus" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hotwired&#x2F;stimulus</a>
phaedryxover 4 years ago
I wish they&#x27;d document how to write tests for this stuff. Also, I wish they&#x27;d provide an example with multiple moving parts.
评论 #25510259 未加载
still_grokkingover 4 years ago
Likely an unpopular opinion. But anyway. I think the presented thingy is fundamentally wrong.<p>It&#x27;s just another attempt to put the square peg in a round hole.<p>The point is: &quot;The web&quot; is not, and never was, a framework for application development! It&#x27;s the wrong tool. No matter how hard you try.<p>You want to build applications? Use tools that where build from the ground up to support application development.<p>On mobile people realized mostly by now that &quot;native&quot; is the way to go. Because native apps are superior along any dimension compared to &quot;web-apps&quot;. The same is <i>of course</i> true on the desktop.<p>Mature and full featured technology to build &quot;native&quot; cross desktop applications exists since forever. Just have a look at great tools like IntelliJ IDEA or Bitwig Studio for example.<p>Hotwire on the other hand is just another try to misuse &quot;the web&quot; as an application development platform. It&#x27;s closer to what the web actually is (namely HTML pages) but it&#x27;s still wrong on the fundamental level (as it tries to build an app framework on top of something that was meant to be <i>only a hyper-text system</i>).<p>Let&#x27;s see how long it&#x27;ll take until people realize this truth - and we&#x27;re really full circle.
评论 #25513476 未加载
评论 #25513663 未加载
评论 #25513371 未加载
评论 #25513377 未加载
评论 #25513427 未加载
thomas-guettlerover 4 years ago
I looked at several html-over-the-wire frameworks during the last weeks and wrote down my opinionated perspective.<p>I think I will go with htmx.<p>If you want to know more: <a href="https:&#x2F;&#x2F;github.com&#x2F;guettli&#x2F;html-over-the-wire" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;guettli&#x2F;html-over-the-wire</a>
korijnover 4 years ago
I chuckled when I read &quot;traditional singe page application&quot;. Anyone else share the sentiment?
mshenfieldover 4 years ago
The downside is that this makes it really easy for developers to avoid making an actual API. The turbo frames _are_ the API. Great to bootstrap, but miserable if you ever want to implement a native mobile app (or any other client) on top of the same codebase.
评论 #25543092 未加载
jarymover 4 years ago
I won&#x27;t say this is a step backwards in terms of progress but it is a step back to the way things used to be done in the early days of Ajax - albeit with a slightly more modern approach.<p>It is appropriate for some applications and not for others. That&#x27;s just my view.
评论 #25508124 未加载
warpechover 4 years ago
Not to be confused with Turbo by Yandex: <a href="https:&#x2F;&#x2F;yandex.com&#x2F;dev&#x2F;turbo&#x2F;index&#x2F;" rel="nofollow">https:&#x2F;&#x2F;yandex.com&#x2F;dev&#x2F;turbo&#x2F;index&#x2F;</a>, which is a competitive take on Google AMP.
w_t_payneover 4 years ago
Reminds me of HTMX
bcheungover 4 years ago
What are the pros and cons of this technique? Seems like this pushes a lot of the rendering compute power from the client to the server. I guess that is good for low power devices but now you need more powerful servers?
steve_taylorover 4 years ago
We stopped doing this ten years ago because it tightly coupled the front- and back-ends and made it almost impossible to insert an API for mobile apps after the fact.
edwinyzhover 4 years ago
I guess this is similar to htmx.org (was intercooler.js) which I like a lot! Will learn more about it later and I&#x27;m glad similar idea is getting more popular!
mikerg87over 4 years ago
Am I wrong to think this is like unpoly except it uses web sockets ?<p><a href="https:&#x2F;&#x2F;unpoly.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;unpoly.com&#x2F;</a>
kaleidawaveover 4 years ago
There will be a very <i>hot wire</i> when I have to ask the server to render a component on the server after I asked to increment a single counter
评论 #25508943 未加载
lenkiteover 4 years ago
Intercepting clicks on all anchors and then <i>replacing</i> the body is something the <i>browser</i> should do and not the javascript library.
asymmetricover 4 years ago
&gt; The heart of Hotwire is Turbo. A set of complimentary techniques for speeding up page changes and form submissions<p>s&#x2F;complimentary&#x2F;complementary
CyanLite4over 4 years ago
They’re (poorly) trying to emulate Blazor Server.
nlhover 4 years ago
Gotta give @dhh credit - he is one of the world&#x27;s great marketers&#x2F;promoters. He&#x27;s been building hype for this as the &quot;next Rails&quot; for months and the man knows how to pique an audience&#x27;s interest.
_verandaguyover 4 years ago
Is this just PHP templating with extra steps?
评论 #25543117 未加载
brtkdotseover 4 years ago
This sounds a lot like server-hosted Blazor, streaming HTML snippets though websockets. Am I understanding it correctly?
评论 #25511867 未加载
clementmasover 4 years ago
What&#x27;s the browser support for Turbo? It uses the History API, fetch, AbortController, etc.<p>So Edge 16+, Safari 12.1+, FF 57+?
neyaover 4 years ago
Could anyone explain what is the difference between this and LiveView from Phoenix&#x2F;Elixir world?
bird_monsterover 4 years ago
I hate javascript as much as the next person, but when I had to step into .erb templates and regress back into javascript-as-&lt;script&gt; blocks in HTML, holy crap did I realize how far the FE landscape has come. Watching the Turbo demo, I cannot fathom going back to erbs.<p>It seems like DHH is just trying to make relevant tooling without writing Javascript, which I guess is fair, but given all of the advancements in all of the other tech, this really just does not seem like a good idea to me.
nonsapreicheover 4 years ago
Hyper Text was a very good way to link knowledge, but the Markup Languge evolved in the opposite way
poxrudover 4 years ago
I&#x27;m curious how this is different from Turbolinks, which was been available since rails 3.
评论 #25510357 未加载
评论 #25510178 未加载
shrimpxover 4 years ago
Where does this fit with the recently hot SSG&#x2F;SSR projects like Gatsby and Next.js?
supernihilover 4 years ago
Lol. I made something similar: gihub.com&#x2F;sloev&#x2F;cccp<p>As in sssr as in semi server side rendered
alunchboxover 4 years ago
How do they intent to not have &quot;Send massive files without using other apps&quot; being abused? Isn&#x27;t this one of the key reasons to use a separated system.<p>I can see this becoming a big problem on their ecosystem if it starts to scale it&#x27;ll start to be very costly.
评论 #25512149 未加载
elchiefover 4 years ago
wasn&#x27;t this called Hijax back in the day?<p><a href="https:&#x2F;&#x2F;domscripting.com&#x2F;blog&#x2F;display&#x2F;41" rel="nofollow">https:&#x2F;&#x2F;domscripting.com&#x2F;blog&#x2F;display&#x2F;41</a>
fzzzyover 4 years ago
Hehe. I did exactly this in Twisted Woven LivePage in around 2002.
newsbinatorover 4 years ago
I&#x27;d like to try a version of this outside of Ruby&#x2F;Rails.
评论 #25512795 未加载
antoineMoPaover 4 years ago
The downside of this is very high coupling between the frontend and the backend. However, many companies have been successful with strong coupling to Rails so maybe it&#x27;s not a problem.
评论 #25509337 未加载
评论 #25509320 未加载
评论 #25509307 未加载
thomas-guettlerover 4 years ago
Htmx is boring. That&#x27;s why I like it.
aabbcc1241over 4 years ago
Similar to intercooler.js and LiveView?
PanosJeeover 4 years ago
Would love to see a plugin for NextJS
underdeserverover 4 years ago
Laugh all you want but the hey.com website loads wicked fast.
评论 #25509411 未加载
评论 #25511206 未加载
kurkoover 4 years ago
You had me on &quot;Oops&quot;
joelbluminatorover 4 years ago
Hotwire sells like hot cakes!
pantulisover 4 years ago
15 years ago RoR went against the bloated Java enterprisey frameworks, and after being dormant for some years now it&#x27;s the time against SPAs.<p>Time will tell --I&#x27;m not so bullish on Hotwire-- but one has to admire figures the likes of DHH that can almost single handedly change the status quo of the industry.
coroboover 4 years ago
Honestly couldn&#x27;t tell if DHH&#x27;s initial tweet was satire like vanillajs<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;dhh&#x2F;status&#x2F;1341420143239450624" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;dhh&#x2F;status&#x2F;1341420143239450624</a>
OOPManover 4 years ago
Is this real?
heidarover 4 years ago
For those unaware, this is the &quot;new magic&quot; that dhh has been on about since HEY was in beta.
tecnocriolloover 4 years ago
Like old fashioned PHP
rubyist5evaover 4 years ago
Is this the Hot New Magic DHH was hinting at?
mdomsover 4 years ago
Spoiler, it&#x27;s just Ajax but it pushes the data through your templates before sending it to the client. We were doing this literally over a decade ago in the early days of XHR.
评论 #25509751 未加载
评论 #25510409 未加载
评论 #25511068 未加载
评论 #25509982 未加载
评论 #25632025 未加载
JeremyBanksover 4 years ago
This kind-of tangential reply is in bad taste, but DHH is currently being an asshole about <i>this very topic</i> on Twitter, so:<p>This seems cool, but the progress that HEY has made since launch isn&#x27;t very impressive if that&#x27;s the flagship example.<p>HEY&#x27;s search UX, which uses these capabilities, has been <i>abysmal</i> since the day it launched. It&#x27;s a much better experience if you disable JavaScript&#x2F;Hotwire and fall back to the server-side-rendering instead of the hybrid mess they push down. I&#x27;m very disappointed that this hasn&#x27;t been improved. (I sent feedback about this while they were still in their invite-only phase.)<p>We were also promised custom domain support by the end of the year, and we don&#x27;t have a timeline or even pricing yet. (That&#x27;s obviously backend and unrelated to this announcement.) I don&#x27;t want to go back to Google, but the lack of improvement isn&#x27;t giving me a lot of confidence as a HEY customer, so I&#x27;m considering alternatives.
评论 #25508313 未加载
评论 #25509019 未加载
goshxover 4 years ago
Next year they&#x27;ll come up with hosting your websites on your own bare-metal.
johnghanksover 4 years ago
i don&#x27;t get it. isn&#x27;t this just traditional SPAs but worse and more limited in basically every way?
Nijikokunover 4 years ago
Sigh, this is already what modern frameworks do.
picturover 4 years ago
Hype hype hype hype...
deltron3030over 4 years ago
My first thought was that some dude is ripping off LiveWire and Turbolinks because of the strange centered text (no professional web designer would do that), until I saw that those were renamed evolutions of those technologies from Basecamp, cool!.