-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wait for CSS to be loaded before replacing the Body #614
Conversation
What would the failure state be if those assets fail to load (bad CDN or whatever)? How long would we wait for them to load? Do we need a timeout? |
good shout, I've added a timeout as @seanpdoyle suggested |
Co-authored-by: Anthony Ricaud <[email protected]>
@seanpdoyle @rik what do you think of the changes now? I've implemented your suggestions :) |
Do we have adequate test coverage for this? |
added tests in 3171b0a |
@dhh this should be ready for some 👀 |
Related to #613
As suggested in #613 (comment), we can listen for
load
anderror
events in stylesheets to make sure they are loaded before continuing a render.Here I'm updating how
PageRenderer
adds new stylesheets to the document head, adding listeners to those events and waiting them to fire before replacing the body.