(
rootNode: any,
opts: RenderToStringOptions = {}
)
| 269 | * @public |
| 270 | */ |
| 271 | export 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. |
no test coverage detected
searching dependent graphs…