Skip to content

rustdoc: theme.js may be incorporated into main.js #82616

Closed
@jsha

Description

@jsha

theme.js is loaded very early in the rustdoc HTML documents, "to reduce theme switch latencies as much as possible:" https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/render/mod.rs#L782-L834. It seems when themes were first introduced in 003b2bc, theme.js was responsible for setting the displayed theme based on local storage. However, since 5f93159, that job is done by storage.js and theme.js is mainly responsible for setting handlers on the UI elements used to pick themes.

I think it's possible now to incorporate theme.js into main.js and reduce the number of fetches per page by 1. @GuillaumeGomez what do you think?

Metadata

Metadata

Labels

T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions