Skip to content

Commit ea1a0e3

Browse files
committed
MAGE-999: algoliaBundle dependency removed from autocomplete.js
1 parent 4d1eb24 commit ea1a0e3

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

view/frontend/requirejs-config.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ var config = {
2020
}
2121
},
2222
paths : {
23-
'algoliaBundle' : 'Algolia_AlgoliaSearch/js/internals/algoliaBundle.min',
24-
'algoliaSearchLib' : 'Algolia_AlgoliaSearch/js/lib/algolia-search.min',
25-
'algoliaAutocompleteLib': 'Algolia_AlgoliaSearch/js/lib/algolia-autocomplete.min',
26-
'algoliaAnalytics' : 'Algolia_AlgoliaSearch/js/internals/search-insights',
27-
'recommend' : 'Algolia_AlgoliaSearch/js/internals/recommend.min',
28-
'recommendJs' : 'Algolia_AlgoliaSearch/js/internals/recommend-js.min',
29-
'rangeSlider' : 'Algolia_AlgoliaSearch/js/navigation/range-slider-widget',
23+
'algoliaBundle' : 'Algolia_AlgoliaSearch/js/internals/algoliaBundle.min',
24+
'algoliaSearchLib' : 'Algolia_AlgoliaSearch/js/lib/algolia-search.min',
25+
'algoliaAutocompleteLib' : 'Algolia_AlgoliaSearch/js/lib/algolia-autocomplete.min',
26+
'algoliaAnalytics' : 'Algolia_AlgoliaSearch/js/internals/search-insights',
27+
'querySuggestionsPluginLib' : 'Algolia_AlgoliaSearch/js/lib/query-suggestions-plugin.min',
28+
'recommend' : 'Algolia_AlgoliaSearch/js/internals/recommend.min',
29+
'recommendJs' : 'Algolia_AlgoliaSearch/js/internals/recommend-js.min',
30+
'rangeSlider' : 'Algolia_AlgoliaSearch/js/navigation/range-slider-widget',
3031
},
3132
deps : [
3233
'algoliaInstantSearch',

view/frontend/web/js/autocomplete.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ define([
33
'algoliaBundle',
44
'algoliaSearchLib',
55
'algoliaAutocompleteLib',
6+
'querySuggestionsPluginLib',
67
'pagesHtml',
78
'categoriesHtml',
89
'productsHtml',
@@ -17,6 +18,7 @@ define([
1718
algoliaBundle,
1819
algoliasearch,
1920
autocomplete,
21+
querySuggestionsPlugin,
2022
pagesHtml,
2123
categoriesHtml,
2224
productsHtml,
@@ -431,7 +433,7 @@ define([
431433
};
432434

433435
const buildSuggestionsPlugin = function () {
434-
return algoliaBundle.createQuerySuggestionsPlugin.createQuerySuggestionsPlugin(
436+
return querySuggestionsPlugin.createQuerySuggestionsPlugin(
435437
{
436438
searchClient,
437439
indexName: `${algoliaConfig.indexName}_suggestions`,
@@ -621,7 +623,7 @@ define([
621623
return;
622624
}
623625
const getItems = ({query}) => {
624-
return algoliaBundle.getAlgoliaResults({
626+
return autocomplete.getAlgoliaResults({
625627
searchClient,
626628
queries: [
627629
{
@@ -659,8 +661,8 @@ define([
659661
options = algolia.triggerHooks('afterAutocompleteOptions', options);
660662

661663
/** Bind autocomplete feature to the input */
662-
let algoliaAutocompleteInstance = algoliaBundle.autocomplete(options);
663-
algoliaAutocompleteInstance = algolia.triggerHooks(
664+
let algoliaAutocompleteInstance = autocomplete.autocomplete(options);
665+
algolia.triggerHooks(
664666
'afterAutocompleteStart',
665667
algoliaAutocompleteInstance
666668
);

view/frontend/web/js/lib/query-suggestions-plugin.min.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)