Live data from Hacker News

Hotwire: HTML over the Wire

hotwire.dev

321–330 of 573 posts

Re: Hotwire: HTML over the Wire

#321
post #126

Earlier quoted context omitted.

Tho, LiveWire is AJAX, while LiveView and Stimulus Reflex are Sockets. LW is a pleasure to work with for small pieces of interactivity.

I believe (but could be wrong) that liveview degrades to http long poll.

It does indeed!

Re: Hotwire: HTML over the Wire

#322

Is this the "new magic" 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? My first impression is that the API seems a little convoluted, but that might just be me. In an ideal world, I'd love to just build components (similar to React components) on the server side, and let the framework intelligently handle synchronizing…

Yes this is the new magic stuff.

But I doubt they'll integrate this into Rails. They'll just create better and better tooling to make using this with rails a cinch.

I think this will just remain backend agnostic, like turbolinks and stimulus were before "hotwire".

Re: Hotwire: HTML over the Wire

#323

Earlier quoted context omitted.

I’m glad this technique is making a comeback. The last 10 years of JavaScript on the client have been an utter shit show that left me wondering wtf people were thinking.

You have the benefit of hindsight at this time. You can draw parallel to history of flight and all the crazy contraptions that people attempted. Great technology can emerge from the combination of numerous shit shows. The whole is greater than the sum of the parts.

Very true. I think that mostly, web dev mainstream has taken a rational path. It’s with the benefit of hindsight as you say, or the yoke of unusual requirements, that people now say ”we did it all wrong”.

Re: Hotwire: HTML over the Wire

#324
post #120

This is so exciting to see, especially for older folk like me. 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. 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 ar…

The Rails people never went for SPAs though. Releasing another server-rendering AJAX thing for rails (previous was TurboLinks) no more represents "the pendulum swinging back" than a new version of COBOL that runs on mainframes represents the pendulum swinging back to mainframes. If this approach gains market share against React etc., then that will be meaningful - but don't hold your breath, there are legitimate reasons for the move to SPAs and also an enormous amount of institutional inertia behind it.

Re: Hotwire: HTML over the Wire

#325
post #196

Earlier quoted context omitted.

The backend here _is_ your frontend. This supports my argument that there is tight coupling.

Between what? Your frontend is serving the html/css/js, that's your frontend. You can have another background service behind it, as many layers as you want. This separation doesn't have to be at the http level.

Let's say you take another approach. Build a backend that serves REST, GraphQL or whatever protocol. This can be a Rails backend, could be Python, JS, whatever. Now you or the frontend team are free to build the frontend with whatever technology.

You can update it more freely to shining new JS frameworks because it is not entirely tied to your backend.

Also, if your client/boss asks you to build a native IOS frontend, you already have built an API, useful no?

Re: Hotwire: HTML over the Wire

#326
Generally people argue that static HTML is more energy efficient than server side rendering. I wonder If that is true in the case of static HTML "that loads an SPA", 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.

Re: Hotwire: HTML over the Wire

#327

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. The same thing will happen to micro services (especially, distributed monolith) and Kubernetes. They are just overhyped. Productivity matters most!

I don't think this is going to happen. Hotwire-like technologies have existed for a long time with turbo-links, adoption is low and it's very unpractical to work with compared to a split backend api + frontend (framework or not as you prefer).

>it's very unpractical to work with compared to a split backend api + frontend

This is just demonstrably false. Both paradigms have areas where they shine. One or the other is not better across the board.

I guess the point of Hotwire is that there isn't pretty much anything you can't do with the "old tech" that you can with the modern javascript CF.

Re: Hotwire: HTML over the Wire

#328

In case anyone from Basecamp sees this thread: The introductory video is far too long, far too technical (I know a lot about web dev but don'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. (Which of course doesn't say anything about the quality of the tech. I just thought I'd post my first impression of the websi…

I agree. the video is terrible, nothing like the original Rails introduction screencast

the tech is dope

Re: Hotwire: HTML over the Wire

#329
post #105

Earlier quoted context omitted.

And here's some additional followup. Minor speculation that maybe his location is what caused slowdown. https://twitter.com/swyx/status/1292825527116369922

That's one of the reasons SPA aren't going anywhere: trying to handle all the user microinteractions on the server is great when you leave next to it, but it falls apart when your users are spread across the world, especially if it's not western-ish world with fast internet connections.

In this non-westernish world the internet is slow but how much processing power do the computers have to render the SPAs?

Re: Hotwire: HTML over the Wire

#330
post #264

I'm a big fan of pure HTML pages because of performance and simplicity, but the techniques presented here are neither of those. For performance, server-side rendering is just bad. It won'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. For simplicity, the current protocol relies on so much "magics" to give the impression of s…

If you can get away with hosting static html files, there's not much else that's more performant.

The comparison is only between server rendered HTML vs backend API + some frontend rendering locally (which is not as performant) and more importantly is a lot more complex to implement technically.

Post reply on HN