3 ms·
I imagine it would be somewhat easy to provide a way for the APIs to include a way to filter the resulting HTML they produce. A CSS path as a URL parameter that
by geoffeg 4y ago
I imagine it would be somewhat easy to provide a way for the APIs to include a way to filter the resulting HTML they produce. A CSS path as a URL parameter that the API runs to only return the content of the CSS path.
There's probably some kind of balance between giving every partial it's own URL and allowing each partial to support a filtered response. You could write a little middleware for your http server to support the filtered response on every endpoint that returns HTML.
- quickthrower2 4y agoYeah there could be some kind of “varnish-like” layer outside the app server designed to modify the response to the required “lens” that is specified in a header. This would process the app response and filters/zoom to the part of the doc you want. The app could be agnostic and it reduces the amount of crap sent over the wire.
- geoffeg 4y agoLooks like HTMX already has something like this, just client-side. https://htmx.org/attributes/hx-select/ https://htmx.org/attributes/hx-select/ That's probably safer in some ways than filtering server side.