Re:A Real World React – Htmx Port
by robertlagrant on Sunday October 16, 2022 @12:14PM
(#33224744)
I wouldn't assume a fragment is any bigger than the raw data when it's compressed.
Vs
They seem extremely similar to me.
[ Parent
| on HN ]
The issue with this model is that many state updates are not scoped to a single fragment. When you go to a another page, you’ll likely want to update the amount of results on one or more detached components. That’s way more natural to by getting the length of an array of data structures than on a html fragment.
Re:A Real World React – Htmx Port
by robertlagrant on Tuesday October 18, 2022 @05:09AM
(#33244743)
Possibly, yes, although many SPA sites seem to hit for updates every (visual) page change anyway, to get the latest results. It's rare that a UI will hold all the records to count locally, unless it's a small and slow-changing data set, so it's asking for a count whether or not it's getting it wrapped in HTML or JSON.