-
Notifications
You must be signed in to change notification settings - Fork 531
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(helper): remove getRefinements, hasRefinements #6570
Conversation
const hasRefinements = | ||
window.search.renderState['instant_search'].clearRefinements?.canRefine; |
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.
normally you can directly read the renderState, but in the layout of this example, the widgets are in standalone files, and we can't import search
or it would be circular.
Could be interesting in the future if templates got access to InstantSearch instance or parent.
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 b9e052f:
|
b1b5e4f
to
32f50ac
Compare
These functions are an aggregate of multiple different functions that depend on the type of refinement you're using. It's better to use the getter for the right type of refinement. BREAKING CHANGE: remove helper.hasRefinements (use helper.state.isXXXRefined instead) BREAKING CHANGE: remove helper.getRefinements (read helper.state.XXXRefinement instead) BREAKING CHANGE: remove helper.state.getRefinements (read helper.state.XXXRefinement instead)
d57df09
to
b9e052f
Compare
These functions are an aggregate of multiple different functions that depend on the type of refinement you're using. It's better to use the getter for the right type of refinement. BREAKING CHANGE: remove helper.hasRefinements (use helper.state.isXXXRefined instead) BREAKING CHANGE: remove helper.getRefinements (read helper.state.XXXRefinement instead) BREAKING CHANGE: remove helper.state.getRefinements (read helper.state.XXXRefinement instead)
These functions are an aggregate of multiple different functions that depend on the type of refinement you're using. It's better to use the getter for the right type of refinement.
These functions are also not used in InstantSearch, as current refinements and clear refinements "re-implement" most of its logic to match the refinement to the right widget.
BREAKING CHANGE: remove helper.hasRefinements (use helper.state.isXXXRefined instead)
BREAKING CHANGE: remove helper.getRefinements (read helper.state.XXXRefinement instead)
BREAKING CHANGE: remove helper.state.getRefinements (read helper.state.XXXRefinement instead)
bundle size impact: -0.5kb min gz on the helper