Skip to content

lit-ui-router-ssr / ServedUiView

Interface: ServedUiView ​

Defined in: packages/lit-ui-router-ssr/src/served-view.ts:46

A <ui-view> that owns its side of a server render.

Extends ​

  • UiView

Properties ​

PropertyTypeDescriptionInherited fromDefined in
deferHydrationbooleanWritten by the server on a prerendered view; while it is present the view renders nothing, and removing it wakes and hydrates the element.-packages/lit-ui-router-ssr/src/served-view.ts:51
namestringthe view name this viewport fills; empty selects the $default viewUiView.namepackages/lit-ui-router/dist/ui-view.d.ts:52
uiRouterUIRouterLit<ui-view> can be used without <ui-router> by providing the uiRouter property directly.UiView.uiRouterpackages/lit-ui-router/dist/ui-view.d.ts:57

Methods ​

adoptProvidedRouter() ​

ts
protected adoptProvidedRouter(): void;

Defined in: packages/lit-ui-router/dist/ui-view.d.ts:154

Adopts the router the provider now offers, when this view registered without it or with another.

Runs whenever the router this view holds is one a seek produced, or none: a provider that upgraded late, or a different <ui-router> this view has just been attached under, supersedes it. A router the app assigned is kept.

lit replays a pre-upgrade property inside the element's first update, not at upgrade, so <ui-router> can run connectedCallback with uiRouter still undefined and provide an instance of its own; a <ui-view> connecting in between registers with that one and never sees a transition. Firefox upgrades a detached subtree later than Chrome and WebKit, so declarative shadow DOM parsed off-document reaches this there first.

registerUIView syncs, so the re-registered view picks up the current state without waiting for the next transition.

A subclass that renders against a registration made elsewhere calls it before the update that reads the component.

Returns ​

void

Inherited from ​

ts
UiView.adoptProvidedRouter

captureContent() ​

ts
protected captureContent(): void;

Defined in: packages/lit-ui-router/dist/ui-view.d.ts:176

Takes the authored children ahead of any render as this view's fallback set.

The nodes are moved, never copied, so they keep their identity and any binding an enclosing template holds on them stays live. The first update stands them back up when no component occupies the view.

A view whose first child is a render marker holds a render's output from the first child down, so it captures nothing and the nodes stay where they stand: they are lit's own on a re-attached view, and never ours to move.

Returns ​

void

Inherited from ​

ts
UiView.captureContent

captureContentInPlace() ​

ts
protected captureContentInPlace(): void;

Defined in: packages/lit-ui-router/dist/ui-view.d.ts:189

Takes the authored children standing ahead of any render as this view's fallback set, leaving them where they are.

The nodes are not parked: they already stand in the document, and the update that follows parks them only if a component occupies the view, like any other fallback set. A view whose children are a render's from the first one down captures nothing.

This is the capture for a subclass that fills the element before its first render, where captureContent at connect would be too early.

Returns ​

void

Inherited from ​

ts
UiView.captureContentInPlace

render() ​

ts
render(): TemplateResult | typeof nothing;

Defined in: packages/lit-ui-router/dist/ui-view.d.ts:252

The routed component's template, or nothing while the fallback set stands in the light DOM on its own.

Returns ​

TemplateResult | typeof nothing

Inherited from ​

ts
UiView.render

renderLight() ​

ts
renderLight(): typeof noChange;

Defined in: packages/lit-ui-router-ssr/src/served-view.ts:56

Answers the uiViewSlot part with noChange, so the render that reaches it leaves this view's own nodes where they stand.

Returns ​

typeof noChange