3 ms·
Because it's faster! Which one do you think will render first? - Send a small amount of HTML and CSS for the browser to show on the page; or - Send a JavaScr
by montroser 7y ago
Because it's faster! Which one do you think will render first?
- Send a small amount of HTML and CSS for the browser to show on the page; or
- Send a JavaScript application framework and JSON results, then have the browser interpret the JavaScript, parse the JSON, generate the HTML and show on the page
With an approach like Svelte takes, you can make the second option pretty workable, but you'll still never beat sending markup directly if your goal is to render a small amount of static content as quickly as possible.