Live data from Hacker News

Htmx Is the Future

quii.dev

161–170 of 875 posts

Re: Htmx Is the Future

#161
I tried htmx, but syntax is horrible, so 3 years ago I've created uajax universal Ajax forms and js-ajax-button. Add class to any form and it is ajaxed. I even released it on github

The js-ajax-button has similar approach. Add class to button that have data-url and it will make request to it. This is small func I use, but with uajax is so powerful, I don't need react or htmx.

But it is hard to sell something that eliminates using javascript.

Re: Htmx Is the Future

#162

Earlier quoted context omitted.

HTML gives very limited tools for tracking what a (potentially JS-less) user is doing. There are various tricks, like "link shorteners" and "magic pixels" that allow some tracking. But if you want advanced tracking, like tracking what a user is focusing on at a particular instant, you need to wrap the whole document in a lot of JS. SPA frameworks came out of AdTech companies like Meta, and I assure you it wasn't beca…

This is not correct. SPAs and web components were pioneered by Google with the introduction of Angular. Later, Vue was invented by a previous Google employee who had worked on Angular. Finally, Facebook came up with React (it's a "reaction" to Angular) because they could not be seen using a Google product. If anything, SPAs make metrics harder because they hide the real behavior of the page in local JS/TS code and do…

React was significantly better than Angular (version 1).

Please don't pretend it was merely NIH syndrome that led to its creation.

Re: Htmx Is the Future

#163
Basecamp ( or Hey or guys behind ror ) , the original SAAS guys really do understand software development from practical point of view, they did something similar with rails as well as native clients, now a days they are trying people to move away from cloud. Bare metal is the future.

Re: Htmx Is the Future

#164
I agree with this article, however I think that HTMX needs a strong server framework to support HTMX. I've thought about this alot and a couple months back created this deno / typescript framework https://github.com/reggi/htmx-components, would love for people to take a look at it and provide guidance and direction for a releasable version.

Re: Htmx Is the Future

#165
post #98
post #92

Earlier quoted context omitted.

I mean, there's nothing about an SPA that forces you to break the back button, to the contrary, it's possible to have a very good navigation experience and working bookmarks. But it takes some thinking to get it right.

I don’t think “forces” is the right way to think about it. By default a SPA breaks navigation history etc (it’s right in the name). It’s not onerous to reimplement it correctly but reimplement you must.

No it doesn't and no you don't. Every modern SPA framework has solved that problem long ago.

Re: Htmx Is the Future

#166
The HATEOAS approach is viable for some applications but I wouldn't necessarily call it the future.

Using custom html attributes as the base for complex client-side interactions is arguably a step backwards when considering the story around maintenance.

Right now, if you are building a robust component library - it's much easier to maintain using a template language with strong Typescript / IDE support, like JSX or similar.

Re: Htmx Is the Future

#167
post #3

It's kinda funny to me that many of the "pros" of this approach are the exact reasons so many abandoned MPAs in the first place. For instance, a major selling point of Node was running JS on both the client and server so you can write the code once. It's a pretty shitty client experience if you have to do a network request for each and every validation of user input. Also, there was a push to move the shitty code fro…

> We moved away for MPAs because they were bloated, slow and difficult to work with. SPAs have definitely become what they sought to replace. Plus we now get the benefit of people trying to "replace" built in browser functionality with custom code, either The SPA broke it... Back button broken and a buggy custom implementation is there instead? Check. or They're changing things because they're already so far from def…

> The SPA broke it... Back button broken and a buggy custom implementation is there instead? Check.

MPAs break back buttons all the damn time, I'd say more often than SPAs do.

Remember the bad old days when websites would have giant text "DO NOT USE YOUR BROWSER BACK BUTTON"? That is because the server had lots of session state on it, and hitting the browser back button would make the browser and server be out of sync.

Or the old online purchase flows where going back to change the order details would completely break the world and you'd have to re-enter all your shipping info. SPAs solve that problem very well.

Let's think about it a different way.

If you are making a phone app, would you EVER design it so that the app downloads UI screens on demand as the user explores the app? That'd be insane.

Re: Htmx Is the Future

#168

i am the creator of htmx, this is a great article that touches on a lot of the advantages of the hypermedia approach (two big ones: simplicity & it eliminates the two-codebase problem, which puts pressure on teams to adopt js on the backend even if it isn't the best server side option) hypermedia isn't ideal for everything[1], but it is an interesting & useful technology and libraries like htmx make it much more rele…

Complete novice here; what are the advantages of hyperview over something like flutter? I looked at a bunch of frameworks before settling on dart/flutter for my own cross platform projects. I did look at htmx but since I wasn't really wanted to create a web app I moved on. But I like the idea of a true rest style of app.

hyperview uses the hypermedia approach, which means the client and server are decoupled via the uniform interface

so you can, for example, deploy a new version of your mobile app without updating the client, a big advantage over needing users to update their mobile apps

Re: Htmx Is the Future

#169
post #47
post #19

Earlier quoted context omitted.

>Node does not absolve from this. Any important verification still needs to be done on the server side, since any JS on the client side cannot be trusted to not be manipulated. JS on the client side was of course possible before NodeJS. NodeJS did not add anything there regarding where one must verify inputs. Relying on things being checked in the frontend/client-side is just writing insecure websites/apps. Yeah, tha…

The first SPA I wrote, I wrote in React for my use and for the use of friends. I spent about 3 days getting it working and then 3 months getting it to usable performance on my phone. There were no analytics, no binary data (100% text), just a bunch of editable values and such. I ended up having to split it up into a bunch of tabs just to reduce the size of the vdom.

"The size of the vdom" would not destroy performance like you're saying.

Re: Htmx Is the Future

#170

Earlier quoted context omitted.

HTML gives very limited tools for tracking what a (potentially JS-less) user is doing. There are various tricks, like "link shorteners" and "magic pixels" that allow some tracking. But if you want advanced tracking, like tracking what a user is focusing on at a particular instant, you need to wrap the whole document in a lot of JS. SPA frameworks came out of AdTech companies like Meta, and I assure you it wasn't beca…

This is not correct. SPAs and web components were pioneered by Google with the introduction of Angular. Later, Vue was invented by a previous Google employee who had worked on Angular. Finally, Facebook came up with React (it's a "reaction" to Angular) because they could not be seen using a Google product. If anything, SPAs make metrics harder because they hide the real behavior of the page in local JS/TS code and do…

A lot of misconceptions here.

Google is an AdTech company par excellence.

You don't need to do hacky URL tracking with SPAs. That's the point.

>Also, fewer server interactions means fewer opportunities to capture user behavior or affect it at the server level.

SPAs certainly do not have "fewer server interactions". What do you think an API call is?

"React" comes from "reactive web app", not "reaction to a competitor's product".

Post reply on HN