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.
-`Event`, `CustomEvent`, `MouseEvent` constructors and `Object.assign`, `Array.from` (see [webcomponents-platform](https://github.com/webcomponents/webcomponents-platform))
13
16
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:
17
+
## How to use
15
18
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 Template, ES6 Promise, Constructable events, etc.) (needed by Internet Explorer 11)
19
+
The polyfills are built (concatenated & minified) into several bundles that target
20
+
different browsers and spec readiness:
21
+
22
+
-`webcomponents-hi.js` -- HTML Imports (needed by Safari Tech Preview)
23
+
-`webcomponents-hi-ce.js` -- HTML Imports and Custom Elements (needed by Safari 10)
24
+
-`webcomponents-hi-sd-ce.js` -- HTML Imports, Custom Elements and Shady DOM/CSS (needed by Safari 9, Firefox, Edge)
25
+
-`webcomponents-sd-ce.js` -- Custom Elements and Shady DOM/CSS (no HTML Imports)
26
+
-`webcomponents-lite.js` -- all of the polyfills: HTML Imports, Custom Elements, Shady DOM/CSS and generic platform polyfills (such as ES6 Promise, Constructable events, etc.) (needed by Internet Explorer 11), and Template (needed by IE 11 and Edge)
27
+
28
+
If you are only targeting a specific browser, you can just use the bundle that's
29
+
needed by it; alternatively, if your server is capable of serving different assets based on user agent, you can send the polyfill bundle that's necessary for the browser making that request.
30
+
31
+
## `webcomponents-loader.js`
32
+
33
+
Alternatively, this repo also comes with `webcomponents-loader.js`, a client-side
34
+
loader that dynamically loads the minimum polyfill bundle, using feature detection.
35
+
Note that because the bundle will be loaded asynchronously, you should wait for the `WebComponentsReady` before you can safely assume that all the polyfills have
36
+
loaded and are ready to be used (i.e. if you want to dynamically load other custom
37
+
elements, etc.). Here's an example:
38
+
39
+
```
40
+
<!-- Load polyfills; note that "loader" will load these async -->
@@ -34,13 +72,13 @@ for our complete browser support matrix:
34
72
35
73
\*Indicates the current version of the browser
36
74
37
-
The polyfills may work in older browsers, however require additional polyfills (such as classList)
38
-
to be used. We cannot guarantee support for browsers outside of our compatibility matrix.
75
+
The polyfills may work in older browsers, however require additional polyfills (such as classList, or other [platform](https://github.com/webcomponents/webcomponents-platform)
76
+
polyfills) to be used. We cannot guarantee support for browsers outside of our compatibility matrix.
39
77
40
78
41
79
### Manually Building
42
80
43
-
If you wish to build the polyfills yourself, you'll need `node` and `npm` on your system:
81
+
If you wish to build the bundles yourself, you'll need `node` and `npm` on your system:
44
82
45
83
* install [node.js](http://nodejs.org/) using the instructions on their website
46
84
* use `npm` to install [gulp.js](http://gulpjs.com/): `npm install -g gulp`
0 commit comments