What is htmx?
Old ways and New ways
Modern web frameworks and architecture is optimized for big teams. It is a tool born out of the need to scale huge amounts of developers to all work on one interface. We do not need the overhead of the current frameworks. They bring more weight than they need.
The modern web application stack can take a few different shapes and forms, so bear with me explaining the straw man. You start with a component framework like React. Sprinkle in something for state, let's say RXJS. Put on an
npm i react-router to manage routing to pages. Drop in the data layer, your API is graphql so you put on an apollo client.
The architecture is optimized for teams with a backend and frontend separation, but that does not represent all the teams and produces and ways that we rwork.
Testing becomes a nightmare as you have more layers for units, and debugging means getting to the bottom of more connection and boiler plate code.
You load htmx in the
hx- directives in to your markup to instruct the framework on how the browser should make AJAX requests to the backend. Your backend responds with plain old html templates that will be substituted in to the page . A casual smile builds on your face as you realize you've delivered the boring part of your app without the hassle of wiring components, state and back-end API's together.
Controlling the experience
I'm convinced, how do I get started!
My example code is posted on github.
I love the process of explaining this stuff to people and I would love to share some infrequent writing with you too! If this interests you, please put your internet points towards this, and I will attempt to bring new and interesting stuff to your feed. I'm not internet famous, so feel free to reach out
Get started with the documentation at https://htmx.org/.