instantsearch.js 4.73.1 → 4.73.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/lib/server.js +4 -1
- package/cjs/lib/utils/hydrateSearchClient.js +6 -5
- package/cjs/lib/version.js +1 -1
- package/dist/instantsearch.development.d.ts +1 -1
- package/dist/instantsearch.development.js +12 -12
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +1 -1
- package/dist/instantsearch.production.min.d.ts +1 -1
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/lib/server.js +4 -1
- package/es/lib/utils/hydrateSearchClient.js +6 -5
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/types/results.d.ts +1 -1
- package/package.json +6 -6
package/es/lib/server.js
CHANGED
|
@@ -78,7 +78,10 @@ requestParamsList) {
|
|
|
78
78
|
var searchResults = widget.getResults();
|
|
79
79
|
var recommendResults = (_widget$getHelper = widget.getHelper()) === null || _widget$getHelper === void 0 ? void 0 : _widget$getHelper.lastRecommendResults;
|
|
80
80
|
if (searchResults || recommendResults) {
|
|
81
|
-
var
|
|
81
|
+
var _searchResults$_rawRe;
|
|
82
|
+
var resultsCount = (searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$_rawRe = searchResults._rawResults) === null || _searchResults$_rawRe === void 0 ? void 0 : _searchResults$_rawRe.length) || 0;
|
|
83
|
+
var requestParams = resultsCount ? requestParamsList === null || requestParamsList === void 0 ? void 0 : requestParamsList.slice(requestParamsIndex, requestParamsIndex + resultsCount) : [];
|
|
84
|
+
requestParamsIndex += resultsCount;
|
|
82
85
|
initialResults[widget.getIndexId()] = _objectSpread(_objectSpread(_objectSpread({}, searchResults && {
|
|
83
86
|
state: _objectSpread({}, searchResults._state),
|
|
84
87
|
results: searchResults._rawResults
|
|
@@ -22,19 +22,20 @@ export function hydrateSearchClient(client, results) {
|
|
|
22
22
|
if ((!('transporter' in client) || client._cacheHydrated) && (!client._useCache || typeof client.addAlgoliaAgent !== 'function')) {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
var cachedRequest = Object.keys(results).
|
|
25
|
+
var cachedRequest = [Object.keys(results).reduce(function (acc, key) {
|
|
26
26
|
var _results$key = results[key],
|
|
27
27
|
state = _results$key.state,
|
|
28
28
|
requestParams = _results$key.requestParams,
|
|
29
29
|
serverResults = _results$key.results;
|
|
30
|
-
|
|
30
|
+
var mappedResults = serverResults && state ? serverResults.map(function (result, idx) {
|
|
31
31
|
return _objectSpread({
|
|
32
32
|
indexName: state.index || result.index
|
|
33
|
-
}, requestParams || result.params ? {
|
|
34
|
-
params: serializeQueryParameters(requestParams || deserializeQueryParameters(result.params))
|
|
33
|
+
}, requestParams !== null && requestParams !== void 0 && requestParams[idx] || result.params ? {
|
|
34
|
+
params: serializeQueryParameters((requestParams === null || requestParams === void 0 ? void 0 : requestParams[idx]) || deserializeQueryParameters(result.params))
|
|
35
35
|
} : {});
|
|
36
36
|
}) : [];
|
|
37
|
-
|
|
37
|
+
return acc.concat(mappedResults);
|
|
38
|
+
}, [])];
|
|
38
39
|
var cachedResults = Object.keys(results).reduce(function (acc, key) {
|
|
39
40
|
var res = results[key].results;
|
|
40
41
|
if (!res) {
|
package/es/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "4.73.
|
|
1
|
+
declare const _default: "4.73.2";
|
|
2
2
|
export default _default;
|
package/es/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '4.73.
|
|
1
|
+
export default '4.73.2';
|
package/es/types/results.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ type InitialResult = {
|
|
|
72
72
|
params: RecommendParametersOptions['params'];
|
|
73
73
|
results: RecommendResults['_rawResults'];
|
|
74
74
|
};
|
|
75
|
-
requestParams?: SearchOptions;
|
|
75
|
+
requestParams?: SearchOptions[];
|
|
76
76
|
};
|
|
77
77
|
export type InitialResults = Record<string, InitialResult>;
|
|
78
78
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "instantsearch.js",
|
|
3
|
-
"version": "4.73.
|
|
3
|
+
"version": "4.73.2",
|
|
4
4
|
"description": "InstantSearch.js is a JavaScript library for building performant and instant search experiences with Algolia.",
|
|
5
5
|
"homepage": "https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/",
|
|
6
6
|
"types": "es/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@types/google.maps": "^3.45.3",
|
|
32
32
|
"@types/hogan.js": "^3.0.0",
|
|
33
33
|
"@types/qs": "^6.5.3",
|
|
34
|
-
"algoliasearch-helper": "3.22.
|
|
34
|
+
"algoliasearch-helper": "3.22.3",
|
|
35
35
|
"hogan.js": "^3.0.2",
|
|
36
36
|
"htm": "^3.0.0",
|
|
37
37
|
"instantsearch-ui-components": "0.7.0",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"watch:es": "yarn --silent build:es:base --watch"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@instantsearch/mocks": "1.
|
|
60
|
-
"@instantsearch/tests": "1.
|
|
61
|
-
"@instantsearch/testutils": "1.
|
|
59
|
+
"@instantsearch/mocks": "1.52.0",
|
|
60
|
+
"@instantsearch/tests": "1.52.0",
|
|
61
|
+
"@instantsearch/testutils": "1.41.0",
|
|
62
62
|
"@storybook/html": "5.3.9",
|
|
63
63
|
"@types/scriptjs": "0.0.2",
|
|
64
64
|
"algoliasearch": "4.23.2",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"scriptjs": "2.5.9",
|
|
67
67
|
"webpack": "4.47.0"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "48b1c946e13e917bc76a046894bbd89a7c4977fe"
|
|
70
70
|
}
|