5 ms·
It's unclear to me what the alternative is. Would you prefer less interactive, but server-side rendered pages? Latency is latency, and if the closest node to yo
by JMTQp8lwXL 7y ago
It's unclear to me what the alternative is. Would you prefer less interactive, but server-side rendered pages? Latency is latency, and if the closest node to you is somewhere in US West 2, the problem isn't react, the problem is the application is widely distributed enough for you to get acceptable response times.
If you do server-side rendered pages, you still have to make the round-trip to get the next full HTML page. Switching to Vue or Svelte or JSPs isn't changing that.
- xixixao 7y agoThe answer is aggressive prefetching. How much to prefetch depends on each UI structure and the weight of the prefetched components.
- RussianCow 7y agoNot only this, but proper loading states for anything that is happening asynchronously. I am so sick of web apps that show absolutely no sign that a request is in progress.
- strbean 7y agoThat is what "Suspense for Data Fetching" is going to help with. It is already perfectly possible to handle data fetching nicely, it just isn't incredibly easy. When Suspense for Data Fetching goes stable, it will be trivial to do right.
- JMTQp8lwXL 7y agoThat would help movement between pages in a single-page application, though cold boot times will still be less than desirable. If I immediately go to the SPA, and then navigate from page A to page B and the prefetching hasn't completed yet, it can be a jarring experience. I've occasionally clicked on the wrong thing in a UI because the website repainted as I clicked, causing the DOM to shuffle around considerably. New Reddit seems to be a good example of this problem today.
- ehnto 7y agoThe site doesn't need to be non-interactive, just load the data you intend to show right away in the initial request. Have your 10 interactive components pre-filled, then they can update via web request after that. Single interactions are fine, but when the page initially loads and has to then load 10 other components, the latency adds up really fast and makes it all feel clunky. It still matters after the initial load, just not as much. An example, when loading a Jira ticket, you have to wait for the page to be sent to you, but it's not usable yet, then you wait for the individual areas of the page all to be sent to you, and as each one loads in at a different time the page goes all over the place and it's not clear when it's actually done and you can safely click stuff without your click target jumping away. After that, interacting with a single part of the Jira ticket can still induce a load, but it's just the one, and it's expected and I can tell when it's done.