Use dynamic import for cast/demo to show latest build (#6202)

This commit is contained in:
Paulus Schoutsen 2020-06-22 10:24:54 -07:00 committed by GitHub
parent d0ba5696d1
commit 454ddf366a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 47 deletions

View File

@ -37,14 +37,13 @@
<body> <body>
<%= renderTemplate('_js_base') %> <%= renderTemplate('_js_base') %>
<script type="module" crossorigin="use-credentials"> <script>
import "<%= latestLauncherJS %>"; import("<%= latestLauncherJS %>");
window.latestJS = true;
</script> </script>
<script nomodule> <script>
(function() { if (!window.latestJS) {
// // Safari 10.1 supports type=module but ignores nomodule, so we add this check.
if (!isS101) {
<% if (useRollup) { %> <% if (useRollup) { %>
_ls("/static/js/s.min.js").onload = function() { _ls("/static/js/s.min.js").onload = function() {
System.import("<%= es5LauncherJS %>"); System.import("<%= es5LauncherJS %>");
@ -53,7 +52,6 @@
_ls("<%= es5LauncherJS %>"); _ls("<%= es5LauncherJS %>");
<% } %> <% } %>
} }
})();
</script> </script>
<hc-layout subtitle="FAQ"> <hc-layout subtitle="FAQ">

View File

@ -28,14 +28,13 @@
<hc-connect></hc-connect> <hc-connect></hc-connect>
<script type="module" crossorigin="use-credentials"> <script>
import "<%= latestLauncherJS %>"; import("<%= latestLauncherJS %>");
window.latestJS = true;
</script> </script>
<script nomodule> <script>
(function() { if (!window.latestJS) {
// // Safari 10.1 supports type=module but ignores nomodule, so we add this check.
if (!isS101) {
<% if (useRollup) { %> <% if (useRollup) { %>
_ls("/static/js/s.min.js").onload = function() { _ls("/static/js/s.min.js").onload = function() {
System.import("<%= es5LauncherJS %>"); System.import("<%= es5LauncherJS %>");
@ -44,7 +43,6 @@
_ls("<%= es5LauncherJS %>"); _ls("<%= es5LauncherJS %>");
<% } %> <% } %>
} }
})();
</script> </script>
<script> <script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

View File

@ -86,12 +86,13 @@
<%= renderTemplate('_js_base') %> <%= renderTemplate('_js_base') %>
<%= renderTemplate('_preload_roboto') %> <%= renderTemplate('_preload_roboto') %>
<script type="module" src="<%= latestDemoJS %>"></script> <script>
import("<%= latestDemoJS %>");
window.latestJS = true;
</script>
<script nomodule> <script>
(function() { if (!window.latestJS) {
// // Safari 10.1 supports type=module but ignores nomodule, so we add this check.
if (!isS101) {
<% if (useRollup) { %> <% if (useRollup) { %>
_ls("/static/js/s.min.js").onload = function() { _ls("/static/js/s.min.js").onload = function() {
System.import("<%= es5DemoJS %>"); System.import("<%= es5DemoJS %>");
@ -100,7 +101,6 @@
_ls("<%= es5DemoJS %>"); _ls("<%= es5DemoJS %>");
<% } %> <% } %>
} }
})();
</script> </script>
<script> <script>

View File

@ -52,7 +52,7 @@
<%= renderTemplate('_js_base') %> <%= renderTemplate('_js_base') %>
<%= renderTemplate('_preload_roboto') %> <%= renderTemplate('_preload_roboto') %>
<script> <script crossorigin="use-credentials">
import("<%= latestCoreJS %>"); import("<%= latestCoreJS %>");
import("<%= latestAppJS %>"); import("<%= latestAppJS %>");
window.customPanelJS = "<%= latestCustomPanelJS %>"; window.customPanelJS = "<%= latestCustomPanelJS %>";