Lets add more perf
Loading app in prod mode users see unstyled content until bundle is loaded. On junky connections it look not really nice.
Why is it happening?
How to fix it?
Please, correct if I was mistaken during investigation ;)
Temporary solution is to hide body content until bundle loaded and then show all styled app.
Here the perf results:
Result - SI increased.
This is so so so amazing
Everything you've said is spot on. I've been meaning to explore adding critical styles this week since the flash of unstyled content is a bit annoying, especially in slow connections I agree
Thank you so much for considering a workaround to at least hide content until it gets styled. I was considering kicking off a thread to discuss the possibility of adding complete SSR for this since I wasn't sure preact-cli supported this, but I'm so glad to hear it's possible. Speed index improvements look absolutely amazing!
Again, thank you so much for this. Somebody noticed a similar issue using styled-components + preact here, but I don't know if they were extracting styles for the server in this case or even if this is remotely related
I was trying to fix this problem, but looks like some related code for nodejs became part of a build
And it's present only when
I did workaround and cheated :) copy/pasting just function
Cheers, I appreciate you considering adding the method in yourself
Agreed, would be nice if we can pinpoint why this issue is happening and hopefully have it resolved upstream. But if that doesn't happen soon enough, I'm okay with this workaround for the meantime :)
Thanks again matey, we owe you one