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

Commit e813453

Browse files
authored
Merge pull request #769 from webcomponents/udpate-builds
update builds.
2 parents 1985dc7 + 63d6bcf commit e813453

15 files changed

+443
-427
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ Alternatively, this repo also comes with `webcomponents-loader.js`, a client-sid
3535
loader that dynamically loads the minimum polyfill bundle, using feature detection.
3636
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
3737
loaded and are ready to be used (i.e. if you want to dynamically load other custom
38-
elements, etc.). Here's an example:
38+
elements, etc.).
39+
40+
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.
41+
42+
Here's an example:
3943

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

7074
```html
71-
<!-- Load Custom Elements es5 adapter -->
75+
<!-- Load Custom Elements es5 adapter -->
7276
<script src="bower_components/webcomponentsjs/custom-elements-es5-adapter.js"></script>
7377
<!-- Load polyfills; note that "loader" will load these async -->
7478
<script src="bower_components/webcomponentsjs/webcomponents-loader.js"></script>

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"license": "BSD-3-Clause",
2121
"ignore": [],
2222
"devDependencies": {
23-
"web-component-tester": "^v6.0.0-prerelease.9",
23+
"web-component-tester": "^v6.0.0-prerelease.10",
2424
"custom-elements": "webcomponents/custom-elements#^v1.0.0-rc.1",
2525
"es6-promise": "stefanpenner/es6-promise#^4.0.0",
2626
"html-imports": "webcomponents/html-imports#^v1.0.0-rc.2",

entrypoints/webcomponents-sd-ce-index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ import '../bower_components/shadycss/entrypoints/scoping-shim.js'
2121
// NOTE: this is a load-bearing IIFE for Closure
2222
(function() {
2323
let document = window.document;
24+
// global for (1) existence means `WebComponentsReady` will file,
25+
// (2) WebComponents.ready == true means event has fired.
26+
window.WebComponents = window.WebComponents || {};
2427

2528
function fire() {
2629
requestAnimationFrame(() => {
30+
window.WebComponents.ready = true;
2731
window.document.dispatchEvent(new CustomEvent('WebComponentsReady', { bubbles: true }));
2832
})
2933
}

src/post-polyfill.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

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

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

5154
HTMLImports['whenReady'](function() {
5255
requestAnimationFrame(function() {
56+
window.WebComponents.ready = true;
5357
document.dispatchEvent(new CustomEvent('WebComponentsReady', {bubbles: true}));
5458
});
5559
});

webcomponents-hi-ce.js

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webcomponents-hi-ce.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webcomponents-hi-sd-ce.js

Lines changed: 124 additions & 124 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webcomponents-hi-sd-ce.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webcomponents-hi.js

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webcomponents-hi.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)