Instantsearch.js: should configure be a connector?

Created on 16 Mar 2018  路  6Comments  路  Source: algolia/instantsearch.js

Right now configure is a widget which doesn't render anything, just like analytics.

PRO:

  • easier when we split up core and widgets
  • other libraries only need to handle connectors (not widgetFactories)

CON:

  • this might imply there's a value in multiple "kinds" of configure
  • we might need to handle refine
Connectors Widgets

Most helpful comment

After working with the Configure widget, in order to have it integrated in the angular-instantsearch library I'll add my +1 to this issue.

Also, @bobylito I think we should use the renderFn if any provided to the widget. I can see a widget with a debug: option where it prints on the page the configure search parameters applied like this:

<pre>
{
    hitsPerPage: 3,
    page: 1
}
</pre>

Also I think we should handle refine function if you want to update the searchParameters applied by Configure on the fly.

All 6 comments

Things to consider also:

  • a connector for configure (and for analytics) would be artificial because the render will not be used
  • in terms of semantic of the API, the connector is for widget that can be rendered. Implementing the configure as a connector, would change the semantic.

We are the implementors of the libraries so it's our burden to do the complex stuff so if having configure as widget is only painful for us, then it should not be done if it's easier for our users to understand as it is. From the pro / con list you made I see difficulties for users to understand the widget / connector, and a burden that we can handle (not too complex).

Well I mean for users it can still have a widget too

Well I mean for users it can still have a widget too

Yes :) But the connector will be exposed and with it the fact that it's special, there will be no general rule for thinking about connectors. Now it's a no-brainer, a connector has a rendering that.

You can make a simple wrapper for faking the connector API in Vue (or angular)

After working with the Configure widget, in order to have it integrated in the angular-instantsearch library I'll add my +1 to this issue.

Also, @bobylito I think we should use the renderFn if any provided to the widget. I can see a widget with a debug: option where it prints on the page the configure search parameters applied like this:

<pre>
{
    hitsPerPage: 3,
    page: 1
}
</pre>

Also I think we should handle refine function if you want to update the searchParameters applied by Configure on the fly.

Can you consolidate your thoughts and move forward with an API? @Haroenv @iam4x

Was this page helpful?
0 / 5 - 0 ratings