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

Convert search-index.js into a plain JSON file. #71216

Closed
Dylan-DPC-zz opened this issue Apr 16, 2020 · 7 comments
Closed

Convert search-index.js into a plain JSON file. #71216

Dylan-DPC-zz opened this issue Apr 16, 2020 · 7 comments
Assignees
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Dylan-DPC-zz
Copy link

Dylan-DPC-zz commented Apr 16, 2020

It might help to convert search-index.js into a plain JSON file. I'm pretty sure that JSON.parse is significantly faster than trying to compile and execute JavaScript code.
Originally posted by @ollie27 in #56545 (comment)

Opening this issue to gain traction so that someone can work on it (Ready to mentor if possible)

cc @GuillaumeGomez

This issue has been assigned to @euclio via this comment.

@Dylan-DPC-zz Dylan-DPC-zz added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Apr 16, 2020
@euclio
Copy link
Contributor

euclio commented Apr 16, 2020

I am willing to work on this.

@Dylan-DPC-zz Dylan-DPC-zz added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Apr 16, 2020
@Dylan-DPC-zz
Copy link
Author

@euclio go ahead and run @rustbot claim.

if you have any issues feel free to ping me here or anywhere else

@euclio
Copy link
Contributor

euclio commented Apr 16, 2020

@rustbot claim

@rustbot rustbot self-assigned this Apr 16, 2020
@euclio
Copy link
Contributor

euclio commented Apr 16, 2020

It's easy enough to generate a JSON file instead of a JavaScript file, but how do we want to load the JSON file? I'm not familiar with how the search works: can we request the JSON via XMLHttpRequest and then call addSearchOptions and initSearch asynchronously? We could also embed the JSON in the HTML via a data block, but that would add the cost of the search index to the initial page load.

@Dylan-DPC-zz
Copy link
Author

turns out @GuillaumeGomez has some progress on this :/ so maybe you can work on a different issue

@GuillaumeGomez
Copy link
Member

Arf sorry @euclio, didn't see this issue so I commented on the other one... Even though I did it, it'd be awesome if you took a look at the PR: #71250 :)

@Alexendoo
Copy link
Member

Closed by #71250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants