hyperstatic-starter icon indicating copy to clipboard operation
hyperstatic-starter copied to clipboard

Keep the prerendered page while loading external data

Open mdings opened this issue 4 years ago • 3 comments

Hi @loteoo,

Whenever external static data is being loaded, there is an option to display a custom loader. Is it also possible to just show the prerendered markup while hyperstatic waits for the external data? Otherwise the page "jumps" in prerendered environments while data is being loaded.

For example on the following site which is running hyperstatic: https://www.jack-hunt.com/scheren/scheergel

  1. While the page loads the prerendered markdown is displayed
  2. When the js for hyperstatic is loaded, but not the external JSON-data for the page, the outlet rerenders with empty content.
  3. When the external JSON-data is done loading (in this case the title, introductory text below and products), the outlet rerenders again which then display the page as it was prerendered with all the functionality applied.

However in between step 2 and 3 there is a brief flash of empty content, depending on the network speed.

mdings avatar Mar 17 '21 17:03 mdings

Hi @mdings !

Thank you for reporting this, this is indeed a bug in the new version of hyperstatic, I will try to fix it soon!

I'm currently redoing the demo / docs website and still am ironing out the final bumps with the new release, surprised that someone is using it already haha! ❤️

loteoo avatar Mar 17 '21 17:03 loteoo

Well I actually noticed it already in the previous version so I did a checkout of V2 and encountered the same problem there. 😆

mdings avatar Mar 17 '21 17:03 mdings

Just published a new version! Upgrade your project to 2.0.3 to check it out! Hopefully it works out all well :)

I updated the starter as well with the new version :)

loteoo avatar Mar 18 '21 05:03 loteoo