Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
2d1d9c9
feat(search): update Docsearch to v4-beta
dylantientcheu Jul 15, 2025
a990dfd
fix: update search docs
dylantientcheu Jul 15, 2025
9a72c17
fix: checks
dylantientcheu Jul 16, 2025
4752b94
fix: replace search by, by powered by
dylantientcheu Jul 16, 2025
0233bda
fix(askai): add facet filters
dylantientcheu Jul 22, 2025
8766d31
Merge branch 'main' into algolia/docsearch-v4
dylantientcheu Jul 22, 2025
e771fb1
fix: factor out string typecheck
dylantientcheu Jul 23, 2025
53ff498
Merge branch 'algolia/docsearch-v4' of https://github.com/dylantientc…
dylantientcheu Jul 23, 2025
4fed7f0
fix: based on comments
dylantientcheu Jul 29, 2025
b7c60c5
fixup: resolve comments
dylantientcheu Aug 11, 2025
6b2aa00
fix: version range
dylantientcheu Aug 16, 2025
4c407ca
fix AskAI spelling in comments
slorber Sep 4, 2025
5c53a49
fix little hydration mismatch due to CSS optimizations
slorber Sep 4, 2025
e00b8c9
various type improvements
slorber Sep 4, 2025
769413d
improve config validation
slorber Sep 5, 2025
8714e68
upgrade algolia packages
slorber Sep 5, 2025
8bf3581
restore AskAI feature until PR ready
slorber Sep 5, 2025
1e9a895
docs
slorber Sep 5, 2025
5f4ef65
docs
slorber Sep 5, 2025
fd71b7a
remove useless optional types for translations
slorber Sep 5, 2025
ec4c09a
restore former translation key order to easy code review
slorber Sep 5, 2025
b0d6b10
add useful v4 upgrade TODO
slorber Sep 5, 2025
ae20d65
add missing translations + upgrade base locale file
slorber Sep 5, 2025
f2f6c07
lint fix
slorber Sep 5, 2025
d827805
simplify code and types
slorber Sep 5, 2025
7552028
improve config validation + add proper input type
slorber Sep 5, 2025
54a1263
Add facetFilters validation logic + fallback
slorber Sep 5, 2025
9a8a8c0
damn, forgot about contextualSearch...
slorber Sep 5, 2025
6ec5aff
Merge branch 'main' into algolia/docsearch-v4
slorber Sep 11, 2025
0bade16
extract mergeFacetFilters utils
slorber Sep 11, 2025
7404454
fix type of useAlgoliaContextualFacetFilters
slorber Sep 11, 2025
6ab1a5f
add unit tests for mergeFacetFilters
slorber Sep 11, 2025
abedf6b
implement applyAskAiContextualSearch
slorber Sep 11, 2025
25d3327
fix attr
slorber Sep 11, 2025
9679da8
fix type
slorber Sep 11, 2025
2687d6b
add todo
slorber Sep 11, 2025
30678fd
improve v3 TS retro-compatibility
slorber Sep 11, 2025
98d9b14
lint issue
slorber Sep 11, 2025
ea81dec
restore DocSearch v4
slorber Sep 12, 2025
9b49752
improve Algolia accepted themeConfig typing + type tests
slorber Sep 12, 2025
d42b7c6
remove useless ESLint todos?
slorber Sep 12, 2025
8cebd98
remove useless navbarSearchContainer vertical padding: item is alread…
slorber Sep 12, 2025
4a1bbd5
remove useless css
slorber Sep 12, 2025
0382b6f
add useful comment
slorber Sep 12, 2025
c0bca41
revert props spread behavior change
slorber Sep 12, 2025
c1c03b5
upgrade to DocSearch v4 GA
slorber Sep 16, 2025
b6521ea
Merge branch 'main' into algolia/docsearch-v4
slorber Sep 16, 2025
b82fa25
upgrade Zod to fix website typechecking issue
slorber Sep 16, 2025
b3ce80b
try to fix TS skipLibCheck=false problem for TS 5.1 CI
slorber Sep 16, 2025
1e1053b
try to fix DocSearch problem with TS 5.1 CI checks
slorber Sep 16, 2025
1d23aee
empty
slorber Sep 16, 2025
3920ce1
Upgrade to 4.0.1
slorber Sep 18, 2025
f56e21c
Merge branch 'main' into algolia/docsearch-v4
slorber Sep 19, 2025
f2895d6
try to fix CI issue
slorber Sep 19, 2025
cb60bab
try to fix CI issue
slorber Sep 19, 2025
8957643
try to fix the CI issues
slorber Sep 19, 2025
9efee55
revert to DocSearch v3 by default (for now)
slorber Sep 19, 2025
8fe7dfc
lockfile
slorber Sep 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ module.exports = {
'jest/prefer-expect-resolves': WARNING,
'jest/prefer-lowercase-title': [WARNING, {ignore: ['describe']}],
'jest/prefer-spy-on': WARNING,
'jest/prefer-to-be': WARNING,
'jest/prefer-to-be': OFF,
'jest/prefer-to-have-length': WARNING,
'jest/require-top-level-describe': ERROR,
'jest/valid-title': [
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@ jobs:
run: yarn build:website:fast

- name: TypeCheck website
# TODO temporary, remove TS skipLibCheck
# see https://github.com/facebook/docusaurus/pull/10486
run: yarn workspace website typecheck --project tsconfig.skipLibCheck.json
run: yarn workspace website typecheck
- name: TypeCheck website - min version - v5.1
run: |
yarn add typescript@5.1.6 --exact -D -W --ignore-scripts

# DocSearch@4/ai@5 doesn't support TS 5.1 (with skipLibCheck=false)
jq '.resolutions."@docsearch/react" = "^3.9.0"' package.json > package.json.tmp && mv -Force package.json.tmp package.json
yarn add @docsearch/react@^3.9.0 --exact -D -W --ignore-scripts

yarn workspace website typecheck
- name: TypeCheck website - max version - Latest
# For latest TS there are often lib check errors, so we disable it
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@ jobs:
run: yarn workspace website test:css-order

- name: TypeCheck website
# TODO temporary, remove TS skipLibCheck
# see https://github.com/facebook/docusaurus/pull/10486
run: yarn workspace website typecheck --project tsconfig.skipLibCheck.json
run: yarn workspace website typecheck
- name: TypeCheck website - min version - v5.1
run: |
yarn add typescript@5.1.6 --exact -D -W --ignore-scripts

# DocSearch@4/ai@5 doesn't support TS 5.1 (with skipLibCheck=false)
jq '.resolutions."@docsearch/react" = "^3.9.0"' package.json > package.json.tmp && mv -f package.json.tmp package.json
yarn add @docsearch/react@^3.9.0 --exact -D -W --ignore-scripts

yarn workspace website typecheck
- name: TypeCheck website - max version - Latest
# For latest TS there are often lib check errors, so we disable it
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,8 @@
"stylelint-config-standard": "^29.0.0",
"typescript": "~5.8.2"
},
"resolutions": {
"@docsearch/react": "^4.0.1"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ See https://github.com/facebook/docusaurus/pull/9385

@media (min-width: 997px) {
.navbarSearchContainer {
padding: var(--ifm-navbar-item-padding-vertical)
var(--ifm-navbar-item-padding-horizontal);
padding: 0 var(--ifm-navbar-item-padding-horizontal);
}
}
4 changes: 2 additions & 2 deletions packages/docusaurus-theme-search-algolia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"@docusaurus/theme-translations": "3.8.1",
"@docusaurus/utils": "3.8.1",
"@docusaurus/utils-validation": "3.8.1",
"algoliasearch": "^5.17.1",
"algoliasearch-helper": "^3.22.6",
"algoliasearch": "^5.37.0",
"algoliasearch-helper": "^3.26.0",
"clsx": "^2.0.0",
"eta": "^2.2.0",
"fs-extra": "^11.1.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import {mergeFacetFilters} from '../client/utils';

describe('mergeFacetFilters', () => {
it('merges [string,string]', () => {
expect(mergeFacetFilters('f1', 'f2')).toEqual(['f1', 'f2']);
});

it('merges [string,array]', () => {
// TODO this looks wrong to me, should be ['f1', ['f2', 'f3']] ?
expect(mergeFacetFilters('f1', ['f2', 'f3'])).toEqual(['f1', 'f2', 'f3']);
});

it('merges [string,undefined]', () => {
expect(mergeFacetFilters('f1', undefined)).toEqual('f1');
});

it('merges [undefined,string]', () => {
expect(mergeFacetFilters(undefined, 'f1')).toEqual('f1');
});

it('merges [array,undefined]', () => {
expect(mergeFacetFilters(['f1', 'f2'], undefined)).toEqual(['f1', 'f2']);
});

it('merges [undefined,array]', () => {
expect(mergeFacetFilters(undefined, ['f1', 'f2'])).toEqual(['f1', 'f2']);
});

it('merges [array,array]', () => {
expect(mergeFacetFilters(['f1'], ['f2'])).toEqual(['f1', 'f2']);

// TODO this looks wrong to me, should be [['f1', 'f2'], ['f3', 'f4']] ?
expect(mergeFacetFilters(['f1', 'f2'], ['f3', 'f4'])).toEqual([
'f1',
'f2',
'f3',
'f4',
]);
});
});
Loading
Loading