Importing instantsearch.js into Vue component

Hi,

Based on this post https://github.com/algolia/instantsearch.js/issues/2168 I’ve gone ahead and imported instantsearch into a Vue component using:

import instantsearch, { connectors, widgets } from 'instantsearch.js/dist/instantsearch';

Is this the recommended and stable, long term approach? I know there’s no guarantee but just checking this is best practice before we roll it out on production.

Thanks

Why don’t you use Vue InstantSearch? It’s made to use in Vue.

this is indeed the correct guide to follow: https://community.algolia.com/instantsearch.js/v2/guides/usage.html#optimize-your-build-with-tree-shaking

Great thanks.
Tried vue instant search but I have a project requirement for the refinement list to show in the urlSync.
From work I did previously I only managed to get the query to sync via vue router and not the refinement list unfortunately. Shame though as vue instansratch is really nice.

I’m importing instantsesrch js into a vue instance as thought could use vue data in amongst the layout. Not had to do so though so far so may alas switch to vanilla instant search.js at some point :upside_down_face:

Thanks for the quick reply.

Can you describe what you tried to make url sync work with refinement list, if you had problems with it, we should fix those in the guide.

Thanks

Hi @haroen, I think it may still be open on here:
https://github.com/algolia/vue-instantsearch/issues/178

Many thanks