Skip to content
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

[mdbook] Disable the Search Index #2469

Closed
wants to merge 1 commit into from
Closed

Conversation

TimNN
Copy link
Contributor

@TimNN TimNN commented Jun 10, 2018

This PR prevents mdbook from generating searchindex.js and related files. This means that searching the content at http://rust-lang.github.io/rfcs/ will no longer work.

searchindex.js currently contains 38MB(!!) of JavaScript. Even when compressed, that's still around 6MB. Aside from being unreasonably large, this also causes Mobile Safari to crash the tab.

Search functionality is still available on the GitHub repo, so I suggest disabling the search index until its size can somehow be reduced.

@TimNN
Copy link
Contributor Author

TimNN commented Jun 10, 2018

r? @rust-lang/docs

@steveklabnik
Copy link
Member

Hm, I'm not sure how I feel about this. Disabling it for everyone because of one platform is not ideal.

@TimNN
Copy link
Contributor Author

TimNN commented Jun 11, 2018

While I originally noticed this due to the crashing in iOS, I believe that 38MB is unreasonably large for any browser / device. For example, on Desktop Chrome, it takes about ~2 seconds before scrolling works after the initial content is displayed. Also, from Chrome's Performance audit, it spent ~2s to parse and compile the script plus an additional 6.5s(!!) to execute it.

@steveklabnik
Copy link
Member

steveklabnik commented Jun 11, 2018 via email

@withoutboats withoutboats added the T-doc Relevant to the documentation team, which will review and decide on the RFC. label Jun 13, 2018
@Centril Centril added the not-rfc For PRs that fix things like spelling mistakes, wrong file names, etc. label Nov 22, 2018
@JeanMertz
Copy link

I just came searching for any clue on the search functionality on https://rust-lang.github.io/rfcs.

I know this issue is about removing that search functionality, but in the interest of keeping the non-RFC issues to a minimum in this repo, I'll just report this here (given that at least @steveklabnik will get a ping).


I just proposed a new "bang" query to DuckDuckGo, !rustrfc with the URL being https://github.com/rust-lang/rfcs/issues?utf8=✓&q={{{s}}}. After I submitted that proposal, I found that this repo has an mdbook as well, so I figured perhaps I should amend my bang-query-proposal to use the search functionality of the book.

However, it seems that searching for an RFC ID (so a GH issue number) does not work in the book (f.e. https://rust-lang.github.io/rfcs/?search=2497 returns "no results").

It's not that big of a deal (cmd+F still works, since the issue number is part of the index on the left), but I figured I'd report this here, in case we want to make that work as well.

@GuillaumeGomez
Copy link
Member

A first searchindex.js size reduction PR got merged: rust-lang/rust#56709

A few others will follow. :)

@TimNN
Copy link
Contributor Author

TimNN commented Dec 15, 2018

@GuillaumeGomez: I don't think https://rust-lang.github.io/rfcs uses rustdoc to render itself, but rather mdbook (which I don't think was affected by your changes).

However there was rust-lang/mdBook#707, which should have reduced the size of the search index at least somewhat.

@TimNN TimNN closed this Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-rfc For PRs that fix things like spelling mistakes, wrong file names, etc. T-doc Relevant to the documentation team, which will review and decide on the RFC.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants