Starcounter / starcounter-include

Custom Element to include HTML partials/templates from Starcounter
MIT License
0 stars 0 forks source link

Hide host while external stylesheets are being loaded #96

Closed warpech closed 6 years ago

warpech commented 6 years ago

This change removes FOUC that is explained in #93 but hides the whole starcounter-include for the time of loading stylesheets. This is not optimal but better than FOUC.

Before:

bug

After:

bug2

warpech commented 6 years ago

Let's put this review on pause until @tomalec is back from vacation. This PR is one of three proposed solutions for #93.

tomalec commented 6 years ago

I would say Flash Of No Content is inevitable. As the content is loaded asynchronously. We could think of removing FONC for the very first page load, but we have a separate issue for that, and we would have to solve async cascade of requests for the markup first.

I believe it's better to show no content that old content after partial view change was requested and before it is delivered. As view-model, already expressed the old one should not be there. We could consider the preloader in such case, but it's also a separate issue.

tomalec commented 6 years ago

I also had an idea of delaying stamped event until SD ready or triggering separate event for that.

tomalec commented 6 years ago

I created a separate PR, that does conceptually the same thing, but covers more caveats. https://github.com/Starcounter/starcounter-include/pull/109

warpech commented 6 years ago

Closing as tracked now in #109