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

Commit 1a28425

Browse files
committed
Sync build loaders for webcomponents and webcomponents-lite
Fixes #413
1 parent 3a856f0 commit 1a28425

File tree

3 files changed

+22
-31
lines changed

3 files changed

+22
-31
lines changed

src/WebComponents/build/boot-lite.js

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/**
2+
* @license
23
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
34
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
45
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
@@ -7,18 +8,17 @@
78
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
89
*/
910

10-
window.WebComponents = window.WebComponents || {};
11+
(function() {
1112

12-
// process flags
13-
(function(scope){
14-
15-
// import
16-
var flags = scope.flags || {};
13+
// Establish scope.
14+
window.WebComponents = window.WebComponents || {flags:{}};
1715

16+
// loading script
1817
var file = 'webcomponents-lite.js';
1918
var script = document.querySelector('script[src*="' + file + '"]');
2019

2120
// Flags. Convert url arguments to flags
21+
var flags = {};
2222
if (!flags.noOpts) {
2323
// from url
2424
location.search.slice(1).split('&').forEach(function(option) {
@@ -48,23 +48,13 @@ window.WebComponents = window.WebComponents || {};
4848
}
4949
}
5050

51-
// Determine default settings.
52-
// If any of these flags match 'native', then force native ShadowDOM; any
53-
// other truthy value, or failure to detect native
54-
// ShadowDOM, results in polyfill
55-
flags.shadow = (flags.shadow || flags.shadowdom || flags.polyfill);
56-
if (flags.shadow === 'native') {
57-
flags.shadow = false;
58-
} else {
59-
flags.shadow = flags.shadow || !HTMLElement.prototype.createShadowRoot;
60-
}
61-
6251
// forward flags
6352
if (flags.register) {
6453
window.CustomElements = window.CustomElements || {flags: {}};
6554
window.CustomElements.flags.register = flags.register;
6655
}
6756

68-
// export
69-
scope.flags = flags;
70-
})(window.WebComponents);
57+
// exports
58+
WebComponents.flags = flags;
59+
60+
})();

src/WebComponents/build/boot.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/**
2+
* @license
23
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
34
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
45
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
@@ -7,18 +8,17 @@
78
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
89
*/
910

10-
window.WebComponents = window.WebComponents || {};
11+
(function() {
1112

12-
// process flags
13-
(function(scope){
14-
15-
// import
16-
var flags = scope.flags || {};
13+
// Establish scope.
14+
window.WebComponents = window.WebComponents || {flags:{}};
1715

16+
// loading script
1817
var file = 'webcomponents.js';
1918
var script = document.querySelector('script[src*="' + file + '"]');
2019

2120
// Flags. Convert url arguments to flags
21+
var flags = {};
2222
if (!flags.noOpts) {
2323
// from url
2424
location.search.slice(1).split('&').forEach(function(option) {
@@ -65,6 +65,7 @@ window.WebComponents = window.WebComponents || {};
6565
window.CustomElements.flags.register = flags.register;
6666
}
6767

68-
// export
69-
scope.flags = flags;
70-
})(WebComponents);
68+
// exports
69+
WebComponents.flags = flags;
70+
71+
})();

src/WebComponents/build/if-poly.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// select ShadowDOM impl
2-
if (WebComponents.flags.shadow) {
1+
// select ShadowDOM impl
2+
if (WebComponents.flags.shadow) {

0 commit comments

Comments
 (0)