Skip to content

src-script.js: make srcIndex into a parameter instead of a global variable #138467

Closed

Description

@lolbinarycat

as far as I can tell, this is only used in createSrcSidebar, which is called in generated code like this:

var srcIndex = new Map(JSON.parse('[["test123",["",[],["test123.rs"]]]]'));
createSrcSidebar();

instead, we could have generated code like this:

let srcIndex = new Map(JSON.parse('[["test123",["",[],["test123.rs"]]]]'));
createSrcSidebar(srcIndex);

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Mar 13, 2025
  2. added
    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.
    A-rustdoc-uiArea: Rustdoc UI (generated HTML)
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Mar 13, 2025
  3. added
    T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
    on Mar 13, 2025
  4. self-assigned this
    on Mar 13, 2025
  5. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Jun 4, 2025
  6. lolbinarycat commented on Jun 5, 2025

    @lolbinarycat
    ContributorAuthor

    Working on this now. This should slightly reduce rustdoc's idle memory usage because we won't have a global variable floating around holding data used for one-time initialization.

  7. added a commit that references this issue on Jun 17, 2025
  8. added a commit that references this issue on Jun 17, 2025
  9. added a commit that references this issue on Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-rustdoc-uiArea: Rustdoc UI (generated HTML)A-technical-debtArea: Internal cleanup workC-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions