Shipping Htmx in Production (A Post-Mortem)
enriquebruzual.substack.com
enriquebruzual.substack.com
<a href="/?page=2" hx-target="#dashboard-content" hx-boost="true">
Next Page
</a>
Then he would have gotten the functionality out of the box without even using hx-push-url explicitly. And he would have gotten graceful degradation with a link that worked without JS and Ctrl/Cmd-click to open in a background tab.Also the article seems to be full of errors. Eg
> In HTMX, if the server returns a 500 error, the browser might swap the entire stack trace or the generic error page into the middle of a table by default. This is a poor user experience.
This is simply incorrect. By default htmx does not swap 4xx/5xx responses. Instead it triggers an error event in the DOM. Developers can choose to handle that event or they can choose to override the default behaviour and do a swap.