Skip to content

Commit

Permalink
chore: switch to algoliasearch v5 (#1410)
Browse files Browse the repository at this point in the history
Pins dependencies used from the swizzled `SearchPage` component. The
undeclared dependencies were causing the documentation build to fail in
the dependent packages (e.g.
[here](https://github.com/apify/apify-cli/actions/runs/12755096920/job/35550383965)).

Removes the unused `@apify/docsearch-apify-docs` package from the
dependencies.
  • Loading branch information
barjin authored Jan 14, 2025
1 parent 468623d commit ae71d62
Show file tree
Hide file tree
Showing 4 changed files with 316 additions and 664 deletions.
2 changes: 2 additions & 0 deletions apify-docs-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"@apify/docs-search-modal": "^1.2.0",
"@docusaurus/theme-common": "3.7.0",
"@stackql/docusaurus-plugin-hubspot": "^1.1.0",
"algoliasearch": "^5.19.0",
"algoliasearch-helper": "^3.22.6",
"axios": "^1.7.9",
"babel-loader": "^9.2.1",
"docusaurus-gtm-plugin": "^0.0.2",
Expand Down
5 changes: 2 additions & 3 deletions apify-docs-theme/src/theme/SearchPage/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable */
import React, { useEffect, useReducer, useRef, useState } from 'react';
import clsx from 'clsx';
import { liteClient } from 'algoliasearch/lite';
import algoliaSearchHelper from 'algoliasearch-helper';
import algoliaSearch from 'algoliasearch/lite';
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
import Head from '@docusaurus/Head';
import { useAllDocsData } from '@docusaurus/plugin-content-docs/client';
Expand Down Expand Up @@ -117,7 +117,6 @@ function SearchPageContent() {
const {
algolia: { appId, apiKey, indexName },
} = useAlgoliaThemeConfig();
const processSearchResultUrl = useSearchResultUrlProcessor();
const documentsFoundPlural = useDocumentsFoundPlural();
const docsSearchVersionsHelpers = useDocsSearchVersionsHelpers();
const [searchQuery, setSearchQuery] = useSearchQueryString();
Expand Down Expand Up @@ -167,7 +166,7 @@ function SearchPageContent() {
},
initialSearchResultState,
);
const algoliaClient = algoliaSearch(appId, apiKey);
const algoliaClient = liteClient(appId, apiKey);
const algoliaHelper = algoliaSearchHelper(algoliaClient, indexName, {
hitsPerPage: 15,
advancedSyntax: true,
Expand Down
Loading

0 comments on commit ae71d62

Please sign in to comment.