Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

Releases: popeindustries/lit-html-server

1.3.0

01 Aug 09:25
Compare
Choose a tag to compare
  • add index.d.ts file
  • upgrade dependencies

1.2.0

27 Apr 11:02
Compare
Choose a tag to compare
  • add renderToStream for the browser to render to a ReadableStream
  • upgrade dependencies

1.1.1

26 Feb 18:57
Compare
Choose a tag to compare
  • fix browser Buffer polyfill

1.1.0

22 Feb 11:19
Compare
Choose a tag to compare
  • publish CommonJS and ESM versions
  • publish browser compatible versions (available via @popeindustries/lit-html-server/browser/*) with renderToString()
  • prepare groundwork for future browser compatible renderToStream()

1.0.0

15 Feb 20:19
Compare
Choose a tag to compare

🎉

1.0.0-rc.6

04 Feb 20:11
Compare
Choose a tag to compare
  • fix buffer flushing error that resulted in duplicate content when rendering

1.0.0-rc.5

02 Feb 09:22
Compare
Choose a tag to compare
  • add renderToBuffer(TemplateResult) to render to a Node.js Buffer instance
  • add asyncAppend directive and general support for handling AsyncIterators

1.0.0-rc.4

02 Feb 09:20
Compare
Choose a tag to compare
  • flush buffer before resolving pending Promise
  • improve internal buffer handling

1.0.0-rc.3

28 Jan 15:32
Compare
Choose a tag to compare
  • Buffer chunks until the "high water mark" (16K) level is hit when streaming template data to a consumer

1.0.0-rc.2

28 Jan 15:29
Compare
Choose a tag to compare

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 literals
  • renderToStream(templateResult): Readable: renders a TemplateResult to a Node.js Readable stream
  • renderToString(templateResult): Promise<string>: renders a TemplateResult to a string resolving Promise

Design considerations

  • All templates processed by html are associated with a Template instance that processes the lit-html syntax and prepares Part instances for later use when resolving the template's dynamic values
  • html returns a TemplateResult instance storing a Template and it's values (note that TemplateResult instances are single-use objects, and are destroyed once processed by a template renderer)

Performance considerations

  • Template instances are cached and keyed by the unique strings array passed to the html tagged template
  • TemplateResult 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