@sitecore-jss/sitecore-jss-nextjs 21.1.0-canary.7 → 21.1.0-canary.9
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.
|
@@ -38,7 +38,8 @@ class PersonalizeMiddleware {
|
|
|
38
38
|
}
|
|
39
39
|
if (response.redirected || // Don't attempt to personalize a redirect
|
|
40
40
|
this.isPreview(req) || // No need to personalize for preview (layout data is already prepared for preview)
|
|
41
|
-
|
|
41
|
+
this.excludeRoute(pathname) ||
|
|
42
|
+
(this.config.excludeRoute && this.config.excludeRoute(pathname))) {
|
|
42
43
|
sitecore_jss_1.debug.personalize('skipped (%s)', response.redirected ? 'redirected' : this.isPreview(req) ? 'preview' : 'route excluded');
|
|
43
44
|
return response;
|
|
44
45
|
}
|
|
@@ -95,10 +96,11 @@ class PersonalizeMiddleware {
|
|
|
95
96
|
// (underlying default 'cross-fetch' is not currently compatible: https://github.com/lquixada/cross-fetch/issues/78)
|
|
96
97
|
this.personalizeService = new personalize_1.GraphQLPersonalizeService(Object.assign(Object.assign({}, config.edgeConfig), { fetch: fetch }));
|
|
97
98
|
// NOTE: same here, we provide NativeDataFetcher for compatibility on Next.js Edge Runtime
|
|
98
|
-
this.cdpService = new personalize_1.CdpService(Object.assign(Object.assign({}, config.cdpConfig), { dataFetcherResolver: ({ timeout }) => {
|
|
99
|
+
this.cdpService = new personalize_1.CdpService(Object.assign(Object.assign({}, config.cdpConfig), { dataFetcherResolver: ({ timeout, headers, }) => {
|
|
99
100
|
const fetcher = new sitecore_jss_1.NativeDataFetcher({
|
|
100
101
|
debugger: sitecore_jss_1.debug.personalize,
|
|
101
102
|
timeout,
|
|
103
|
+
headers,
|
|
102
104
|
});
|
|
103
105
|
return (url, data) => fetcher.fetch(url, data);
|
|
104
106
|
} }));
|
|
@@ -35,7 +35,8 @@ export class PersonalizeMiddleware {
|
|
|
35
35
|
}
|
|
36
36
|
if (response.redirected || // Don't attempt to personalize a redirect
|
|
37
37
|
this.isPreview(req) || // No need to personalize for preview (layout data is already prepared for preview)
|
|
38
|
-
|
|
38
|
+
this.excludeRoute(pathname) ||
|
|
39
|
+
(this.config.excludeRoute && this.config.excludeRoute(pathname))) {
|
|
39
40
|
debug.personalize('skipped (%s)', response.redirected ? 'redirected' : this.isPreview(req) ? 'preview' : 'route excluded');
|
|
40
41
|
return response;
|
|
41
42
|
}
|
|
@@ -92,10 +93,11 @@ export class PersonalizeMiddleware {
|
|
|
92
93
|
// (underlying default 'cross-fetch' is not currently compatible: https://github.com/lquixada/cross-fetch/issues/78)
|
|
93
94
|
this.personalizeService = new GraphQLPersonalizeService(Object.assign(Object.assign({}, config.edgeConfig), { fetch: fetch }));
|
|
94
95
|
// NOTE: same here, we provide NativeDataFetcher for compatibility on Next.js Edge Runtime
|
|
95
|
-
this.cdpService = new CdpService(Object.assign(Object.assign({}, config.cdpConfig), { dataFetcherResolver: ({ timeout }) => {
|
|
96
|
+
this.cdpService = new CdpService(Object.assign(Object.assign({}, config.cdpConfig), { dataFetcherResolver: ({ timeout, headers, }) => {
|
|
96
97
|
const fetcher = new NativeDataFetcher({
|
|
97
98
|
debugger: debug.personalize,
|
|
98
99
|
timeout,
|
|
100
|
+
headers,
|
|
99
101
|
});
|
|
100
102
|
return (url, data) => fetcher.fetch(url, data);
|
|
101
103
|
} }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-nextjs",
|
|
3
|
-
"version": "21.1.0-canary.
|
|
3
|
+
"version": "21.1.0-canary.9",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -70,16 +70,16 @@
|
|
|
70
70
|
"react-dom": "^18.1.0"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@sitecore-jss/sitecore-jss": "^21.1.0-canary.
|
|
74
|
-
"@sitecore-jss/sitecore-jss-dev-tools": "^21.1.0-canary.
|
|
75
|
-
"@sitecore-jss/sitecore-jss-react": "^21.1.0-canary.
|
|
73
|
+
"@sitecore-jss/sitecore-jss": "^21.1.0-canary.9",
|
|
74
|
+
"@sitecore-jss/sitecore-jss-dev-tools": "^21.1.0-canary.9",
|
|
75
|
+
"@sitecore-jss/sitecore-jss-react": "^21.1.0-canary.9",
|
|
76
76
|
"prop-types": "^15.7.2",
|
|
77
77
|
"regex-parser": "^2.2.11",
|
|
78
78
|
"sync-disk-cache": "^2.1.0"
|
|
79
79
|
},
|
|
80
80
|
"description": "",
|
|
81
81
|
"types": "types/index.d.ts",
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "4a2c3e38ee8e96be5a36efe093462de7037f1c33",
|
|
83
83
|
"files": [
|
|
84
84
|
"dist",
|
|
85
85
|
"types",
|