huhu / rust-search-extension

🦀 The ultimate search extension for Rust
https://rust.extension.sh
Apache License 2.0
1.21k stars 52 forks source link

Fix crate indexing by upgrading item types for old crate doc #277

Closed yescallop closed 5 months ago

yescallop commented 6 months ago

Closes #272. Tested to work with the latest stable std doc, tokio 1.36.0 (using new item types) and teloxide 0.12.2 (using old item types).

The itemTypes array was reordered in rust-lang/rust@28f17d97a, which is between rust-lang/rust@2f8d81f9d (nightly-2023-11-21) and rust-lang/rust@1e9dda77b (nightly-2023-11-22). This patch makes the sendSearchIndex function check the rustdoc-version rustdoc meta variable and mark the index items when the version date is before 2023-11-22, instructing the buildIndex method of DocSearch to upgrade the item types for docs.rs documentation built before 2023-11-22.

I also removed the code for special precedence for primitive and keyword pages because it is not needed anymore with the new itemTypes array (explained in the commit message of rust-lang/rust@28f17d97a).

For the patch to take effect on an already indexed crate, one should remove it from the index and then add it back.

vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rust-search-extension ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 25, 2024 2:31pm
Folyd commented 5 months ago

Thanks for working on this, I'll check this this weekend.

WaffleLapkin commented 5 months ago

@Folyd are there any plans to make a new release with this change?

Folyd commented 3 months ago

I'll release Rust Search Extension v2.0 soon, this is a big version.