Hacker News new | ask | show | jobs
by arcticwombat 2691 days ago
2mb html file, + whatever else for initial load?

That's only 1-2 seconds on a fast connection.

If you have zero of that content cached locally and are on a mobile or just not-fast connection it'll be way more than 1-2 seconds.

Your "solution" is one of the ones responsible for locking up mobile browsers all over the place, because the browser still has to deal with the entire DOM, and it's often done way inefficiently.

1 comments

> 2mb html file, + whatever else for initial load?

nothing else because all images are already inlined as svg as well as all styles and the mentioned js code

> Your "solution" is one of the ones responsible for locking up mobile browsers all over the place, because the browser still has to deal with the entire DOM, and it's often done way inefficiently.

I only came up with doing it this way after previously having build the same app using react and old devices (eg android pre chrome) could not handle all the vdom diffing and add/removeNode.

Our users preferred a slightly longer initial load (even 10 seconds) and lightning fast interactions afterwards over fast initial load and sluggish UI for all the time using the app.

When doing client sit rendering you would still have to transfer and parse little chunks of json all the time.

As it turns out browsers are really good at handling even huges DOMs as long as you do not manipulate it to much.

Granted this way only works if you have a limited set of states/pages (eg a few thousand).