mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Move compatibility to the top of custom panel entrypoint (#6055)
This commit is contained in:
parent
3a5bd7474b
commit
5cb7117656
@ -1,3 +1,4 @@
|
||||
import "../resources/compatibility";
|
||||
import { PolymerElement } from "@polymer/polymer";
|
||||
import { fireEvent } from "../common/dom/fire_event";
|
||||
import { loadJS } from "../common/dom/load_resource";
|
||||
@ -17,12 +18,9 @@ let es5Loaded: Promise<unknown> | undefined;
|
||||
|
||||
window.loadES5Adapter = () => {
|
||||
if (!es5Loaded) {
|
||||
es5Loaded = Promise.all([
|
||||
loadJS(
|
||||
`${__STATIC_PATH__}polyfills/custom-elements-es5-adapter.js`
|
||||
).catch(),
|
||||
import(/* webpackChunkName: "compat" */ "../resources/compatibility"),
|
||||
]);
|
||||
es5Loaded = loadJS(
|
||||
`${__STATIC_PATH__}polyfills/custom-elements-es5-adapter.js`
|
||||
).catch(); // Swallow errors as it raises errors on old browsers.
|
||||
}
|
||||
return es5Loaded;
|
||||
};
|
||||
@ -51,7 +49,6 @@ function initialize(panel: CustomPanelInfo, properties: {}) {
|
||||
}
|
||||
|
||||
if (__BUILD__ === "es5") {
|
||||
// Load ES5 adapter. Swallow errors as it raises errors on old browsers.
|
||||
start = start.then(() => window.loadES5Adapter());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user