4 ms·
Could you not have ?query={entire query goes here} Rather than splitting it up into multiple query params? Feels like it's one indivisible param rather th
by WickyNilliams 2y ago
Could you not have
?query={entire query goes here}
Rather than splitting it up into multiple query params? Feels like it's one indivisible param rather than multiple facets. You could always base64 encode if it starts getting complex
- PaulHoule 2y agoIf it just comes to having buttons to add and remove tags I guess the server could generate those packed query strings (that HTMX will GET or POST to) Full text fields would be harder as the front end is going to want to put them in their own query parameter although one attack on the problem is to have the query as a parameter and have parameters that define a command that changes the query and have the back end mash that into the query. The user interface for nested queries would be more complex than for the flat queries (which can usually be updated incrementally, adding or removing just one tag) but could probably be redrawn from the back end whenever it changes.
- Izkata 2y agoDoes it really need to be generated on the backend and passed around like that? It seems like you're doing a ton of extra work to fit it into htmx, where coming from jquery and react, it's much more natural to generate it entirely on the frontend using plain arrays and objects, then send it as a whole to the backend in one serialized json string. Of course with one final validation on the backend, possibly with a transformation into whatever query language the backend is using. But no need for round-trips to construct it like that.