@lwrjs/lwc-ssr 0.10.0-alpha.0 → 0.10.0-alpha.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/README.md +8 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -96,10 +96,12 @@ LWR will automatically pass any root component attributes from a [template](http
|
|
|
96
96
|
|
|
97
97
|
#### Limitations
|
|
98
98
|
|
|
99
|
-
There are restrictions on component code for it to successfully render on the server. The `renderComponent()` function executes the [`constructor` and `connectedCallback`](https://developer.salesforce.com/docs/component-library/documentation/en/lwc/reference_lifecycle_hooks) of each component. This code must be **portable** or SSR will fail.
|
|
99
|
+
There are restrictions on component code for it to successfully render on the server. The `renderComponent()` function executes the [`constructor` and `connectedCallback`](https://developer.salesforce.com/docs/component-library/documentation/en/lwc/reference_lifecycle_hooks) of each component. This code must be [**portable**](#portability) or SSR will fail.
|
|
100
100
|
|
|
101
101
|
> Code is _portable_ when it can run in a headless environment, where there is no access to DOM APIs (eg: window).
|
|
102
102
|
|
|
103
|
+
[LWC synthetic shadow](https://www.npmjs.com/package/@lwc/synthetic-shadow) is not supported during SSR, so components must be able to run using [native shadow](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM).
|
|
104
|
+
|
|
103
105
|
### Loading data during SSR
|
|
104
106
|
|
|
105
107
|
Many components depend on external data and resources. LWR provides a `getPageData()` hook for developers to fetch data on the server. During SSR, LWR calls the `getPageData()` hook for each **root component**, then serializes the resulting data into the page document as either [JSON](#json) or [markup](#markup).
|
|
@@ -259,6 +261,11 @@ export default class App extends LightningElement {
|
|
|
259
261
|
}
|
|
260
262
|
```
|
|
261
263
|
|
|
264
|
+
The [LWC eslint plugin](https://github.com/salesforce/eslint-plugin-lwc) provides rules for developing portable components:
|
|
265
|
+
|
|
266
|
+
- [`lwc/no-restricted-browser-globals-during-ssr`](https://github.com/salesforce/eslint-plugin-lwc/blob/master/docs/rules/no-restricted-browser-globals-during-ssr.md)
|
|
267
|
+
- [`lwc/no-unsupported-ssr-properties` on `this`](https://github.com/salesforce/eslint-plugin-lwc/blob/master/docs/rules/no-unsupported-ssr-properties.md)
|
|
268
|
+
|
|
262
269
|
### Synchronous code
|
|
263
270
|
|
|
264
271
|
The LWC SSR process run in a single synchronous pass. So any asynchronous code **will not be SSRed**. Asynchronous code includes:
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.10.0-alpha.
|
|
7
|
+
"version": "0.10.0-alpha.2",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@locker/near-membrane-node": "^0.12.0",
|
|
37
|
-
"@lwrjs/diagnostics": "0.10.0-alpha.
|
|
38
|
-
"@lwrjs/shared-utils": "0.10.0-alpha.
|
|
37
|
+
"@lwrjs/diagnostics": "0.10.0-alpha.2",
|
|
38
|
+
"@lwrjs/shared-utils": "0.10.0-alpha.2",
|
|
39
39
|
"node-fetch": "^2.6.8"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@lwrjs/types": "0.10.0-alpha.
|
|
42
|
+
"@lwrjs/types": "0.10.0-alpha.2"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=16.0.0 <20"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "592cda0637513885477829beea35a86407b342d4"
|
|
48
48
|
}
|