Re:Entire website in a single HTML file
by tazjin on Friday December 24, 2021 @06:36AM
(#29672765)
In "modern" stacks it is preferable to do things like layouting of formulas millions of times on the clients, instead of once on the server. I guess that sort of thing needs JS.
[ Parent
| on HN ]
Re:Entire website in a single HTML file
by southerntofu on Friday December 24, 2021 @06:57AM
(#29672883)
As you have pointed out, but formulated more explicitly: client-side rendering should deal only with HTML/CSS because that's what the browser is built and optimized for. Every line of script changing the DOM (html structure) may trigger a redraw of the page, which means wasting considerable amount of resources! But even if your script outputs HTML only once, you still have O(n) HTML templating instead of O(1) for n clients. Such a waste!