MCPcopy
hub / github.com/QwikDev/qwik / renderToString

Function renderToString

packages/qwik/src/server/render.ts:271–302  ·  view source on GitHub ↗
(
  rootNode: any,
  opts: RenderToStringOptions = {}
)

Source from the content-addressed store, hash-verified

269 * @public
270 */
271export async function renderToString(
272 rootNode: any,
273 opts: RenderToStringOptions = {}
274): Promise<RenderToStringResult> {
275 const chunks: string[] = [];
276 const stream: StreamWriter = {
277 write(chunk) {
278 chunks.push(chunk);
279 },
280 };
281
282 const result = await renderToStream(rootNode, {
283 base: opts.base,
284 containerAttributes: opts.containerAttributes,
285 containerTagName: opts.containerTagName,
286 locale: opts.locale,
287 manifest: opts.manifest,
288 symbolMapper: opts.symbolMapper,
289 qwikLoader: opts.qwikLoader,
290 serverData: opts.serverData,
291 prefetchStrategy: opts.prefetchStrategy,
292 stream,
293 });
294 return {
295 isStatic: result.isStatic,
296 prefetchResources: result.prefetchResources,
297 timing: result.timing,
298 manifest: result.manifest,
299 snapshotResult: result.snapshotResult,
300 html: chunks.join(''),
301 };
302}
303
304/**
305 * Merges a given manifest with the built manifest and provides mappings for symbols.

Callers 13

render.unit.tsxFile · 0.90
pause.unit.tsxFile · 0.90
sync-qrl.unit.tsxFile · 0.90
render.unit.tsxFile · 0.90
renderFromServerFunction · 0.90
entry.server.tsxFile · 0.90
entry.server.tsxFile · 0.90
entry.server.tsxFile · 0.90
entry.server.tsxFile · 0.90
entry.server.tsxFile · 0.90
entry.server.tsxFile · 0.90
entry.server.tsxFile · 0.90

Calls 2

renderToStreamFunction · 0.85
joinMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…