Commit b5ce9c4
authored
Rollup merge of rust-lang#84150 - jsha:defer-search-js, r=GuillaumeGomez
rustdoc: move some search code into search.js
This reduces main.s from 3094 lines to 1587. Also it saves some bytes
of download in the case where search isn't used.
There were a fair number of variables that needed to be accessible in
both main.js and search.js, but I didn't want to put too many symbols in
the global namespace, so I consolidated much of the search-related
state and functions into a new object `window.searchState`.
Demo at https://hoffman-andrews.com/rust/move-search/std/?search=fooFile tree
6 files changed
+1682
-1693
lines changed- src
- librustdoc/html
- render
- static
- tools/rustdoc-js
6 files changed
+1682
-1693
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| |||
409 | 410 | | |
410 | 411 | | |
411 | 412 | | |
412 | | - | |
| 413 | + | |
413 | 414 | | |
414 | 415 | | |
415 | 416 | | |
| |||
0 commit comments