News for hackers. Stuff that matters.
Re:Htmx Is the Future by jdthedisciple on Saturday May 06, 2023 @07:22AM (#35840231)
Insofar as only retrieving data and returning it as json is way less work for the server than retrieving data plus rendering it.
Re:Htmx Is the Future by quacker on Saturday May 06, 2023 @08:27PM (#35846659)
For the same data, why should serializing it to JSON be particularly faster than rendering it as HTML? The server is converting the data directly to a byte string in either case, which is about the same amount of work.

HTML is more verbose, so I would guess that JSON serialization is slightly faster, but I doubt there's an order of magnitude difference. (I could be proven wrong though)

I agree that taking HTMX to the extreme where _all_ interactions require a request to the server is too much overhead for interactive web apps. But there's likely a good middle ground where I can have mainly server side rendering of HTML fragments with a small amount of client side state/code that doesn't incur particularly more or less server load.

Re:Htmx Is the Future by quii on Sunday May 07, 2023 @05:02PM (#35855566)
Converting data to a HTML string is not a performance bottleneck you'll be worrying about. I wasn't worrying about it much in 2000, and you really shouldn't need to in 2023.