Skip to content

[labs/ssr] SSR Docs unclear regarding LitElement hydration #2665

@digitalsadhu

Description

@digitalsadhu

Description

In the following text from the SSR docs:

Because the hydrate function above does not descend into shadow roots, it only works on one scope of the DOM at a time. To hydrate LitElement shadow roots, load the lit/hydrate-support.js module, which installs support for LitElement automatically hydrating itself when it detects it was server-rendered with declarative shadow DOM.

The module lit/hydrate-support.js is referenced. However, in the example below, this module is not loaded. Attempting to load this module results in the error: Package subpath './hydrate-support.js' is not defined by "exports

It is also unclear from the docs whether hydration is explicitly needed for LitElements as it is for templates or whether hydration is NOT explicitly needed. Confusion arises due to the text "installs support for LitElement automatically hydrating itself when it detects it was server-rendered with declarative shadow DOM".

Please clarify.

ref: https://github.com/lit/lit/tree/1d51ed8b7eb991e151759f9dbf8643b4ed781457/packages/labs/ssr#hydrating-litelements

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions