This repository has been archived by the owner on Aug 25, 2022. It is now read-only.
Releases: popeindustries/lit-html-server
Releases · popeindustries/lit-html-server
1.3.0
- add
index.d.ts
file - upgrade dependencies
1.2.0
- add
renderToStream
for the browser to render to aReadableStream
- upgrade dependencies
1.1.1
- fix browser
Buffer
polyfill
1.1.0
- publish CommonJS and ESM versions
- publish browser compatible versions (available via
@popeindustries/lit-html-server/browser/*
) withrenderToString()
- prepare groundwork for future browser compatible
renderToStream()
1.0.0
🎉
1.0.0-rc.6
- fix buffer flushing error that resulted in duplicate content when rendering
1.0.0-rc.5
- add
renderToBuffer(TemplateResult)
to render to a Node.jsBuffer
instance - add
asyncAppend
directive and general support for handlingAsyncIterators
1.0.0-rc.4
- flush buffer before resolving pending Promise
- improve internal buffer handling
1.0.0-rc.3
- Buffer chunks until the "high water mark" (16K) level is hit when streaming template data to a consumer
1.0.0-rc.2
This is a major rewrite to improve performance and align the design more with that of lit-html.
API
html(strings: Array<string>, values: Array<string>): TemplateResult
: the tag function to apply to HTML template literalsrenderToStream(templateResult): Readable
: renders aTemplateResult
to a Node.jsReadable
streamrenderToString(templateResult): Promise<string>
: renders aTemplateResult
to a string resolving Promise
Design considerations
- All templates processed by
html
are associated with aTemplate
instance that processes the lit-html syntax and preparesPart
instances for later use when resolving the template's dynamic values html
returns aTemplateResult
instance storing aTemplate
and it'svalues
(note thatTemplateResult
instances are single-use objects, and are destroyed once processed by a template renderer)
Performance considerations
Template
instances are cached and keyed by the uniquestrings
array passed to thehtml
tagged templateTemplateResult
instances are recycled in a global object pool- All strings and values are stored and processed internally as
Buffer
instances - Templates and their dynamic values are lazily processed at render time