5 ms·
Why is it a wrong abstraction?
by basique 3y ago
Why is it a wrong abstraction?
- nsonha 3y agoIt assumes a lot of things: - Submitting a form results in an immediate network request (offline-first apps, hello?) - The network event is HTTP-based - The network event is REST - The payload is contained within the... markup (like why?) - What about network requests that are not CRUD? If your API is designed propperly, that should be most of the endpoints. Do you make dummy forms for them? How?
- basique 3y agoThe point of htmx is to be able to do the interactivity on the server, so using it with your existing, general API isn't really the point - the backend (or, well, frontend backend?) just serves the needed data directly in the markup. This isn't really ideal if you think of your site as a separate frontend/backend, but it makes sense if you already have a backend and don't want to make an API just to then write JS that consumes the API and shows you stuff. Granted, this doesn't really work well with offline-first apps, but it's nice if you need to actually poke the server whenever you need to do something.