instantsearch icon indicating copy to clipboard operation
instantsearch copied to clipboard

Connectors API inconsistencies

Open samouss opened this issue 7 years ago • 4 comments

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 (previously connectCurrentRefinedValues)
    • renderOptions
      • Boolean(refinements.length)canRefine

  • connectHierarchicalMenu (previously connectNumericRefinementList)
    • renderOptions
      • Boolean(items.length)canRefine

  • connectNumericMenu (previously connectNumericRefinementList)
    • 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
      • optionsitems
      • items[].nameitems[].label
    • renderOptions
      • hasNoResultscanRefine
      • items[].valueencodeURL is really required? The value attribute is required on radio elements. The encoded value is not accessible but we could use 10:100 then parse the value back in the connector.

samouss avatar Aug 10 '18 09:08 samouss

Here are all the other inconsistencies and things we should fix in the next major:

Configure

  • Pass searchParameters via the render params (not widgetParams)

ClearRefinements

  • Rename hasRefinements to canRefine ✔️

CurrentRefinements

  • Add canRefine ✔️

HierarchicalMenu

  • Add canRefine ✔️

HitsPerPage

  • Remove hasNoResults? ✔️

NumericMenu

  • Remove hasNoResults✔️
  • Add canRefine✔️

Pagination

  • Add canRefine✔️

Range

  • Remove format
  • Pass precision as render param, not in widget params
  • Remove start? (no sure what it's for)

RatingMenu

  • Remove hasNoResults✔️
  • Add canRefine✔️

RefinementList

  • Add canRefine✔️

SearchBox

  • Rename query to currentRefinement?

SortBy

  • Remove hasNoResults✔️
  • Add canRefine✔️

Stats

  • Remove in favor of connectSearch? (currently called connectStateResults)

francoischalifour avatar Jan 22 '20 09:01 francoischalifour

canRefine is now available on all relevant connectors

Haroenv avatar Aug 17 '21 08:08 Haroenv

So this can be closed?

tkrugg avatar Aug 17 '21 10:08 tkrugg

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

Haroenv avatar Aug 17 '21 11:08 Haroenv