Switch onboarding and auth to dynamic import

This commit is contained in:
Paulus Schoutsen 2020-10-12 14:10:15 +00:00
parent 993d73c359
commit 3717e94814
2 changed files with 10 additions and 10 deletions

View File

@ -44,17 +44,17 @@
<%= renderTemplate('_js_base') %>
<%= renderTemplate('_preload_roboto') %>
<script type="module" crossorigin="use-credentials">
import "<%= latestPageJS %>";
<script crossorigin="use-credentials">
import("<%= latestPageJS %>");
window.latestJS = true;
window.providersPromise = fetch("/auth/providers", {
credentials: "same-origin",
});
</script>
<script nomodule>
<script>
(function() {
// Safari 10.1 supports type=module but ignores nomodule, so we add this check.
if (!isS101) {
if (!window.latestJS) {
<% if (useRollup) { %>
_ls("/static/js/s.min.js").onload = function() {
System.import("<%= es5PageJS %>");

View File

@ -52,17 +52,17 @@
<%= renderTemplate('_js_base') %>
<%= renderTemplate('_preload_roboto') %>
<script type="module" crossorigin="use-credentials">
import "<%= latestPageJS %>";
<script crossorigin="use-credentials">
import("<%= latestPageJS %>");
window.latestJS = true;
window.stepsPromise = fetch("/api/onboarding", {
credentials: "same-origin",
});
</script>
<script nomodule>
<script>
(function() {
// Safari 10.1 supports type=module but ignores nomodule, so we add this check.
if (!isS101) {
if (!window.latestJS) {
<% if (useRollup) { %>
_ls("/static/js/s.min.js").onload = function() {
System.import("<%= es5PageJS %>");