Live data from Hacker News

Htmx is part of the GitHub Accelerator

htmx.org

11–20 of 520 posts

Re: Htmx is part of the GitHub Accelerator

#11
post #5

This page made me realise I'm better off with just vanilla JS or jQuery: https://htmx.org/examples/update-other-content/ Solution 3 gave me a good laugh though.

Why the heck would you use jQuery in 2023 though?

My main use case will be basic UI interaction, mostly just posting or fetching data from a backend then updating the innerHTML on some element. Vanilla might be enough, but I'm keeping my options open.

Also, no compilation step, so no need for npm, etc

Re: Htmx is part of the GitHub Accelerator

#13
post #3

Congratulations! I had a fun time making a little project with Htmx, though ultimately went with something else as I ended up heavily using a openlayers, and map libs are notoriously heavy with clientside javascript and Svelte ended up being a better tool for the job. I plan on using it again for a future Golang project and look forward to following it's development. If you're in need of a simple/medium complex front…

I’ve had good luck combining HTMX with D3.js but I’ve treated D3.js visualizations as “just another HTML element” with any particularly complex interaction with the rest of the site.

Re: Htmx is part of the GitHub Accelerator

#14

Earlier quoted context omitted.

Why the heck would you use jQuery in 2023 though?

My main use case will be basic UI interaction, mostly just posting or fetching data from a backend then updating the innerHTML on some element. Vanilla might be enough, but I'm keeping my options open. Also, no compilation step, so no need for npm, etc

IMO that's where alpine.js complements HTMX, you can use HTMX mainly for interfacing with a server and then use alpine.js for any special interaction that does not require a round-trip with the server.

Re: Htmx is part of the GitHub Accelerator

#15
post #5

This page made me realise I'm better off with just vanilla JS or jQuery: https://htmx.org/examples/update-other-content/ Solution 3 gave me a good laugh though.

Solution 2 is clearly the best option. htmx authors would be wise to get opinionated and champion that approach. Forget about IE11 compat. Completely rearranging the DOM (Sol. 1) and a two request chain for one update (Sol. 3) are non-starters

Re: Htmx is part of the GitHub Accelerator

#16
I think we need an impressive "made with htmx" example that will trail blaze an new class of web experiences.

People have typecast htmx as something to use for simple use cases that dont "warrant" getting out the serious guns. There is something to that, but it is limiting. Htmx and related 'back-to-the-server' approaches are a distinct category that could have been explored much earlier but for various reasons isnt

Re: Htmx is part of the GitHub Accelerator

#17

Earlier quoted context omitted.

Why the heck would you use jQuery in 2023 though?

My main use case will be basic UI interaction, mostly just posting or fetching data from a backend then updating the innerHTML on some element. Vanilla might be enough, but I'm keeping my options open. Also, no compilation step, so no need for npm, etc

JQuery would make sense when we didn’t have querySelector and fetch API. I can’t think of any reason to use it today on a new project, there are not advantages over vanilla.

Re: Htmx is part of the GitHub Accelerator

#20

It's so odd to live long enough and see the steady pipeline of "look at this much simpler way of doing web apps, just write HTML, not like the previous complex way" projects, which then turn into the previous complex way as the eyes turn towards the next "simple way of doing web apps, just write HTML...". Angular and React started this way on the frontend, while ASP and PHP started this way on the backend (of course…

ASP had some strange things where you could write what looked like a client side handler on a button and it would call a function in the server.

Circa 2007 or so it seemed a to be a huge mistake because it didn’t play well with the so-called “model-view-controller” paradigm where, most importantly, the request handler could decide which view to render. (e.g. you fill out a form and if you mad a mistake it redraws the form with an error message, otherwise it might render one of several different forms depending on what you filled out on the first form.)

He thing about HTMX is that it really wants support on the server side. For instance, you might have a that gets drawn as part of an HTML page or that gets updated with new (s) via HTMX when you push a button. Similarly you might have a form that can be rendered as the only form on a page or that can be rendered as a modal dialog that is pulled from the server when you open the modal (as opposed to unhiding it.). Either way the code that draws the HTML fragment (both the template and any database fetching/thinking) has to be runnable in more than one context. (Modal dialogs are so fun to implement with HTMX.)

It’s something you can do in a situational way or that you could have a framework to help with, but it is part of the HTMX puzzle.

Post reply on HN