-
-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
796223f
commit 21542aa
Showing
147 changed files
with
4,741 additions
and
5,663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/building-utils/test/index-html/snapshots/create-index-html/polyfill-core-js.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<html lang="en-GB"><head><title>My app</title><style>my-app{display:block}</style></head><body><h1><span>Hello world!</span></h1><my-app></my-app><script src="polyfills/core-js.d58f09bfd9f1c0b1682cf4a93be23230.js" nomodule=""></script><script src="./app.js" type="module"></script></body></html> | ||
<html lang="en-GB"><head><title>My app</title><style>my-app{display:block}</style></head><body><h1><span>Hello world!</span></h1><my-app></my-app><script src="polyfills/core-js.577a5602a7262d6256830802d4aaab43.js" nomodule=""></script><script src="./app.js" type="module"></script></body></html> |
2 changes: 1 addition & 1 deletion
2
.../building-utils/test/index-html/snapshots/create-index-html/polyfill-multiple-legacy.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<html lang="en-GB"><head><title>My app</title><style>my-app{display:block}</style><link rel="preload" href="app.js" as="script" crossorigin="anonymous"></head><body><h1><span>Hello world!</span></h1><my-app></my-app><script src="polyfills/core-js.d58f09bfd9f1c0b1682cf4a93be23230.js" nomodule=""></script><script>!function(){function e(e,o){return new Promise((function(t,n){document.head.appendChild(Object.assign(document.createElement("script"),{src:e,onload:t,onerror:n},o?{type:"module"}:void 0))}))}var o=[];function t(){"noModule"in HTMLScriptElement.prototype?window.importShim("./app.js"):System.import("./legacy/app.js")}"attachShadow"in Element.prototype&&"getRootNode"in Element.prototype&&(!window.ShadyDOM||!window.ShadyDOM.force)||o.push(e("polyfills/webcomponents.dae9f79d9d6992b6582e204c3dd953d3.js",!1)),!("noModule"in HTMLScriptElement.prototype)&&"getRootNode"in Element.prototype&&o.push(e("polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js",!1)),o.length?Promise.all(o).then(t):t()}();</script></body></html> | ||
<html lang="en-GB"><head><title>My app</title><style>my-app{display:block}</style><link rel="preload" href="app.js" as="script" crossorigin="anonymous"></head><body><h1><span>Hello world!</span></h1><my-app></my-app><script src="polyfills/core-js.577a5602a7262d6256830802d4aaab43.js" nomodule=""></script><script>!function(){function e(e,o){return new Promise((function(t,n){document.head.appendChild(Object.assign(document.createElement("script"),{src:e,onload:t,onerror:n},o?{type:"module"}:void 0))}))}var o=[];function t(){"noModule"in HTMLScriptElement.prototype?window.importShim("./app.js"):System.import("./legacy/app.js")}"attachShadow"in Element.prototype&&"getRootNode"in Element.prototype&&(!window.ShadyDOM||!window.ShadyDOM.force)||o.push(e("polyfills/webcomponents.d67d6757b8cd44bc35b021ee0b71d197.js",!1)),!("noModule"in HTMLScriptElement.prototype)&&"getRootNode"in Element.prototype&&o.push(e("polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js",!1)),o.length?Promise.all(o).then(t):t()}();</script></body></html> |
2 changes: 1 addition & 1 deletion
2
packages/building-utils/test/index-html/snapshots/create-index-html/polyfill-multiple.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<html lang="en-GB"><head><title>My app</title><style>my-app{display:block}</style><link rel="preload" href="app.js" as="script" crossorigin="anonymous"></head><body><h1><span>Hello world!</span></h1><my-app></my-app><script>window.importShim=t=>import(t.startsWith(".")?new URL(t,document.baseURI):t);</script><script src="polyfills/custom-b.36a50cce88edee34c249d0276be6531d.js" nomodule=""></script><script src="polyfills/core-js.d58f09bfd9f1c0b1682cf4a93be23230.js" nomodule=""></script><script>!function(){function e(e,o){return new Promise((function(t,n){document.head.appendChild(Object.assign(document.createElement("script"),{src:e,onload:t,onerror:n},o?{type:"module"}:void 0))}))}var o=[];function t(){window.importShim("./app.js")}"foo"in window&&o.push(e("polyfills/custom-a.612310cce7c28a680112cc9eff6ef77c.js",!1)),"fetch"in window||o.push(e("polyfills/fetch.191258a74d74243758f52065f3d0962a.js",!1)),"noModule"in HTMLScriptElement.prototype&&!("importShim"in window)&&o.push(e("polyfills/dynamic-import.b745cfc9384367cc18b42bbef2bbdcd9.js",!1)),"attachShadow"in Element.prototype&&"getRootNode"in Element.prototype&&(!window.ShadyDOM||!window.ShadyDOM.force)||o.push(e("polyfills/webcomponents.dae9f79d9d6992b6582e204c3dd953d3.js",!1)),!("noModule"in HTMLScriptElement.prototype)&&"getRootNode"in Element.prototype&&o.push(e("polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js",!1)),o.length?Promise.all(o).then(t):t()}();</script></body></html> | ||
<html lang="en-GB"><head><title>My app</title><style>my-app{display:block}</style><link rel="preload" href="app.js" as="script" crossorigin="anonymous"></head><body><h1><span>Hello world!</span></h1><my-app></my-app><script>window.importShim=t=>import(t.startsWith(".")?new URL(t,document.baseURI):t);</script><script src="polyfills/custom-b.36a50cce88edee34c249d0276be6531d.js" nomodule=""></script><script src="polyfills/core-js.577a5602a7262d6256830802d4aaab43.js" nomodule=""></script><script>!function(){function e(e,o){return new Promise((function(t,n){document.head.appendChild(Object.assign(document.createElement("script"),{src:e,onload:t,onerror:n},o?{type:"module"}:void 0))}))}var o=[];function t(){window.importShim("./app.js")}"foo"in window&&o.push(e("polyfills/custom-a.612310cce7c28a680112cc9eff6ef77c.js",!1)),"fetch"in window||o.push(e("polyfills/fetch.191258a74d74243758f52065f3d0962a.js",!1)),"noModule"in HTMLScriptElement.prototype&&!("importShim"in window)&&o.push(e("polyfills/dynamic-import.b745cfc9384367cc18b42bbef2bbdcd9.js",!1)),"attachShadow"in Element.prototype&&"getRootNode"in Element.prototype&&(!window.ShadyDOM||!window.ShadyDOM.force)||o.push(e("polyfills/webcomponents.d67d6757b8cd44bc35b021ee0b71d197.js",!1)),!("noModule"in HTMLScriptElement.prototype)&&"getRootNode"in Element.prototype&&o.push(e("polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js",!1)),o.length?Promise.all(o).then(t):t()}();</script></body></html> |
2 changes: 1 addition & 1 deletion
2
packages/building-utils/test/index-html/snapshots/create-index-html/polyfill-wc.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<html lang="en-GB"><head><title>My app</title><style>my-app{display:block}</style><link rel="preload" href="app.js" as="script" crossorigin="anonymous"></head><body><h1><span>Hello world!</span></h1><my-app></my-app><script>!function(){function e(e,o){return new Promise((function(t,n){document.head.appendChild(Object.assign(document.createElement("script"),{src:e,onload:t,onerror:n},o?{type:"module"}:void 0))}))}var o=[];function t(){window.importShim("./app.js")}"attachShadow"in Element.prototype&&"getRootNode"in Element.prototype&&(!window.ShadyDOM||!window.ShadyDOM.force)||o.push(e("polyfills/webcomponents.dae9f79d9d6992b6582e204c3dd953d3.js",!1)),!("noModule"in HTMLScriptElement.prototype)&&"getRootNode"in Element.prototype&&o.push(e("polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js",!1)),o.length?Promise.all(o).then(t):t()}();</script></body></html> | ||
<html lang="en-GB"><head><title>My app</title><style>my-app{display:block}</style><link rel="preload" href="app.js" as="script" crossorigin="anonymous"></head><body><h1><span>Hello world!</span></h1><my-app></my-app><script>!function(){function e(e,o){return new Promise((function(t,n){document.head.appendChild(Object.assign(document.createElement("script"),{src:e,onload:t,onerror:n},o?{type:"module"}:void 0))}))}var o=[];function t(){window.importShim("./app.js")}"attachShadow"in Element.prototype&&"getRootNode"in Element.prototype&&(!window.ShadyDOM||!window.ShadyDOM.force)||o.push(e("polyfills/webcomponents.d67d6757b8cd44bc35b021ee0b71d197.js",!1)),!("noModule"in HTMLScriptElement.prototype)&&"getRootNode"in Element.prototype&&o.push(e("polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js",!1)),o.length?Promise.all(o).then(t):t()}();</script></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 87 additions & 8 deletions
95
packages/es-dev-server/test/snapshots/polyfills-loader/auto.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,99 @@ | ||
<html> | ||
|
||
<head> | ||
<html><head> | ||
<title>My app</title> | ||
</head> | ||
|
||
<body> | ||
|
||
<!-- relative path --> | ||
<script type="module" src="./app.js"></script> | ||
|
||
|
||
<!-- upwards path --> | ||
<script type="module" src="../src/app.js"></script> | ||
|
||
|
||
<!-- absolute path --> | ||
<script type="module" src="/src/app.js"></script> | ||
|
||
|
||
|
||
|
||
<script>(function () { | ||
function polyfillsLoader() { | ||
function loadScript(src, type) { | ||
return new Promise(function (resolve) { | ||
var script = document.createElement('script'); | ||
|
||
function onLoaded() { | ||
document.head.removeChild(script); | ||
resolve(); | ||
} | ||
|
||
script.src = src; | ||
script.onload = onLoaded; | ||
|
||
script.onerror = function () { | ||
console.error('[polyfills-loader] failed to load: ' + src + ' check the network tab for HTTP status.'); | ||
onLoaded(); | ||
}; | ||
|
||
if (type) script.type = type; | ||
document.head.appendChild(script); | ||
}); | ||
} | ||
|
||
var polyfills = []; | ||
|
||
if (!('noModule' in HTMLScriptElement.prototype)) { | ||
polyfills.push(loadScript('./polyfills/regenerator-runtime.js')); | ||
} | ||
|
||
if (!('fetch' in window)) { | ||
polyfills.push(loadScript('./polyfills/fetch.js')); | ||
} | ||
|
||
if (!('attachShadow' in Element.prototype) || !('getRootNode' in Element.prototype)) { | ||
polyfills.push(loadScript('./polyfills/webcomponents.js')); | ||
} | ||
|
||
if (!('noModule' in HTMLScriptElement.prototype) && 'getRootNode' in Element.prototype) { | ||
polyfills.push(loadScript('./polyfills/custom-elements-es5-adapter.js')); | ||
} | ||
|
||
function loadFiles() { | ||
[function () { | ||
return loadScript('./app.js', 'module'); | ||
}, function () { | ||
return loadScript('../src/app.js', 'module'); | ||
}, function () { | ||
return loadScript('/src/app.js', 'module'); | ||
}].reduce(function (a, c) { | ||
return a.then(c); | ||
}, Promise.resolve()); | ||
} | ||
|
||
if (polyfills.length) { | ||
Promise.all(polyfills).then(loadFiles); | ||
} else { | ||
loadFiles(); | ||
} | ||
} | ||
|
||
if (!('noModule' in HTMLScriptElement.prototype)) { | ||
var s = document.createElement('script'); | ||
|
||
function onLoaded() { | ||
document.head.removeChild(s); | ||
polyfillsLoader(); | ||
} | ||
|
||
s.src = "polyfills/core-js.js"; | ||
s.onload = onLoaded; | ||
|
||
</body> | ||
s.onerror = function () { | ||
console.error('[polyfills-loader] failed to load: ' + s.src + ' check the network tab for HTTP status.'); | ||
onLoaded(); | ||
}; | ||
|
||
</html> | ||
document.head.appendChild(s); | ||
} else { | ||
polyfillsLoader(); | ||
} | ||
})();</script></body></html> |
Oops, something went wrong.