-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc: dedup search form HTML #124738
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: dedup search form HTML #124738
Conversation
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha Some changes occurred in GUI tests. |
83945b8
to
3b8a5f9
Compare
This comment has been minimized.
This comment has been minimized.
3b8a5f9
to
a6cb0b9
Compare
This comment has been minimized.
This comment has been minimized.
This change constructs the search form HTML using JavaScript, instead of plain HTML. It uses a custom element because - the [parser]'s insert algorithm runs the connected callback synchronously, so we won't get layout jank - it requires very little HTML, so it's a real win in size [parser]: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token This shrinks the standard library by about 60MiB, by my test.
a6cb0b9
to
eeb59f1
Compare
</nav>`; | ||
} | ||
} | ||
window.customElements.define("rustdoc-search", RustdocSearchElement); |
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.
Didn't know you could do that. Pretty nice!
Nice improvement, thanks! @bors r+ rollup |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
Failed to push the docker image. @bors retry |
@bors r=GuillaumeGomez Allow custom element in HTML5 tidy. |
💔 Test failed - checks-actions |
@bors retry DNS… |
homu still thinks this is in queue for some reason, so trying to talk some reason into it: @bors r- |
This change constructs the search form HTML using JavaScript, instead of plain HTML. It uses a custom element because
This shrinks the standard library by about 60MiB, by my test.
There should be no visible changes. Just use less disk space.