Live data from Hacker News

Hotwire: HTML over the Wire

hotwire.dev

391–400 of 573 posts

Re: Hotwire: HTML over the Wire

#392
post #134
post #74

Spoiler, it'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.

The goal is to have a productive set of patterns for the programmer to follow for dynamic updates. Less boilerplate. More reuse. Consolidation of app state to the server. Feel free to post your code from a decade ago so that we can do a bake-off and compare implementations side-by-side.

Look at any of Wicket 1.4's Ajax examples (bonus if you use a better JVM language to reduce the boilerplate - I was using Scala). It's a great technique, it works great, I'm just slightly salty that the industry felt the need to switch to JS SPAs for, as far as I could see, very little tangible advantage.

Re: Hotwire: HTML over the Wire

#393
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…

I completely agree with this. For reference, I'm a relatively new developer - 3.5+ years of experience in my first developer position. At the beginning of college everyone was SUPER into NoSQL. All my friends were using it, SQL was slow, etc. Nearing the end of college and the beginning of my job I began seeing articles saying why NoSQL wasn't the best, why SQL is good for some things over NoSQL, etc. Technology is c…

The funniest part is seeing companies jump onto the distributed NoSQL bandwagon with their fundamentally relational and transactional data structures and then reinvent the transactional relational database.

Re: Hotwire: HTML over the Wire

#394
post #246

Earlier quoted context omitted.

Yes, I’m curious how hard it is to get this working with a different backend stack. I’d love to have this in Go.

Getting turbo is trivial on any backend. Just include the js. Stimulus is also not any different from any other javascript you'll write. There's no need for any kind of scaffolding from the backend stack except for some features - and those aren't particularly hard to implement either. Source: Using Turbolinks & Stimulus js with Django.

Thanks, I need to read up more on it. When I look at the rails code, I see a lot of nice convenience capabilities in the template definitions and rendering.

Re: Hotwire: HTML over the Wire

#395
post #242

Earlier quoted context omitted.

If you type a chat message in your browser, how does it automatically show up in my browser with XMLHttpRequest?

In old school chat rooms, this was usually done by polling for new messages every X seconds, or doing a refresh / reload of an IFrame containing the chat.

I know, I wrote many of those, it’s a much worse solution than this.

Re: Hotwire: HTML over the Wire

#396
post #355
post #242

Earlier quoted context omitted.

If you type a chat message in your browser, how does it automatically show up in my browser with XMLHttpRequest?

Long Polling is how we used to do it. The web page opens a request to the server but the server does not reply. Once the event happens on the server, the server replies to the old request and the client opens a new request.

Yup, this is much better than that, and nicely integrated for you.

Re: Hotwire: HTML over the Wire

#397
post #40
post #4

What'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. If I recall correctly, this made use of that new technology of the time called "XMLHttpRequest" (/s) which pretty much jump-started web 2.0.

My thought exactly, though I fully support that. I often rant about how the modern web is billions of layers of duck tape over duck tape and it has become an unmanageable mess of libraries, frameworks, resources, all while javascript remains the most outrageous and absurd language ever created. I'm by no means a fan of rails or ruby for that matter but I think things like these are a considerably better alternative t…

Oh yeah like the 'new' reddit. It makes even the best machines cry.

Re: Hotwire: HTML over the Wire

#398

Earlier quoted context omitted.

>65+ above white wise men snobbery Nice! Casual ageism and racism mixed into one post.

Conventional wisdom is discrimination against privileged groups such as white men is less offensive because they’ve endured so much less of it. On one hand, it’s true. It’s part of white privilege which is tangible. On the other hand, however less often people in a privileged class are realistically impacted by discrimination, it’s still > 0.0%. Since it usually costs nothing more to include everyone it seems useful.…

> However a powerful argument can be made that not disparaging privileged classes, actually helps us all in the long run/big picture.

The powerful argument is that you should treat everyone well, period, and not do some kind of calculation to decide how cruel you're allowed to be to them.

Re: Hotwire: HTML over the Wire

#399
Likely an unpopular opinion. But anyway. I think the presented thingy is fundamentally wrong.

It's just another attempt to put the square peg in a round hole.

The point is: "The web" is not, and never was, a framework for application development! It's the wrong tool. No matter how hard you try.

You want to build applications? Use tools that where build from the ground up to support application development.

On mobile people realized mostly by now that "native" is the way to go. Because native apps are superior along any dimension compared to "web-apps". The same is of course true on the desktop.

Mature and full featured technology to build "native" cross desktop applications exists since forever. Just have a look at great tools like IntelliJ IDEA or Bitwig Studio for example.

Hotwire on the other hand is just another try to misuse "the web" as an application development platform. It's closer to what the web actually is (namely HTML pages) but it's still wrong on the fundamental level (as it tries to build an app framework on top of something that was meant to be only a hyper-text system).

Let's see how long it'll take until people realize this truth - and we're really full circle.

Re: Hotwire: HTML over the Wire

#400
I hate javascript as much as the next person, but when I had to step into .erb templates and regress back into javascript-as- 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.

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.

Post reply on HN