@sitecore-jss/sitecore-jss-react 21.3.0-canary.7 → 21.3.0-canary.8
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.
|
@@ -46,7 +46,7 @@ exports.FEAAS_COMPONENT_RENDERING_NAME = 'FEaaSComponent';
|
|
|
46
46
|
const FEaaSComponent = (props) => {
|
|
47
47
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
48
48
|
const computedRevision = ((_a = props.params) === null || _a === void 0 ? void 0 : _a.ComponentRevision) || props.revisionFallback;
|
|
49
|
-
if (
|
|
49
|
+
if (!props.template &&
|
|
50
50
|
(!props.params ||
|
|
51
51
|
!props.params.LibraryId ||
|
|
52
52
|
!props.params.ComponentId ||
|
|
@@ -73,7 +73,7 @@ const FEaaSComponent = (props) => {
|
|
|
73
73
|
// FEaaS control would still be hydrated by client
|
|
74
74
|
// we pass all the props as a workaround to avoid hydration error, until we convert all JSS components to server side
|
|
75
75
|
// this also allows component to fall back to full client-side rendering when template or src is empty
|
|
76
|
-
return (react_1.default.createElement(FEAAS.Component, { data: data, template: props.template || '',
|
|
76
|
+
return (react_1.default.createElement(FEAAS.Component, { data: data, template: props.template || '', cdn: (_c = props.params) === null || _c === void 0 ? void 0 : _c.ComponentHostName, library: (_d = props.params) === null || _d === void 0 ? void 0 : _d.LibraryId, version: (_e = props.params) === null || _e === void 0 ? void 0 : _e.ComponentVersion, component: (_f = props.params) === null || _f === void 0 ? void 0 : _f.ComponentId, instance: (_g = props.params) === null || _g === void 0 ? void 0 : _g.ComponentInstanceId, revision: computedRevision }));
|
|
77
77
|
};
|
|
78
78
|
exports.FEaaSComponent = FEaaSComponent;
|
|
79
79
|
/**
|
|
@@ -88,11 +88,10 @@ function fetchFEaaSComponentServerProps(params, pageState, endpointOverride) {
|
|
|
88
88
|
const revisionFallback = pageState && pageState !== layout_1.LayoutServicePageState.Normal ? 'staged' : 'published';
|
|
89
89
|
const src = endpointOverride || (0, exports.composeComponentEndpoint)(params, revisionFallback);
|
|
90
90
|
try {
|
|
91
|
-
const { template
|
|
91
|
+
const { template } = yield FEAAS.fetchComponent(src);
|
|
92
92
|
return {
|
|
93
93
|
revisionFallback,
|
|
94
94
|
template,
|
|
95
|
-
lastModified,
|
|
96
95
|
};
|
|
97
96
|
}
|
|
98
97
|
catch (e) {
|
|
@@ -17,7 +17,7 @@ export const FEAAS_COMPONENT_RENDERING_NAME = 'FEaaSComponent';
|
|
|
17
17
|
export const FEaaSComponent = (props) => {
|
|
18
18
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
19
19
|
const computedRevision = ((_a = props.params) === null || _a === void 0 ? void 0 : _a.ComponentRevision) || props.revisionFallback;
|
|
20
|
-
if (
|
|
20
|
+
if (!props.template &&
|
|
21
21
|
(!props.params ||
|
|
22
22
|
!props.params.LibraryId ||
|
|
23
23
|
!props.params.ComponentId ||
|
|
@@ -44,7 +44,7 @@ export const FEaaSComponent = (props) => {
|
|
|
44
44
|
// FEaaS control would still be hydrated by client
|
|
45
45
|
// we pass all the props as a workaround to avoid hydration error, until we convert all JSS components to server side
|
|
46
46
|
// this also allows component to fall back to full client-side rendering when template or src is empty
|
|
47
|
-
return (React.createElement(FEAAS.Component, { data: data, template: props.template || '',
|
|
47
|
+
return (React.createElement(FEAAS.Component, { data: data, template: props.template || '', cdn: (_c = props.params) === null || _c === void 0 ? void 0 : _c.ComponentHostName, library: (_d = props.params) === null || _d === void 0 ? void 0 : _d.LibraryId, version: (_e = props.params) === null || _e === void 0 ? void 0 : _e.ComponentVersion, component: (_f = props.params) === null || _f === void 0 ? void 0 : _f.ComponentId, instance: (_g = props.params) === null || _g === void 0 ? void 0 : _g.ComponentInstanceId, revision: computedRevision }));
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
50
50
|
* Fetches server component props required for server rendering, based on rendering params.
|
|
@@ -58,11 +58,10 @@ export function fetchFEaaSComponentServerProps(params, pageState, endpointOverri
|
|
|
58
58
|
const revisionFallback = pageState && pageState !== LayoutServicePageState.Normal ? 'staged' : 'published';
|
|
59
59
|
const src = endpointOverride || composeComponentEndpoint(params, revisionFallback);
|
|
60
60
|
try {
|
|
61
|
-
const { template
|
|
61
|
+
const { template } = yield FEAAS.fetchComponent(src);
|
|
62
62
|
return {
|
|
63
63
|
revisionFallback,
|
|
64
64
|
template,
|
|
65
|
-
lastModified,
|
|
66
65
|
};
|
|
67
66
|
}
|
|
68
67
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-react",
|
|
3
|
-
"version": "21.3.0-canary.
|
|
3
|
+
"version": "21.3.0-canary.8",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@sitecore-feaas/clientside": "^0.3.0",
|
|
65
|
-
"@sitecore-jss/sitecore-jss": "^21.3.0-canary.
|
|
65
|
+
"@sitecore-jss/sitecore-jss": "^21.3.0-canary.8",
|
|
66
66
|
"deep-equal": "^2.1.0",
|
|
67
67
|
"prop-types": "^15.8.1",
|
|
68
68
|
"style-attr": "^1.3.0"
|
|
69
69
|
},
|
|
70
70
|
"description": "",
|
|
71
71
|
"types": "types/index.d.ts",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "2a01b06496419ec098c6e66875ebd43069014c1a",
|
|
73
73
|
"files": [
|
|
74
74
|
"dist",
|
|
75
75
|
"types"
|
|
@@ -24,10 +24,6 @@ type FEaaSComponentServerProps = {
|
|
|
24
24
|
* HTML template for presentation rendered inside the component
|
|
25
25
|
*/
|
|
26
26
|
template?: string;
|
|
27
|
-
/**
|
|
28
|
-
* the date component data was last modified
|
|
29
|
-
*/
|
|
30
|
-
lastModified?: string;
|
|
31
27
|
/**
|
|
32
28
|
* Default revision to be fetched. Should be 'staged' for editing/preview. Can be overriden by params.ComponentRevision
|
|
33
29
|
*/
|