Skip to content

Commit

Permalink
Unrolled build for rust-lang#126183
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#126183 - Folyd:search-core, r=GuillaumeGomez,notriddle

Separate core search logic with search ui

Currenty, the `search.js` mixed with UI/DOM manipulation codes and search logic codes, I propose to extract the search logic to a class for following benefits:

- Clean code. Separation of DOM manipulation and search logic can lead better code maintainability and easy code testings.
- Easy share the search logic for third party to utilize the search function, such as [Rust Search Extension](https://rust.extension.sh), https://query.rs.

This PR added a new class called `DocSearch`, which mainly expose following methods:

```js
class DocSearch {
	// Dependency inject searchIndex, rootPath and searchState
	constructor(rawSearchIndex, rootPath, searchState) {
		// build search index...
	}

	static parseQuery(userQuery) {
	}

	async execQuery(parsedQuery, filterCrates, currentCrate) {
	}
}
```
  • Loading branch information
rust-timer authored Aug 31, 2024
2 parents fa72f07 + 1eb4cb4 commit c5f6a66
Show file tree
Hide file tree
Showing 2 changed files with 3,426 additions and 3,388 deletions.
Loading

0 comments on commit c5f6a66

Please sign in to comment.