instantsearch
instantsearch copied to clipboard
Connectors API inconsistencies
There are some inconsistencies in the connectors API, this issue is aimed to list them. Then we can tackle when we move the lib to the v3. Those inconsistencies are mainly inside the widgetParams & renderOptions.
-
connectCurrentRefinements(previouslyconnectCurrentRefinedValues)-
renderOptions
-
Boolean(refinements.length)→canRefine
-
-
renderOptions
-
connectHierarchicalMenu(previouslyconnectNumericRefinementList)-
renderOptions
-
Boolean(items.length)→canRefine
-
-
renderOptions
-
connectNumericMenu(previouslyconnectNumericRefinementList)-
behaviour
- The React InstantSearch implementation uses a disjunctive facet to retrieve the stats related to this facet. Then we disable the provided range that are not available on the facet. Do we want to replicate this behaviour?
-
widgetParams
-
options→items -
items[].name→items[].label
-
-
renderOptions
-
hasNoResults→canRefine -
items[].value→ encodeURL is really required? Thevalueattribute is required onradioelements. The encoded value is not accessible but we could use10:100then parse the value back in the connector.
-
-
behaviour
Here are all the other inconsistencies and things we should fix in the next major:
Configure
- Pass
searchParametersvia the render params (notwidgetParams)
ClearRefinements
- Rename
hasRefinementstocanRefine✔️
CurrentRefinements
- Add
canRefine✔️
HierarchicalMenu
- Add
canRefine✔️
HitsPerPage
- Remove
hasNoResults? ✔️
NumericMenu
- Remove
hasNoResults✔️ - Add
canRefine✔️
Pagination
- Add
canRefine✔️
Range
- Remove
format - Pass
precisionas render param, not in widget params - Remove
start? (no sure what it's for)
RatingMenu
- Remove
hasNoResults✔️ - Add
canRefine✔️
RefinementList
- Add
canRefine✔️
SearchBox
- Rename
querytocurrentRefinement?
SortBy
- Remove
hasNoResults✔️ - Add
canRefine✔️
Stats
- Remove in favor of
connectSearch? (currently calledconnectStateResults)
canRefine is now available on all relevant connectors
So this can be closed?
Not sure, some of the other items listed here are not yet solved, but they probably should be moved to individual issues (or tickets) before closing this issues