You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 20, 2019. It is now read-only.
A suite of polyfills supporting the [Web Components](http://webcomponents.org) specs:
6
+
A suite of polyfills supporting the [Web Components](http://webcomponents.org) specs.
7
7
8
-
**Custom Elements**: allows authors to define their own custom tags ([spec](https://w3c.github.io/webcomponents/spec/custom/)).
9
-
10
-
**HTML Imports**: a way to include and reuse HTML documents via other HTML documents ([spec](https://w3c.github.io/webcomponents/spec/imports/)).
11
-
12
-
**Shadow DOM**: provides encapsulation by hiding DOM subtrees under shadow roots ([spec](https://w3c.github.io/webcomponents/spec/shadow/)).
8
+
-**Custom Elements**: allows authors to define their own custom tags ([spec](https://w3c.github.io/webcomponents/spec/custom/)).
9
+
-**HTML Imports**: a way to include and reuse HTML documents via other HTML documents ([spec](https://w3c.github.io/webcomponents/spec/imports/)).
10
+
-**Shadow DOM**: provides encapsulation by hiding DOM subtrees under shadow roots ([spec](https://w3c.github.io/webcomponents/spec/shadow/)).
13
11
14
12
## Releases
15
13
16
-
Pre-built (concatenated & minified) versions of the polyfills are maintained in the [tagged versions](https://github.com/webcomponents/webcomponentsjs/releases) of this repo. There are two variants:
17
-
18
-
`webcomponents.js` includes all of the polyfills.
19
-
20
-
`webcomponents-lite.js` includes all polyfills except for shadow DOM.
14
+
Pre-built (concatenated & minified) versions of the polyfills are maintained in the [tagged versions](https://github.com/webcomponents/webcomponentsjs/releases) of this repo. There are several variants:
21
15
16
+
-`webcomponents-lite.js` includes all of the polyfills.
17
+
-`webcomponents-loader.js` is a custom loader that dynamically load a minified polyfill
18
+
bundle, using feature detection. The bundles that can be loaded are:
19
+
-`webcomponents-hi` -- HTML Imports (needed by Safari Tech Preview)
20
+
-`webcomponents-hi-ce` -- HTML Imports and Custom Elements (needed by Safari 10)
21
+
-`webcomponents-hi-ce-sd` -- HTML Imports, Custom Elements and Shady DOM/CSS (needed by Safari 9, Firefox, Edge)
22
+
-`webcomponents-lite` -- HTML Imports, Custom Elements, Shady DOM/CSS and generic platform polyfills (such as URL, Template, ES6 Promise, Constructable events, etc.) (needed by Internet Explorer 11)
22
23
23
24
## Browser Support
24
25
25
26
Our polyfills are intended to work in the latest versions of evergreen browsers. See below
~Indicates support may be flaky. If using Custom Elements or HTML Imports with Shadow DOM,
39
-
you will get the non-flaky Mutation Observer polyfill that Shadow DOM includes.
35
+
\*Indicates the current version of the browser
40
36
41
37
The polyfills may work in older browsers, however require additional polyfills (such as classList)
42
38
to be used. We cannot guarantee support for browsers outside of our compatibility matrix.
43
39
44
40
45
41
### Manually Building
46
42
47
-
If you wish to build the polyfills yourself, you'll need `node` and `gulp` on your system:
43
+
If you wish to build the polyfills yourself, you'll need `node` and `npm` on your system:
48
44
49
45
* install [node.js](http://nodejs.org/) using the instructions on their website
50
46
* use `npm` to install [gulp.js](http://gulpjs.com/): `npm install -g gulp`
@@ -53,10 +49,11 @@ Now you are ready to build the polyfills with:
53
49
54
50
# install dependencies
55
51
npm install
52
+
bower install
56
53
# build
57
54
gulp build
58
55
59
-
The builds will be placed into the `dist/` directory.
56
+
The builds will be placed into the root directory.
60
57
61
58
## Contribute
62
59
@@ -74,7 +71,7 @@ Copyright (c) 2015 The Polymer Authors. All rights reserved.
74
71
75
72
Under native HTML Imports, `<script>` tags in the main document block the loading of such imports. This is to ensure the imports have loaded and any registered elements in them have been upgraded.
76
73
77
-
The webcomponents.js and webcomponents-lite.js polyfills parse element definitions and handle their upgrade asynchronously. If prematurely fetching the element from the DOM before it has an opportunity to upgrade, you'll be working with an `HTMLUnknownElement`.
74
+
The `webcomponents-lite.js` polyfill parse element definitions and handle their upgrade asynchronously. If prematurely fetching the element from the DOM before it has an opportunity to upgrade, you'll be working with an `HTMLUnknownElement`.
78
75
79
76
For these situations (or when you need an approximate replacement for the Polymer 0.5 `polymer-ready` behavior), you can use the `WebComponentsReady` event as a signal before interacting with the element. The criteria for this event to fire is all Custom Elements with definitions registered by the time HTML Imports available at load time have loaded have upgraded.
0 commit comments