Skip to content

@gluonjs/core / packages/ssr/src / resolveForHydration

Function: resolveForHydration() ​

resolveForHydration(value, options?): Promise<TemplateValue>

Resolves server async contracts without serializing the expected markup.

Parameters ​

value ​

TemplateValue

options? ​

Pick<RenderSerializationOptions, "signal"> = {}

Returns ​

Promise<TemplateValue>

Example ​

Resolve the server value tree once before using marker-based hydration without serializing a duplicate expected HTML string:

ts
import { html } from '@gluonjs/core';
import { resolveForHydration } from '@gluonjs/ssr';

const serverValue = html`<main><h1>GLUON GOODS</h1><p>Ready for hydration.</p></main>`;
const resolvedValue = await resolveForHydration(serverValue);
console.log(resolvedValue);

Version-matched documentation. Examples are checked against the public package contracts.