fix(search): Update Algolia search to index during build and improve visual display, ranking, and sorting of search results#1231
fix(search): Update Algolia search to index during build and improve visual display, ranking, and sorting of search results#1231jderochervlk wants to merge 13 commits intomasterfrom
Conversation
….14, tsdown 0.21 Vite ecosystem: - vite: ^7.0.6 -> ^8.0.3 - @vitejs/plugin-react: ^4.7.0 -> ^6.0.1 - @tailwindcss/vite: ^4.1.13 -> ^4.2.2 - vite-plugin-page-reload: ^0.2.2 -> ^0.2.3 Vitest ecosystem: - vitest: ^4.0.18 -> ^4.1.2 - @vitest/browser-playwright: ^4.0.18 -> ^4.1.2 - vitest-browser-react: ^2.0.5 -> ^2.2.0 React: - react: ^19.1.0 -> ^19.2.4 - react-dom: ^19.1.0 -> ^19.2.4 - @types/react: ^19.2.2 -> ^19.2.14 ReScript: - rescript: ^12.0.0 -> ^12.2.0 - @rescript/react: ^0.14.0 -> ^0.14.2 - Migrate Exn.Error -> JsExn (deprecated in 12.2) React Router: - react-router: ^7.12.0 -> ^7.14.0 - react-router-dom: ^7.9.4 -> ^7.14.0 - @react-router/node: ^7.8.1 -> ^7.14.0 - @react-router/dev: ^7.8.1 -> ^7.14.0 tsdown: 0.20.0 -> 0.21.7 (in build:scripts)
…nto vlk/fix-algolia
|
Cool stuff. btw can you fix the clear button? Looks very weird to me as if the "Clear" text was supposed to be a popover or something. |
- Hide clear and cancel buttons for cleaner UI - Redesign footer with border and spacing adjustments - Add styles for command key display in footer
Update DocSearch commands to show 'to clear' when input has text and 'to close' when empty
Cloudflare deploymentDeployement ID: d6883c36-3dc6-49e5-920a-8fcd7485c8d2 ⛅️ wrangler 4.63.0 (update available 4.81.0) ✨ Uploading _redirects |
I removed it and updated the footer to show clear or close with the ESC key depending on if there is text in the search box. |
I made it so Algolia gets updated from a script during the build process. This will help keep things up to date. I also changed the way ranking and sorting work so the results feel more target at what we would expect when searching for things like
arrayorarray map. There are also some visual changes as the search results show more text and code snippets are inside of<code/>blocks.Note
This work was done with AI assistance
AI summary
This pull request introduces a major upgrade to the search infrastructure by integrating Algolia-powered site search, including a new build pipeline for generating and uploading search indexes, environment configuration updates, new bindings, and improved URL version parsing. It also adds new test coverage and several utility enhancements.
Algolia Search Integration
scripts/generate_search_index.res) that compiles all site content into Algolia search records and uploads them, with index settings configured for optimal search ranking and faceting. This script is invoked as part of the build process.src/bindings/Algolia.res) to support index upload and configuration from the build script.package.jsonto include the search index generation step and added thealgoliasearchdependency. [1] [2]Environment and Configuration
.envto include Algolia credentials and index name, and bumped documentation version numbers.src/bindings/Env.resfor use in the application.Search Index Utilities
src/common/SearchIndex.resi, including types and helper functions for content extraction and formatting.Testing and Utility Improvements
__tests__/Url_.test.resand improved the version parsing regex insrc/common/Url.resto handle both v-prefixed and non-prefixed versions. [1] [2]UI Enhancements
src/components/Icon.resand their interface insrc/components/Icon.resi. [1] [2]src/components/Meta.resto rely on dynamic versioning.Before
After