-
-
Notifications
You must be signed in to change notification settings - Fork 198
feat!: update @rspress/plugin-algolia to docsearch v4.1.0 #2620
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
feat!: update @rspress/plugin-algolia to docsearch v4.1.0 #2620
Conversation
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
Co-authored-by: SoonIter <[email protected]>
Co-authored-by: SoonIter <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the @rspress/plugin-algolia package to use docsearch v4.1.0, addressing breaking changes in translation property names while maintaining backward compatibility for end users.
- Updated docsearch dependencies from v3.9.0 to v4.1.0
- Migrated deprecated translation property names to their v4 equivalents
- Added comprehensive unit tests to verify the migration and prevent regressions
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/plugin-algolia/package.json | Updated docsearch dependencies to v4.1.0 |
| packages/plugin-algolia/src/runtime/locales.ts | Updated Chinese locale translations to use v4 property names |
| packages/plugin-algolia/src/runtime/Search.css | Simplified CSS variables and improved theme handling |
| packages/plugin-algolia/tests/locales.test.ts | Added unit tests to verify v4 translation property migration |
| website/docs/zh/plugin/official-plugins/algolia.mdx | Updated Chinese documentation with v4 translation examples |
| website/docs/en/plugin/official-plugins/algolia.mdx | Updated English documentation with v4 translation examples |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.




This PR updates the
@rspress/plugin-algoliapackage to use docsearch v4.1.0, bringing the latest improvements and features from Algolia's DocSearch library.Changes Made
Package Dependencies
@docsearch/reactfrom^3.9.0to^4.1.0@docsearch/cssfrom^3.9.0to^4.1.0Breaking Changes Fixed
Docsearch v4 introduced several translation property name changes that required updates:
resetButtonTitle→clearButtonTitleresetButtonAriaLabel→clearButtonAriaLabelsearchByText→poweredByTextcancelButtonText→closeButtonTextcancelButtonAriaLabel→closeButtonAriaLabelThese changes were applied to:
src/runtime/locales.ts- Chinese locale translationswebsite/docs/zh/plugin/official-plugins/algolia.mdx- Chinese documentationwebsite/docs/en/plugin/official-plugins/algolia.mdx- English documentationTesting
Added comprehensive unit tests to verify the translation property migration is correct and that old v3 properties are no longer used.
Benefits
This upgrade provides access to docsearch v4's new features and improvements:
askAiprop for AI-assisted searchindicesprop (deprecates singleindexName)Backward Compatibility
✅ Zero breaking changes for end users - all existing configurations continue to work as before. The API surface remains identical, ensuring seamless upgrades.
Verification
Closes #[issue_number]
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.