From 67ac3b4ba379c8b6426870d51f1a2540dd39928d Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 5 Jun 2020 02:04:19 -0700 Subject: [PATCH] Drop Custom Elements ES5 adapter (#6107) --- build-scripts/gulp/gather-static.js | 4 +++- cast/src/html/launcher-faq.html.template | 1 - cast/src/html/launcher.html.template | 1 - demo/src/html/index.html.template | 1 - hassio/src/entrypoint.ts | 9 ++------- src/html/authorize.html.template | 1 - src/html/index.html.template | 1 - src/html/onboarding.html.template | 1 - 8 files changed, 5 insertions(+), 14 deletions(-) diff --git a/build-scripts/gulp/gather-static.js b/build-scripts/gulp/gather-static.js index 0a16bf636e..ea5a29326f 100644 --- a/build-scripts/gulp/gather-static.js +++ b/build-scripts/gulp/gather-static.js @@ -36,11 +36,13 @@ function copyMdiIcons(staticDir) { function copyPolyfills(staticDir) { const staticPath = genStaticPath(staticDir); - // Web Component polyfills and adapters + // For custom panels using ES5 builds that don't use Babel 7+ copyFileDir( npmPath("@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"), staticPath("polyfills/") ); + + // Web Component polyfills and adapters copyFileDir( npmPath("@webcomponents/webcomponentsjs/webcomponents-bundle.js"), staticPath("polyfills/") diff --git a/cast/src/html/launcher-faq.html.template b/cast/src/html/launcher-faq.html.template index 30589f2703..59eea6a3a0 100644 --- a/cast/src/html/launcher-faq.html.template +++ b/cast/src/html/launcher-faq.html.template @@ -45,7 +45,6 @@ (function() { // // Safari 10.1 supports type=module but ignores nomodule, so we add this check. if (!isS101) { - _ls("/static/polyfills/custom-elements-es5-adapter.js"); <% if (useRollup) { %> _ls("/static/js/s.min.js").onload = function() { System.import("<%= es5LauncherJS %>"); diff --git a/cast/src/html/launcher.html.template b/cast/src/html/launcher.html.template index fd176a1e59..88de28b196 100644 --- a/cast/src/html/launcher.html.template +++ b/cast/src/html/launcher.html.template @@ -36,7 +36,6 @@ (function() { // // Safari 10.1 supports type=module but ignores nomodule, so we add this check. if (!isS101) { - _ls("/static/polyfills/custom-elements-es5-adapter.js"); <% if (useRollup) { %> _ls("/static/js/s.min.js").onload = function() { System.import("<%= es5LauncherJS %>"); diff --git a/demo/src/html/index.html.template b/demo/src/html/index.html.template index 0b045fddd8..87f16397a1 100644 --- a/demo/src/html/index.html.template +++ b/demo/src/html/index.html.template @@ -92,7 +92,6 @@ (function() { // // Safari 10.1 supports type=module but ignores nomodule, so we add this check. if (!isS101) { - _ls("/static/polyfills/custom-elements-es5-adapter.js"); <% if (useRollup) { %> _ls("/static/js/s.min.js").onload = function() { System.import("<%= es5DemoJS %>"); diff --git a/hassio/src/entrypoint.ts b/hassio/src/entrypoint.ts index 3bfa3ce898..10f2c3a23f 100644 --- a/hassio/src/entrypoint.ts +++ b/hassio/src/entrypoint.ts @@ -1,11 +1,6 @@ import "../../src/resources/compatibility"; - -window.loadES5Adapter().then(() => { - // eslint-disable-next-line - import(/* webpackChunkName: "roboto" */ "../../src/resources/roboto"); - // eslint-disable-next-line - import(/* webpackChunkName: "hassio-main" */ "./hassio-main"); -}); +import "../../src/resources/roboto"; +import "./hassio-main"; const styleEl = document.createElement("style"); styleEl.innerHTML = ` diff --git a/src/html/authorize.html.template b/src/html/authorize.html.template index 3cbcfda5ce..62b1fdf87b 100644 --- a/src/html/authorize.html.template +++ b/src/html/authorize.html.template @@ -47,7 +47,6 @@ (function() { // Safari 10.1 supports type=module but ignores nomodule, so we add this check. if (!isS101) { - _ls("/static/polyfills/custom-elements-es5-adapter.js"); <% if (useRollup) { %> _ls("/static/js/s.min.js").onload = function() { System.import("<%= es5PageJS %>"); diff --git a/src/html/index.html.template b/src/html/index.html.template index 7ce840a0e3..d61595003c 100644 --- a/src/html/index.html.template +++ b/src/html/index.html.template @@ -66,7 +66,6 @@ (function() { if (!window.latestJS) { window.customPanelJS = "<%= es5CustomPanelJS %>"; - _ls("/static/polyfills/custom-elements-es5-adapter.js"); <% if (useRollup) { %> _ls("/static/js/s.min.js").onload = function() { diff --git a/src/html/onboarding.html.template b/src/html/onboarding.html.template index 6acf158b58..126f67ab71 100644 --- a/src/html/onboarding.html.template +++ b/src/html/onboarding.html.template @@ -49,7 +49,6 @@ (function() { // Safari 10.1 supports type=module but ignores nomodule, so we add this check. if (!isS101) { - _ls("/static/polyfills/custom-elements-es5-adapter.js"); <% if (useRollup) { %> _ls("/static/js/s.min.js").onload = function() { System.import("<%= es5PageJS %>");