Skip to content
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

Closed
wants to merge 8 commits into from

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Oct 6, 2021

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

@seafoox
Copy link
Member

seafoox commented Oct 6, 2021

Can you please provide an example for each of the case

  • Default behaviour with * used
  • Sequential behaviour where we wait the response from the first query in order to know what facet to retrieve value for.

I think understand that people would need to use wildcardFacets=true|false, but would like to confirm my understanding.

Thanks,

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 7, 2021

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:

Sandbox Source
InstantSearch.js Configuration

@Haroenv
Copy link
Contributor Author

Haroenv commented Oct 8, 2021

different scenarios:

@Haroenv Haroenv marked this pull request as ready for review October 8, 2021 09:35
Copy link
Member

@francoischalifour francoischalifour left a 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]);
Copy link
Contributor Author

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 🤔

@Haroenv Haroenv marked this pull request as draft October 15, 2021 09:51
@Haroenv Haroenv closed this Oct 26, 2021
@Haroenv Haroenv deleted the feat/dynamic-wildcard branch October 26, 2021 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants