Skip to content

Instantly share code, notes, and snippets.

@CITguy
Created August 23, 2021 21:56
Show Gist options
  • Save CITguy/a77008994995474dd76bcd8946710a15 to your computer and use it in GitHub Desktop.
Save CITguy/a77008994995474dd76bcd8946710a15 to your computer and use it in GitHub Desktop.
Summary of Polyfills included in @webcomponents/webcomponentsjs

custom-elements

Polyfill for Custom Elements

See Patch/Native

html-imports

Polyfill for HTML Imports

NOTE: Use ECMAScript Modules (ESM) instead!

<link rel="import" href="my-import.html">

shadycss

Polyfill for Scoped CSS

NOTE: ponyfills (doesn't replicate true Shadow DOM CSS scoping)

  • ShadoDOM style encapsulation (ScopingShim)
  • Proposed CSS mixin @apply syntax (ApplyShim)
  • integrate document-level stylesheets with both of the above (CustomStyleInterface)

template

Polyfill for Template Element

Minimal polyfill for <template>

API Polyfill
Array.from() webcomponentsjs
CharacterData.after() webcomponentsjs
CharacterData.before() webcomponentsjs
CharacterData.remove() webcomponentsjs
CharacterData.replaceWith() webcomponentsjs
CustomElementRegistry.define() custom-elements
CustomElementRegistry.get() custom-elements
CustomElementRegistry.upgrade() custom-elements
CustomElementRegistry.whenDefined() custom-elements
CustomEvent() webcomponentsjs
Document.append() custom-elements
Document.append() webcomponentsjs
Document.createElement() custom-elements
Document.createElementNS() custom-elements
Document.importNode() custom-elements
Document.prepend() custom-elements
Document.prepend() webcomponentsjs
Document.replaceChildren() webcomponentsjs
DocumentFragment.append() custom-elements
DocumentFragment.append() webcomponentsjs
DocumentFragment.prepend() custom-elements
DocumentFragment.prepend() webcomponentsjs
DocumentFragment.replaceChildren() webcomponentsjs
Element.after() custom-elements
Element.after() webcomponentsjs
Element.append() custom-elements
Element.append() webcomponentsjs
Element.attachShadow() custom-elements
Element.before() custom-elements
Element.before() webcomponentsjs
Element.classList webcomponentsjs
Element.getAttribute() custom-elements
Element.getAttributeNS() custom-elements
Element.getAttributeNames() webcomponentsjs
Element.innerHTML custom-elements
Element.insertAdjacentElement() custom-elements
Element.insertAdjacentHTML() custom-elements
Element.matches() webcomponentsjs
Element.prepend() custom-elements
Element.prepend() webcomponentsjs
Element.remove() custom-elements
Element.remove() webcomponentsjs
Element.removeAttribute() custom-elements
Element.removeAttributeNS() custom-elements
Element.replaceChildren() webcomponentsjs
Element.replaceWith() custom-elements
Element.replaceWith() webcomponentsjs
Element.setAttribute() custom-elements
Element.setAttributeNS() custom-elements
Element.shadowRoot custom-elements
Event() webcomponentsjs
EventTarget.addEventListener(type, listener, options) webcomponentsjs
EventTarget.removeEventListener(type, listener, options) webcomponentsjs
HTMLElement() custom-elements
HTMLElement.classList webcomponentsjs
HTMLElement.innerHTML custom-elements
HTMLElement.insertAdjacentElement() custom-elements
HTMLElement.insertAdjacentHTML() custom-elements
HTMLTemplateElement template
Map[Symbol.iterator] webcomponentsjs
MouseEvent() webcomponentsjs
Node.appendChild() custom-elements
Node.baseURI webcomponentsjs
Node.cloneNode() custom-elements
Node.getRootNode() shadydom
Node.insertBefore() custom-elements
Node.isConnected shadydom
Node.removeChild() custom-elements
Node.replaceChild() custom-elements
Node.textContent custom-elements
Object.assign() webcomponentsjs
Object.getOwnPropertySymbols() webcomponentsjs
Object.keys() webcomponentsjs
Object.toString() webcomponentsjs
SVGElement.classList webcomponentsjs
Set[Symbol.iterator] webcomponentsjs
String[Symbol.iterator] webcomponentsjs
Symbol webcomponentsjs
window.Promise webcomponentsjs
window.customElements custom-elements
@CITguy
Copy link
Author

CITguy commented Aug 23, 2021

NOTE

  • Element.closest() - NOT polyfilled!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment