react-instantsearch-nextjs 1.1.2 → 1.1.3
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.
|
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "useNextHeaders", {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
var _type_of = require("@swc/helpers/_/_type_of");
|
|
13
|
+
var _headers = require("next/headers");
|
|
13
14
|
var _react = require("react");
|
|
14
15
|
function isPromise(obj) {
|
|
15
16
|
return obj !== null && ((typeof obj === "undefined" ? "undefined" : _type_of._(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
|
|
@@ -17,9 +18,7 @@ function isPromise(obj) {
|
|
|
17
18
|
var useNextHeaders = function useNextHeaders() {
|
|
18
19
|
var isServer = typeof window === 'undefined';
|
|
19
20
|
if (isServer) {
|
|
20
|
-
|
|
21
|
-
var nextHeadersModule = require('next/headers');
|
|
22
|
-
var nextHeaders = nextHeadersModule.headers();
|
|
21
|
+
var nextHeaders = (0, _headers.headers)();
|
|
23
22
|
return isPromise(nextHeaders) ? (0, _react.use)(nextHeaders) : nextHeaders;
|
|
24
23
|
}
|
|
25
24
|
return undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _$1 } from '@swc/helpers/
|
|
2
|
-
import { _ } from '@swc/helpers/
|
|
1
|
+
import { _ as _$1 } from '@swc/helpers/esm/_object_spread.js';
|
|
2
|
+
import { _ } from '@swc/helpers/esm/_object_spread_props.js';
|
|
3
3
|
import { getInitialResults } from 'instantsearch.js/es/lib/server.js';
|
|
4
4
|
import { resetWidgetId, walkIndex } from 'instantsearch.js/es/lib/utils/index.js';
|
|
5
5
|
import { ServerInsertedHTMLContext } from 'next/navigation.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as _$2 } from '@swc/helpers/
|
|
2
|
-
import { _ as _$1 } from '@swc/helpers/
|
|
3
|
-
import { _ } from '@swc/helpers/
|
|
1
|
+
import { _ as _$2 } from '@swc/helpers/esm/_object_spread.js';
|
|
2
|
+
import { _ as _$1 } from '@swc/helpers/esm/_object_spread_props.js';
|
|
3
|
+
import { _ } from '@swc/helpers/esm/_object_without_properties.js';
|
|
4
4
|
import { safelyRunOnBrowser } from 'instantsearch.js/es/lib/utils/index.js';
|
|
5
5
|
import React, { useRef, useEffect } from 'react';
|
|
6
6
|
import { InstantSearch, InstantSearchRSCContext, InstantSearchSSRContext } from 'react-instantsearch-core';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _$1 } from '@swc/helpers/
|
|
2
|
-
import { _ } from '@swc/helpers/
|
|
1
|
+
import { _ as _$1 } from '@swc/helpers/esm/_object_spread.js';
|
|
2
|
+
import { _ } from '@swc/helpers/esm/_type_of.js';
|
|
3
3
|
import historyRouter from 'instantsearch.js/es/lib/routers/history.js';
|
|
4
4
|
import { usePathname, useSearchParams } from 'next/navigation.js';
|
|
5
5
|
import { useRef, useEffect } from 'react';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { _ } from '@swc/helpers/
|
|
1
|
+
import { _ } from '@swc/helpers/esm/_type_of.js';
|
|
2
|
+
import { headers } from 'next/headers.js';
|
|
2
3
|
import { use } from 'react';
|
|
3
4
|
|
|
4
5
|
function isPromise(obj) {
|
|
@@ -7,9 +8,7 @@ function isPromise(obj) {
|
|
|
7
8
|
var useNextHeaders = function useNextHeaders() {
|
|
8
9
|
var isServer = typeof window === 'undefined';
|
|
9
10
|
if (isServer) {
|
|
10
|
-
|
|
11
|
-
var nextHeadersModule = require('next/headers');
|
|
12
|
-
var nextHeaders = nextHeadersModule.headers();
|
|
11
|
+
var nextHeaders = headers();
|
|
13
12
|
return isPromise(nextHeaders) ? use(nextHeaders) : nextHeaders;
|
|
14
13
|
}
|
|
15
14
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-instantsearch-nextjs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "React InstantSearch SSR utilities for Next.js",
|
|
5
5
|
"types": "dist/es/index.d.ts",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@playwright/test": "1.49.1",
|
|
55
|
-
"instantsearch.js": "4.92.
|
|
55
|
+
"instantsearch.js": "4.92.1",
|
|
56
56
|
"next": "16.0.7",
|
|
57
|
-
"react-instantsearch-core": "7.28.
|
|
57
|
+
"react-instantsearch-core": "7.28.1",
|
|
58
58
|
"start-server-and-test": "1.15.3",
|
|
59
59
|
"ts-node": "8.4.1"
|
|
60
60
|
},
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"next": ">= 13.4 < 17",
|
|
63
63
|
"react-instantsearch": ">= 7.1.0 < 8"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "433e985bcf3fabb7d18828cbc7d341d26fc95f41"
|
|
66
66
|
}
|