-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Should this be an RFC?
- This is not a substantial change
Which package is this a feature request for?
Other/unknown (please mention in description)
Description
Currently the @lit-labs/ssr-dom-shim package throws when it encounters and element that includes a call to HTMLElement.prototype.attachInternals. This feature is shipped in Chrome, Firefox and Safari Technology Preview and should generally be called in an element's constructor which is one of the methods that will be called by Lit's SSR.
Because Lit uses a lightweight DOM shim, the polyfill cannot add a function to the HTMLElement prototype.
Alternatives and Workarounds
As the author of the element-internals-polyfill I attempted to patch HTMLElement.prototype.attachShadow in that file to no avail. Alternatively component authors could check for the presence of attachInternals in their components but that puts undue burden on Lit's consumers.