From e47e6b5e42927caa982f77941394d95f08c998d3 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Fri, 29 Nov 2024 13:40:23 +0100 Subject: [PATCH] refactor(vue): replace instantsearch.js with instantsearch-core (#6440) * refactor(vue): replace instantsearch.js with instantsearch-core [FX-3069] BREAKING CHANGE: if you are using any internal instantsearch.js functions, ensure to update to instantsearch-core to avoid duplication * fix! * fix for vue 2 * hup * prevent double search --- examples/vue/default-theme/package.json | 2 +- examples/vue/default-theme/src/App.vue | 5 +- examples/vue/e-commerce/package.json | 2 +- examples/vue/e-commerce/src/routing.js | 2 +- .../src/widgets/ClearRefinements.vue | 2 +- .../vue/e-commerce/src/widgets/NoResults.vue | 2 +- examples/vue/getting-started/package.json | 2 +- examples/vue/media/package.json | 2 +- examples/vue/media/src/App.vue | 5 +- .../__mocks__/instantsearch.js/es.js | 73 --------- packages/vue-instantsearch/package.json | 2 +- .../src/__tests__/common-connectors.test.js | 3 +- .../src/__tests__/common-shared.test.js | 3 +- .../src/__tests__/common-widgets.test.js | 6 +- .../vue-instantsearch/src/__tests__/index.js | 7 +- .../src/components/Autocomplete.vue | 2 +- .../src/components/Breadcrumb.vue | 2 +- .../src/components/ClearRefinements.vue | 2 +- .../src/components/Configure.js | 2 +- .../src/components/CurrentRefinements.vue | 2 +- .../src/components/DynamicWidgets.js | 2 +- .../src/components/HierarchicalMenu.vue | 2 +- .../src/components/Highlighter.js | 4 +- .../vue-instantsearch/src/components/Hits.js | 2 +- .../src/components/HitsPerPage.vue | 2 +- .../vue-instantsearch/src/components/Index.js | 2 +- .../src/components/InfiniteHits.vue | 2 +- .../src/components/InstantSearch.js | 2 +- .../vue-instantsearch/src/components/Menu.vue | 2 +- .../src/components/MenuSelect.vue | 2 +- .../src/components/NumericMenu.vue | 2 +- .../src/components/Pagination.vue | 2 +- .../src/components/QueryRuleContext.js | 2 +- .../src/components/QueryRuleCustomData.vue | 2 +- .../src/components/RangeInput.vue | 2 +- .../src/components/RatingMenu.vue | 2 +- .../src/components/RefinementList.vue | 2 +- .../src/components/RelevantSort.vue | 2 +- .../src/components/SearchBox.vue | 2 +- .../src/components/SortBy.vue | 2 +- .../src/components/Stats.vue | 2 +- .../src/components/ToggleRefinement.vue | 2 +- .../src/components/VoiceSearch.vue | 2 +- .../src/components/__Template.vue | 2 +- .../src/components/__tests__/Highlight.js | 2 - .../components/__tests__/Index-integration.js | 4 +- .../__tests__/InstantSearch-integration.js | 1 - .../src/components/__tests__/InstantSearch.js | 139 ++++++++++++------ .../components/__tests__/InstantSearchSsr.js | 4 +- .../src/components/__tests__/Snippet.js | 2 - .../__tests__/createServerRootMixin.test.js | 2 - .../src/util/createInstantSearchComponent.js | 19 ++- .../src/util/createServerRootMixin.js | 4 +- .../src/util/parseAlgoliaHit.js | 2 +- 54 files changed, 162 insertions(+), 195 deletions(-) delete mode 100644 packages/vue-instantsearch/__mocks__/instantsearch.js/es.js diff --git a/examples/vue/default-theme/package.json b/examples/vue/default-theme/package.json index ef08014f27..e5b298a77c 100644 --- a/examples/vue/default-theme/package.json +++ b/examples/vue/default-theme/package.json @@ -10,7 +10,7 @@ "dependencies": { "algoliasearch": "5.1.1", "core-js": "2", - "instantsearch.js": "4.75.5", + "instantsearch-core": "0.1.0", "vue": "2.7.14", "vue-instantsearch": "4.19.11" }, diff --git a/examples/vue/default-theme/src/App.vue b/examples/vue/default-theme/src/App.vue index 418c118e75..ab88a3e68c 100644 --- a/examples/vue/default-theme/src/App.vue +++ b/examples/vue/default-theme/src/App.vue @@ -124,8 +124,7 @@