JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 184685
  • Score
    100M100P100Q172264F
  • License BSD-3-Clause

HTML Custom Elements Polyfill

Package Exports

  • @webcomponents/custom-elements/src/native-shim
  • @webcomponents/custom-elements/src/native-shim.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@webcomponents/custom-elements) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

custom-elements

A polyfill for HTML Custom Elements

Build Status

Building & Running Tests

  1. Install web-component-tester
```bash
$ npm i -g web-component-tester
```
  1. Checkout the webcomponentsjs v1 branch
```bash
$ git clone https://github.com/webcomponents/webcomponentsjs.git
$ cd webcomponentsjs
$ npm i
$ gulp build
```
  1. Run tests
```bash
$ wct tests/CustomElements/v1/index.html -l chrome
```
  1. Bower link to use in another project
```bash
$ bower link
$ cd {your project directory}
$ bower link webcomponentsjs
```

Differences from Spec

Most custom element reactions in the polyfill are driven from Mutation Observers and so are async in cases where the spec calls for synchronous reactions. There are some exceptions, like for Document.importNode() and Element.setAttribute.

To ensure that queued operations are complete, mostly useful for tests, you can enable flushing:

customElements.enableFlush = true;

// some DOM operations

customElements.flush();

// some more DOM operations dependent on reactions in the first set