Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit 5bed296

Browse files
authored
Merge pull request #124 from podium-lib/wkillerud-patch-1
docs: document some learnings about mode
2 parents 2786f9c + 05fd18f commit 5bed296

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,19 @@ This can be configured using the config setting `app.mode`. (see the config sect
260260

261261
### Server Side Rendered (hydrate)
262262

263+
Use this mode if you're writing podlets that will be included in layouts you don't control, or that include client side rendering/hydration.
264+
263265
When `app.mode` is set to `hydrate`, the content and fallback routes will be server rendered and then client side hydrated afterward.
264266
No additional setup is required but see guidelines for writing SSR custom elements on the Lit docs site. [https://lit.dev/docs/ssr/authoring/](https://lit.dev/docs/ssr/authoring/).
265267

266268
### Server Side Rendered (ssr-only)
267269

268270
When `app.mode` is set to `ssr-only`, the content and fallback routes will be server rendered but will not be hydrated on the client side afterward.
269271
This is good if you want to use components from a shared library or design system but don't actually need interactivity on the client side.
270-
It is recommended you use this option whenever possible since it will save many KBs of JavaScript being sent to the users browser.
272+
273+
If you control the layout(s) where the podlet will be rendered, it is recommended you use this option, as it will prevent sending KBs of JavaScript to the users browser.
274+
The downside compared to `hydrate` is, if another part of a layout does client-side render a shared component (such as an icon), Lit won't be able to properly replace the server-side rendered markup, and you end up with duplicates.
275+
271276
No additional setup is required but see guidelines for writing SSR custom elements on the Lit docs site. [https://lit.dev/docs/ssr/authoring/](https://lit.dev/docs/ssr/authoring/).
272277

273278
### Client Side Rendered (csr-only)

0 commit comments

Comments
 (0)