Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

Commit

Permalink
Merge pull request #769 from webcomponents/udpate-builds
Browse files Browse the repository at this point in the history
update builds.
  • Loading branch information
kevinpschaaf authored Apr 24, 2017
2 parents 1985dc7 + 63d6bcf commit e813453
Show file tree
Hide file tree
Showing 15 changed files with 443 additions and 427 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ Alternatively, this repo also comes with `webcomponents-loader.js`, a client-sid
loader that dynamically loads the minimum polyfill bundle, using feature detection.
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
loaded and are ready to be used (i.e. if you want to dynamically load other custom
elements, etc.). Here's an example:
elements, etc.).

Additionally, you can check if `window.WebComponents` exists to know if the `WebComponentsReady` event will fire, and you can check if `window.WebComponents.ready` is true to check if the `WebComponentsReady` event has already fired.

Here's an example:

```html
<!-- Load polyfills; note that "loader" will load these async -->
Expand Down Expand Up @@ -68,7 +72,7 @@ To work around this, load `custom-elements-es5-adapter.js` before declaring new
**The adapter must NOT be compiled.**

```html
<!-- Load Custom Elements es5 adapter -->
<!-- Load Custom Elements es5 adapter -->
<script src="bower_components/webcomponentsjs/custom-elements-es5-adapter.js"></script>
<!-- Load polyfills; note that "loader" will load these async -->
<script src="bower_components/webcomponentsjs/webcomponents-loader.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"license": "BSD-3-Clause",
"ignore": [],
"devDependencies": {
"web-component-tester": "^v6.0.0-prerelease.9",
"web-component-tester": "^v6.0.0-prerelease.10",
"custom-elements": "webcomponents/custom-elements#^v1.0.0-rc.1",
"es6-promise": "stefanpenner/es6-promise#^4.0.0",
"html-imports": "webcomponents/html-imports#^v1.0.0-rc.2",
Expand Down
4 changes: 4 additions & 0 deletions entrypoints/webcomponents-sd-ce-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ import '../bower_components/shadycss/entrypoints/scoping-shim.js'
// NOTE: this is a load-bearing IIFE for Closure
(function() {
let document = window.document;
// global for (1) existence means `WebComponentsReady` will file,
// (2) WebComponents.ready == true means event has fired.
window.WebComponents = window.WebComponents || {};

function fire() {
requestAnimationFrame(() => {
window.WebComponents.ready = true;
window.document.dispatchEvent(new CustomEvent('WebComponentsReady', { bubbles: true }));
})
}
Expand Down
4 changes: 4 additions & 0 deletions src/post-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

var customElements = window['customElements'];
var HTMLImports = window['HTMLImports'];
// global for (1) existence means `WebComponentsReady` will file,
// (2) WebComponents.ready == true means event has fired.
window.WebComponents = window.WebComponents || {};

if (customElements && customElements['polyfillWrapFlushCallback']) {
// Here we ensure that the public `HTMLImports.whenReady`
Expand Down Expand Up @@ -50,6 +53,7 @@

HTMLImports['whenReady'](function() {
requestAnimationFrame(function() {
window.WebComponents.ready = true;
document.dispatchEvent(new CustomEvent('WebComponentsReady', {bubbles: true}));
});
});
Expand Down
26 changes: 13 additions & 13 deletions webcomponents-hi-ce.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webcomponents-hi-ce.js.map

Large diffs are not rendered by default.

248 changes: 124 additions & 124 deletions webcomponents-hi-sd-ce.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webcomponents-hi-sd-ce.js.map

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions webcomponents-hi.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webcomponents-hi.js.map

Large diffs are not rendered by default.

322 changes: 161 additions & 161 deletions webcomponents-lite.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webcomponents-lite.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions webcomponents-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

(function() {
'use strict';
// global for (1) existence means `WebComponentsReady` will file,
// (2) WebComponents.ready == true means event has fired.
window.WebComponents = window.WebComponents || {};
var name = 'webcomponents-loader.js';
// Feature detect which polyfill needs to be imported.
var polyfills = [];
Expand Down Expand Up @@ -54,6 +57,7 @@

var fire = function() {
requestAnimationFrame(function() {
window.WebComponents.ready = true;
document.dispatchEvent(new CustomEvent('WebComponentsReady', {bubbles: true}));
});
};
Expand Down
210 changes: 105 additions & 105 deletions webcomponents-sd-ce.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webcomponents-sd-ce.js.map

Large diffs are not rendered by default.

0 comments on commit e813453

Please sign in to comment.