Live data from Hacker News

Hotwire: HTML over the Wire

hotwire.dev

261–270 of 573 posts

Re: Hotwire: HTML over the Wire

#261
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 cyclical. 10 years from now I expect to read about something "new" only to realize that it was something old.

Re: Hotwire: HTML over the Wire

#262
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 (https://pocketjavascript.com/blog/2015/11/23/introducing-pok...) and thought it would make the user experience a lot better by making the site easier to navigate.

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.

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.

The solution was to return server side rendered HTML instead of JSON...

Looking at the demo, this seems very similar to some of the things I had to do minus 95% of the hacky Angular/PHP code I had to set up.

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.

Re: Hotwire: HTML over the Wire

#263
post #15

It sounds a lot like Laravel Livewire[1] Also a lot like React Server Components that we saw on HN yesterday[2] It seems like this is the next wave of web apps. Hopefully once the hype settles, we'll be able to decide which approach is best for which project. [1] https://laravel-livewire.com/ [2] https://news.ycombinator.com/item?id=25497065

Caleb Porzio (creator of Livewire) made videos about "Server-Side Applications": https://laracasts.com/series/javascript-techniques-for-serve... His work inspired me to build my app (TravelMap) with SSR views: https://clem.travelmap.net

Off topic from the main thread, but Travel map looks really good. Reminds me of all the travel blogs I used to read when I was in high school / college dreaming about getting out and exploring the world. Great work!

Re: Hotwire: HTML over the Wire

#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 simplicity. I think that's just an illusion of simplicity.

Re: Hotwire: HTML over the Wire

#266
post #87

Earlier quoted context omitted.

Any idea how many people use Hey.com? That might be an early indication as to how scalable this is (at least for hotwire's concerns)

Well Rails was never not scalable in literal sense. It was just the cost of scaling being expensive; comparatively speaking when people say Rails not able to scale. And for most if not all SaaS that should never be much of a problem. Because you are getting revenue per user, and generally speaking the cost percentage of user / app / server resources is so small, that is a rounding error in grand scheme of things. Wha…

I always find the Rails/scalable thing to be a funny argument - especially on the startup-minded HN.

You don't need scale at a startup. You need velocity. If you're hitting scale at a startup, you've done one of two things:

* Written absolutely terrible software

* Succeeded

Unless you've hit the second one, it will almost always be cheaper to simply spin up another server.

Re: Hotwire: HTML over the Wire

#267

Earlier quoted context omitted.

You went to a school with professors and dismissed their final advice to you as "65+ above white wise men snobbery"? Which part of that is supposed to be a reasonable thing to say?

Lol so did I. Ageism is a thing, and it's everywhere. At least when you're young, you don't have the excuse of already having been in the other age class. That being said, several of my older professors were entirely full of snobby shit. The older I get, the more I see how they were not trying to impart knowledge, but to gain some kind of status as "hard-ass" old men with the younger generation.

Nobody is doing what they claim. It's all ego and posturing. I'm getting tired of humanity.

Re: Hotwire: HTML over the Wire

#268
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’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.

> The last 10 years of JavaScript on the client have been an utter shit show

A fair number of people would disagree. I'd say it's advanced a lot, considering the limited role of JavaScript on the client in the past.

Re: Hotwire: HTML over the Wire

#270
Two points on client-side JS have been a constant for me for many years:

- Noticed excessive JavaScript contributes to poor web performance - Things cause JS to break, which breaks other interactivity, often I end up using incognito

During lockdown, I struggled ordering groceries because 20 seconds of JavaScript execution on the main thread made my "delivery slot" expire!

Similar to heydonworks.com stating "Please disable JavaScript to view this site", I'm glad Hotwire is encouraging folks to think about things a little differently.

Post reply on HN