-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rustdoc: reduce per-page HTML overhead #123706
Conversation
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha |
This comment has been minimized.
This comment has been minimized.
This cuts the HTML overhead for a page by about 1KiB, significantly reducing the overall size of the docs bundle.
According to <https://caniuse.com/?search=svg%20favicon>, SVG favicons are supported in everything but Safari. When I actually try it in Safari, it's downloading all three favicons, and nothing looks different when I disable the 16x16 one. <https://dev.to/masakudamatsu/favicon-nightmare-how-to-maintain-sanity-3al7>, which is linked from caniuse above, recommends an ico. However, the reason they recommend it is the apps that only support /favicon.ico exactly, and rustdoc can't assume it will be installed to the site root, so it's unfortunately up to the webmaster to make sure it's set up.
b47ffc2
to
87faa21
Compare
This comment has been minimized.
This comment has been minimized.
Some changes occurred in GUI tests. |
That's better indeed, thanks! |
@bors r+ rollup |
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#118391 (Add `REDUNDANT_LIFETIMES` lint to detect lifetimes which are semantically redundant) - rust-lang#123534 (Windows: set main thread name without re-encoding) - rust-lang#123659 (Add support to intrinsics fallback body) - rust-lang#123689 (Add const generics support for pattern types) - rust-lang#123701 (Only assert for child/parent projection compatibility AFTER checking that theyre coming from the same place) - rust-lang#123702 (Further cleanup cfgs in the UI test suite) - rust-lang#123706 (rustdoc: reduce per-page HTML overhead) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#123706 - notriddle:notriddle/html-cleanup, r=GuillaumeGomez rustdoc: reduce per-page HTML overhead r? `@GuillaumeGomez`
`)</script> {# #} | ||
<script>if(window.location.protocol!=="file:") {# Hack to skip preloading fonts locally - see #98769 #} | ||
for(f of "{{files.source_serif_4_regular}},{{files.fira_sans_regular}},{{files.fira_sans_medium}},{{files.source_code_pro_regular}},{{files.source_code_pro_semibold}}".split(",")) {# #} | ||
document.write(`<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}${f}">`) {# #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using document.write breaks speculative parsing of the html afaik.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know! I'll send an improvement.
Wow. Congrats again @notriddle! |
…n, r=notriddle Fix copy path button Currently, on all nightly docs, clicking on the "copy path" button triggers a JS error. It's because changes in rust-lang#123706 forgot to update the JS (it contained an image before but not anymore). I had to make some small changes in the CSS to fix the display when the button was clicked as well. r? `@notriddle`
…n, r=notriddle Fix copy path button Currently, on all nightly docs, clicking on the "copy path" button triggers a JS error. It's because changes in rust-lang#123706 forgot to update the JS (it contained an image before but not anymore). I had to make some small changes in the CSS to fix the display when the button was clicked as well. r? ``@notriddle``
Rollup merge of rust-lang#124041 - GuillaumeGomez:fix-copy-path-button, r=notriddle Fix copy path button Currently, on all nightly docs, clicking on the "copy path" button triggers a JS error. It's because changes in rust-lang#123706 forgot to update the JS (it contained an image before but not anymore). I had to make some small changes in the CSS to fix the display when the button was clicked as well. r? ``@notriddle``
…, r=notriddle Inline more svg images into CSS Follow-up of rust-lang#123706. r? `@notriddle`
Rollup merge of rust-lang#123734 - GuillaumeGomez:inline-svg-into-css, r=notriddle Inline more svg images into CSS Follow-up of rust-lang#123706. r? `@notriddle`
r? @GuillaumeGomez