mirror of
https://github.com/jlengrand/webcomponentsjs.git
synced 2026-03-10 08:51:22 +00:00
Make bundles with the Custom Elements es5 compatibility shim
Fixes #710 Also, fix loaders to be compatible with ES5-only browsers Fixes #706
This commit is contained in:
@@ -38,7 +38,7 @@ Note that because the bundle will be loaded asynchronously, you should wait for
|
||||
loaded and are ready to be used (i.e. if you want to dynamically load other custom
|
||||
elements, etc.). Here's an example:
|
||||
|
||||
```
|
||||
```html
|
||||
<!-- Load polyfills; note that "loader" will load these async -->
|
||||
<script src="bower_components/webcomponentsjs/webcomponents-loader.js"></script>
|
||||
|
||||
@@ -61,6 +61,12 @@ elements, etc.). Here's an example:
|
||||
</script>
|
||||
```
|
||||
|
||||
## `webcomponents-es5-loader.js`
|
||||
|
||||
Due to the requirement that Custom Elements be ES6 classes (https://html.spec.whatwg.org/multipage/scripting.html#custom-element-conformance), it may make sense to precompile your elements down to ES5 for wider consumption.
|
||||
However, this will conflict with the presence of native Custom Elements in browsers that support them.
|
||||
For these scenarios, use the `webcomponents-es5-loader.js` file to use the Custom Elements native compatibility shim where needed.
|
||||
|
||||
## Browser Support
|
||||
|
||||
The polyfills are intended to work in the latest versions of evergreen browsers. See below
|
||||
|
||||
Reference in New Issue
Block a user