Skip to content

Allow the site to load even if the external CSS does not #980

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

Closed
wants to merge 1 commit into from

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Aug 16, 2020

Our external CSS is only used for the header bar and a few other things - the site will look ugly without, but the rustdoc pages should still be usable.

This also changes several <script> tags to be inside the body, since
it's invalid for them to come after:
script

Partially addresses #979, cc @Byron. I can set up a staging server in a little bit so you can verify this actually helps.

Our external CSS is only used for the header bar and a few other things
- the site will look ugly without, but the rustdoc pages should still be
usable.

This also changes several `<script>` tags to be inside the body, since
it's invalid for them to come after.
@jyn514 jyn514 added A-frontend Area: Web frontend S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Aug 16, 2020
@Byron
Copy link
Member

Byron commented Aug 16, 2020

I am happy to help :)! Thanks so much!

@jyn514
Copy link
Member Author

jyn514 commented Aug 18, 2020

Since #981 is waiting on some design decisions, I'm thinking about this more to fix the immediate issues.

putting the css in the body might cause some flicker in the screen, which imo is worse

@pietroalbini I actually think it's better to allow loading to fail, if you have a slow connection and the CSS times out you should still be able to see the rest of the site.

Here's loading with 'Good 2G' (whatever firefox thinks that is): https://youtu.be/tfXVmckH_j4
With 'Wifi', it still looks pretty good - there's a noticable load time, but no flicker: https://youtu.be/MOAJ53C8EMY
With the CSS in the head as currently deployed, it looks about the same, I didn't see a noticeable difference.

Without any external CSS at all (I just commented it out) it looks pretty bad but you can at least see the documentation:

image
image

@Byron what do you think about those last two images? Is that usable or not?

@Byron
Copy link
Member

Byron commented Aug 19, 2020

@jyn514 Thanks a lot for pushing for an intermediate solution - I can't wait to have docs.rs back in any condition. Since the proposed solution doesn't seem to have negative impact even for slow connections, it seems implementing this won't hurt in the meanwhile.

I also tried again and realized that after three minutes when the browser decides to give up, docs.rs will load just fine (if enough CSS is cached).
Screenshot 2020-08-19 at 10 58 02

@Byron
Copy link
Member

Byron commented Aug 21, 2020

It looks like this one is ready to go, and I along with the entirety of China would greatly benefit from this PR being merged.

Is that correct, or is there anything else impeding it?

@jyn514 jyn514 added S-waiting-on-decision This needs a decision from the team on whether it should be merged or not and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Aug 21, 2020
@jyn514
Copy link
Member Author

jyn514 commented Sep 10, 2020

Closing this; it's no longer necessary after #981

@jyn514 jyn514 closed this Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Web frontend S-waiting-on-decision This needs a decision from the team on whether it should be merged or not
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants