-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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: optimize loading of source sidebar #98310
Conversation
Some changes occurred in HTML/CSS/JS. |
This comment has been minimized.
This comment has been minimized.
d20dab4
to
3a9f004
Compare
This comment has been minimized.
This comment has been minimized.
3a9f004
to
b37a05b
Compare
The source sidebar has a setting to remember whether it should be open or closed. Previously, this setting was handled in source-script.js, which is loaded with `defer`, meaning it is often run after the document is rendered. Since CSS renders the source sidebar as closed by default, changing this after the initial render results in a relayout. Instead, handle the setting in storage.js, which is the first script to load and is the only script that blocks render. This avoids a relayout and means navigating between files with the sidebar open is faster.
b37a05b
to
e5803b8
Compare
Thanks! @bors r+ rollup |
📌 Commit b37a05b has been approved by |
…umeGomez rustdoc: optimize loading of source sidebar The source sidebar has a setting to remember whether it should be open or closed. Previously, this setting was handled in source-script.js, which is loaded with `defer`, meaning it is often run after the document is rendered. Since CSS renders the source sidebar as closed by default, changing this after the initial render results in a relayout. Instead, handle the setting in storage.js, which is the first script to load and is the only script that blocks render. This avoids a relayout and means navigating between files with the sidebar open is faster. Demo: https://rustdoc.crud.net/jsha/defer-source-sidebar/src/alloc/ffi/c_str.rs.html r? `@GuillaumeGomez`
…umeGomez rustdoc: optimize loading of source sidebar The source sidebar has a setting to remember whether it should be open or closed. Previously, this setting was handled in source-script.js, which is loaded with `defer`, meaning it is often run after the document is rendered. Since CSS renders the source sidebar as closed by default, changing this after the initial render results in a relayout. Instead, handle the setting in storage.js, which is the first script to load and is the only script that blocks render. This avoids a relayout and means navigating between files with the sidebar open is faster. Demo: https://rustdoc.crud.net/jsha/defer-source-sidebar/src/alloc/ffi/c_str.rs.html r? ``@GuillaumeGomez``
…umeGomez rustdoc: optimize loading of source sidebar The source sidebar has a setting to remember whether it should be open or closed. Previously, this setting was handled in source-script.js, which is loaded with `defer`, meaning it is often run after the document is rendered. Since CSS renders the source sidebar as closed by default, changing this after the initial render results in a relayout. Instead, handle the setting in storage.js, which is the first script to load and is the only script that blocks render. This avoids a relayout and means navigating between files with the sidebar open is faster. Demo: https://rustdoc.crud.net/jsha/defer-source-sidebar/src/alloc/ffi/c_str.rs.html r? ```@GuillaumeGomez```
…umeGomez rustdoc: optimize loading of source sidebar The source sidebar has a setting to remember whether it should be open or closed. Previously, this setting was handled in source-script.js, which is loaded with `defer`, meaning it is often run after the document is rendered. Since CSS renders the source sidebar as closed by default, changing this after the initial render results in a relayout. Instead, handle the setting in storage.js, which is the first script to load and is the only script that blocks render. This avoids a relayout and means navigating between files with the sidebar open is faster. Demo: https://rustdoc.crud.net/jsha/defer-source-sidebar/src/alloc/ffi/c_str.rs.html r? ````@GuillaumeGomez````
…piler-errors Rollup of 16 pull requests Successful merges: - rust-lang#96173 (Fix documentation for `with_capacity` and `reserve` families of methods) - rust-lang#98184 (Give name if anonymous region appears in impl signature) - rust-lang#98259 (Greatly improve error reporting for futures and generators in `note_obligation_cause_code`) - rust-lang#98269 (Provide a `PathSegment.res` in more cases) - rust-lang#98283 (Point at private fields in struct literal) - rust-lang#98305 (prohibit_generics: don't alloc error string if no error emitted) - rust-lang#98310 (rustdoc: optimize loading of source sidebar) - rust-lang#98353 (Migrate two diagnostics from the `rustc_builtin_macros` crate) - rust-lang#98355 (Update no_default_libraries handling for emscripten target) - rust-lang#98364 (clarify Arc::clone overflow check comment) - rust-lang#98365 (Address review comments from rust-lang#98259) - rust-lang#98388 (implement `iter_projections` function on `PlaceRef`) - rust-lang#98390 (Fixes handling of keywords in rustdoc json output) - rust-lang#98409 (triagebot.toml: Allow applying nominated labels) - rust-lang#98410 (Update books) - rust-lang#98422 (Update browser-ui-test version to 0.9.6) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
☔ The latest upstream changes (presumably #98438) made this pull request unmergeable. Please resolve the merge conflicts. |
It's not clear, but I believe something went wrong with bors. This appears to have successfully been merged by #98438. I suggest double-checking, but otherwise I think this PR can just be closed. |
Yep, I confirmed this is merged! Closing. |
The source sidebar has a setting to remember whether it should be open or
closed. Previously, this setting was handled in source-script.js, which
is loaded with
defer
, meaning it is often run after the document is rendered.Since CSS renders the source sidebar as closed by default, changing this
after the initial render results in a relayout.
Instead, handle the setting in storage.js, which is the first script to load
and is the only script that blocks render. This avoids a relayout and means
navigating between files with the sidebar open is faster.
Demo: https://rustdoc.crud.net/jsha/defer-source-sidebar/src/alloc/ffi/c_str.rs.html
r? @GuillaumeGomez