mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Don't rely on dom-module synchronously until WCR.
This commit is contained in:
@@ -34,31 +34,33 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
</template>
|
||||
</dom-module>
|
||||
<script>
|
||||
class PR extends Polymer.Element {
|
||||
static get is() { return 'p-r'; }
|
||||
}
|
||||
customElements.define(PR.is, PR);
|
||||
|
||||
class PRImportMeta extends Polymer.Element {
|
||||
static get template() {
|
||||
return Polymer.DomModule.import('p-r', 'template').cloneNode(true);
|
||||
window.addEventListener('WebComponentsReady', () => {
|
||||
class PR extends Polymer.Element {
|
||||
static get is() { return 'p-r'; }
|
||||
}
|
||||
static get importMeta() {
|
||||
customElements.define(PR.is, PR);
|
||||
|
||||
class PRImportMeta extends Polymer.Element {
|
||||
static get template() {
|
||||
return Polymer.DomModule.import('p-r', 'template').cloneNode(true);
|
||||
}
|
||||
static get importMeta() {
|
||||
// Idiomatically, this would be `return import.meta`, but for purposes
|
||||
// of stubbing the test without actual modules, it's shimmed
|
||||
return { url: 'http://class.com/mymodule/index.js' };
|
||||
}
|
||||
}
|
||||
customElements.define('p-r-im', PRImportMeta);
|
||||
|
||||
const PRHybrid = Polymer({
|
||||
is: 'p-r-hybrid',
|
||||
_template: Polymer.DomModule.import('p-r', 'template').cloneNode(true),
|
||||
// Idiomatically, this would be `return import.meta`, but for purposes
|
||||
// of stubbing the test without actual modules, it's shimmed
|
||||
return { url: 'http://class.com/mymodule/index.js' };
|
||||
}
|
||||
}
|
||||
customElements.define('p-r-im', PRImportMeta);
|
||||
importMeta: { url: 'http://hybrid.com/mymodule/index.js' }
|
||||
});
|
||||
|
||||
const PRHybrid = Polymer({
|
||||
is: 'p-r-hybrid',
|
||||
_template: Polymer.DomModule.import('p-r', 'template').cloneNode(true),
|
||||
// Idiomatically, this would be `return import.meta`, but for purposes
|
||||
// of stubbing the test without actual modules, it's shimmed
|
||||
importMeta: { url: 'http://hybrid.com/mymodule/index.js' }
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<dom-module id="p-r-ap" assetpath="../../assets/"></dom-module>
|
||||
|
||||
Reference in New Issue
Block a user