3 ms·
Retuning the data as a json object vs sending it back with the relevant html really isn’t that much more data in the grand scheme of things. It’s more data but
by simonbarker87 2y ago
Retuning the data as a json object vs sending it back with the relevant html really isn’t that much more data in the grand scheme of things. It’s more data but not very much, it’s not like you don’t need to sync with the backend with a json driven SPA.
- ungamedplayer 2y agoDisclaimer, I converted some demo react app to htmx as a learning tool. I reduced data transmission by about 20 percent. Cut the time to first render of html in half. Power usage on the client was down ( probably because the test suite finished sooner) and the server was also lower, but likely for the same reason. The html returned by the demo and my app was identical except for the react lib and htmx library. The selenium test suite only needed minor changes to work with htmx, I tried to keep the layout the same. I can't speak for the developer experience or time spent writing the react version, but the htmx was not too painful. I'm not sold in the fact that it doesn't matter in the grand scheme of things. I should probably spend some time and make a blog post so that people can pick it apart and tell me how bad I am at doing it the react way.