4 ms·
I don't really see how progressive enhancement works if every element is a hypermedia control. Without JS/HTMX you just have a page that does nothing: <div
by dlisboa 3y ago
I don't really see how progressive enhancement works if every element is a hypermedia control. Without JS/HTMX you just have a page that does nothing:
<div hx-get="/example">Get Some HTML</div>
This will never do anything without HTMX because the semantic of that markup is wrong. You'd really have to write everything in a vanilla HTML approach to begin with, and never make use of the idea of adding hypermedia to other elements.
- recursivedoubts 3y agoyou do have to structure things properly to make progressive enhancement work with htmx for your example, you wouldn't have a div, you'd use an anchor: <a hx-get="/example" href="/example">Get Some HTML</a> or, more likely, just boost it: <a hx-boost="true" href="/example">Get Some HTML</a> and then on the server side you'd need to check the `HX-Request` header to determine if you were going to render an entire page or just some partial bit of HTML if you go down the progressive enhancement route you need to think carefully about each feature you implement and how to make it compatible w/ no-js. Some patterns (e.g. active search) work well. Others (drag and drop) don't and you'll have to forgo them in the name of supporting noJS nb: unpoly is a more seamless progressive enhancement experience due to its design goals