Lit SSR DOM emulation

This package is part of the Lit Labs family of experimental packages. See the Lit Labs page for guidance on using Labs software in production.

In the DOM shim that ships with Lit SSR, only the minimal DOM interfaces needed to define and register components are implemented. These include a few key DOM classes and a roughly functioning CustomElementRegistry.

Below lists all the properties, classes, and methods on the window object added to globalThis. The contents of window are also assigned onto globalThis. ✅ signifies item is implemented to be functionally the same as in the browser.

PropertyNotes
Element⚠️ Empty class
HTMLElement⚠️ Partial
attributes
shadowRoot⚠️ Returns {host: this} if attachShadow() was called with {mode: 'open'}
setAttribute()
removeAttribute()
hasAttribute()
attachShadow()⚠️ Returns {host: this}
getAttribute()
Document⚠️ Partial
adoptedStyleSheets⚠️ Getter only returning []
createTreeWalker()⚠️ Returns {}
createTextNode()⚠️ Returns {}
createElement()⚠️ Returns {}
documentInstance of Document
cssStyleSheet⚠️ Partial
replace()⚠️ No op
ShadowRoot⚠️ Empty class
CustomElementRegistry
define()
get()
customElementsInstance of CustomElementRegistry
btoa()
fetch()node-fetch
locationnew URL('http://localhost')
MutationObserver⚠️ Partial
observe()⚠️ No op
requestAnimationFrame()⚠️ No op
window✅ Self reference