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(dynamicWidgets): request wildcard facets by default #4917
Conversation
Can you please provide an example for each of the case
I think understand that people would need to use wildcardFacets=true|false, but would like to confirm my understanding. Thanks, |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 9fae8cb:
|
different scenarios:
|
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.
Explaining another user-land solution so we can track it and document it:
If users have too many facets in their index and that wildcardFacets
is too expensive (in terms of parsing the API response), they can mount a configure
widget to declare the facets required at initial load.
(In any way, none of these solutions works with an initial UI state.)
const search = castToJestMock(searchClient.search); | ||
|
||
expect(search).toHaveBeenCalledTimes(2); | ||
expect(search.mock.calls[0]).toEqual(search.mock.calls[1]); |
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.
this test fails now as the second request also has maxValuesPerFacet
🤔
Summary
make sure only one network request happens on mount of dynamic widgets, and no extra request when the requested widgets change
Result
use algolia/algoliasearch-helper-js#874 if the wildcard is requested