-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Separate core search logic with search ui #126183
Conversation
r? @notriddle rustbot has assigned @notriddle. Use |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Separating the logic into a class makes sense, as long as it doesn't impose another HTTP request on the actual browser. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #126205) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hi, @notriddle do you know how to fix this?
|
This comment has been minimized.
This comment has been minimized.
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha |
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits: |
This comment has been minimized.
This comment has been minimized.
I'm not sure how to fix this error:
|
This comment has been minimized.
This comment has been minimized.
The GUI tests are not supposed to fail since you're only moving code to end up with the same output. So what I recommend is opening the test and look what it's checking so you can see what is going wrong with your changes. |
In particular, try:
|
Thanks @notriddle. The GUI test is success on my macOS.
|
Oh, sorry. You need to run |
Finally, all testings passed. 🥳 |
Time to squash the commits. :D Then I'll review more in details. |
Do I need git squash manually? |
Yes. If you don't know how, I wrote a tutorial a while ago here. |
Rebase done. Thanks for the tutorial. ❤️ @GuillaumeGomez |
Looks good to me! Since all tests are passing, I'm pretty confident everything is ok. Just letting @notriddle take a look to ensure nothing was missed. |
@bors r=GuillaumeGomez,notriddle |
…z,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) { } } ```
…kingjubilee Rollup of 8 pull requests Successful merges: - rust-lang#126183 (Separate core search logic with search ui) - rust-lang#129366 (linker: Synchronize native library search in rustc and linker) - rust-lang#129403 (Ban non-array SIMD) - rust-lang#129527 (Don't use `TyKind` in a lint) - rust-lang#129534 (Deny `wasm_c_abi` lint to nudge the last 25%) - rust-lang#129640 (Re-enable android tests/benches in alloc/core) - rust-lang#129731 (Allow running `./x.py test compiler`) - rust-lang#129754 (wasi: Fix sleeping for `Duration::MAX`) r? `@ghost` `@rustbot` modify labels: rollup
…kingjubilee Rollup of 8 pull requests Successful merges: - rust-lang#126183 (Separate core search logic with search ui) - rust-lang#129366 (linker: Synchronize native library search in rustc and linker) - rust-lang#129403 (Ban non-array SIMD) - rust-lang#129527 (Don't use `TyKind` in a lint) - rust-lang#129534 (Deny `wasm_c_abi` lint to nudge the last 25%) - rust-lang#129640 (Re-enable android tests/benches in alloc/core) - rust-lang#129731 (Allow running `./x.py test compiler`) - rust-lang#129754 (wasi: Fix sleeping for `Duration::MAX`) r? `@ghost` `@rustbot` modify labels: rollup
…kingjubilee Rollup of 8 pull requests Successful merges: - rust-lang#126183 (Separate core search logic with search ui) - rust-lang#129366 (linker: Synchronize native library search in rustc and linker) - rust-lang#129403 (Ban non-array SIMD) - rust-lang#129527 (Don't use `TyKind` in a lint) - rust-lang#129534 (Deny `wasm_c_abi` lint to nudge the last 25%) - rust-lang#129640 (Re-enable android tests/benches in alloc/core) - rust-lang#129731 (Allow running `./x.py test compiler`) - rust-lang#129754 (wasi: Fix sleeping for `Duration::MAX`) r? `@ghost` `@rustbot` modify labels: rollup
…z,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) { } } ```
…iaskrgr Rollup of 15 pull requests Successful merges: - rust-lang#120221 (Don't make statement nonterminals match pattern nonterminals) - rust-lang#126183 (Separate core search logic with search ui) - rust-lang#129123 (rustdoc-json: Add test for `Self` type) - rust-lang#129366 (linker: Synchronize native library search in rustc and linker) - rust-lang#129527 (Don't use `TyKind` in a lint) - rust-lang#129534 (Deny `wasm_c_abi` lint to nudge the last 25%) - rust-lang#129640 (Re-enable android tests/benches in alloc/core) - rust-lang#129642 (Bump backtrace to 0.3.74~ish) - rust-lang#129675 (allow BufReader::peek to be called on unsized types) - rust-lang#129723 (Simplify some extern providers) - rust-lang#129724 (Remove `Option<!>` return types.) - rust-lang#129725 (Stop using `ty::GenericPredicates` for non-predicates_of queries) - rust-lang#129731 (Allow running `./x.py test compiler`) - rust-lang#129751 (interpret/visitor: make memory order iteration slightly more efficient) - rust-lang#129754 (wasi: Fix sleeping for `Duration::MAX`) r? `@ghost` `@rustbot` modify labels: rollup
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) { } } ```
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:This PR added a new class called
DocSearch
, which mainly expose following methods: