mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 04:46:34 +00:00
Drop Babel
This commit is contained in:
parent
fe31f532b6
commit
7f10bcbfd1
@ -118,7 +118,24 @@ const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
|
|||||||
devtool: genDevTool(isProdBuild),
|
devtool: genDevTool(isProdBuild),
|
||||||
entry,
|
entry,
|
||||||
module: {
|
module: {
|
||||||
rules: [babelLoaderConfig({ latestBuild }), cssLoader, htmlLoader],
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.ts|tsx$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: "ts-loader",
|
||||||
|
options: {
|
||||||
|
compilerOptions: latestBuild
|
||||||
|
? { noEmit: false }
|
||||||
|
: { target: "es5", noEmit: false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
cssLoader,
|
||||||
|
htmlLoader,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
optimization: optimization(latestBuild),
|
optimization: optimization(latestBuild),
|
||||||
plugins: [
|
plugins: [
|
||||||
|
@ -161,6 +161,7 @@
|
|||||||
"require-dir": "^1.2.0",
|
"require-dir": "^1.2.0",
|
||||||
"sinon": "^7.3.1",
|
"sinon": "^7.3.1",
|
||||||
"terser-webpack-plugin": "^1.2.3",
|
"terser-webpack-plugin": "^1.2.3",
|
||||||
|
"ts-loader": "^6.0.4",
|
||||||
"ts-mocha": "^6.0.0",
|
"ts-mocha": "^6.0.0",
|
||||||
"tslint": "^5.14.0",
|
"tslint": "^5.14.0",
|
||||||
"tslint-config-prettier": "^1.18.0",
|
"tslint-config-prettier": "^1.18.0",
|
||||||
|
@ -14,7 +14,7 @@ import { HassElement } from "../state/hass-element";
|
|||||||
|
|
||||||
export class HomeAssistantAppEl extends HassElement {
|
export class HomeAssistantAppEl extends HassElement {
|
||||||
@property() private _route?: Route;
|
@property() private _route?: Route;
|
||||||
@property() private _error?: boolean;
|
@property() private _error = false;
|
||||||
@property() private _panelUrl?: string;
|
@property() private _panelUrl?: string;
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
@ -49,6 +49,7 @@ export class HomeAssistantAppEl extends HassElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected updated(changedProps: PropertyValues): void {
|
protected updated(changedProps: PropertyValues): void {
|
||||||
|
super.updated(changedProps);
|
||||||
if (changedProps.has("_panelUrl")) {
|
if (changedProps.has("_panelUrl")) {
|
||||||
this.panelUrlChanged(this._panelUrl!);
|
this.panelUrlChanged(this._panelUrl!);
|
||||||
this._updateHass({ panelUrl: this._panelUrl });
|
this._updateHass({ panelUrl: this._panelUrl });
|
||||||
@ -70,7 +71,11 @@ export class HomeAssistantAppEl extends HassElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _routeChanged(ev) {
|
private async _routeChanged(ev) {
|
||||||
|
// routeChangged event listener is called while we're doing the fist render,
|
||||||
|
// causing the update to be ignored. So delay it to next task (Lit render is sync).
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||||
|
|
||||||
const route = ev.detail.value as Route;
|
const route = ev.detail.value as Route;
|
||||||
// If it's the first route that we process,
|
// If it's the first route that we process,
|
||||||
// check if we should navigate away from /
|
// check if we should navigate away from /
|
||||||
|
@ -52,6 +52,7 @@ export class HaPanelCustom extends UpdatingElement {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const props = {};
|
const props = {};
|
||||||
|
// @ts-ignore
|
||||||
for (const key of changedProps.keys()) {
|
for (const key of changedProps.keys()) {
|
||||||
props[key] = this[key];
|
props[key] = this[key];
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,9 @@ class HuiPictureElementsCard extends LitElement implements LovelaceCard {
|
|||||||
|
|
||||||
set hass(hass: HomeAssistant) {
|
set hass(hass: HomeAssistant) {
|
||||||
this._hass = hass;
|
this._hass = hass;
|
||||||
for (const el of this.shadowRoot!.querySelectorAll("#root > *")) {
|
for (const el of Array.from(
|
||||||
|
this.shadowRoot!.querySelectorAll("#root > *")
|
||||||
|
)) {
|
||||||
const element = el as LovelaceElement;
|
const element = el as LovelaceElement;
|
||||||
element.hass = this._hass;
|
element.hass = this._hass;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { TemplateResult } from "lit-element";
|
import { TemplateResult } from "lit-element";
|
||||||
|
|
||||||
type LoadedRoundSlider = Promise<{
|
interface LoadedRoundSlider {
|
||||||
roundSliderStyle: TemplateResult;
|
roundSliderStyle: TemplateResult;
|
||||||
jQuery: any;
|
jQuery: any;
|
||||||
}>;
|
}
|
||||||
|
|
||||||
let loaded: LoadedRoundSlider;
|
let loaded: Promise<LoadedRoundSlider>;
|
||||||
|
|
||||||
export const loadRoundslider = async (): LoadedRoundSlider => {
|
export const loadRoundslider = async (): Promise<LoadedRoundSlider> => {
|
||||||
if (!loaded) {
|
if (!loaded) {
|
||||||
loaded = import(/* webpackChunkName: "jquery-roundslider" */ "./jquery.roundslider");
|
loaded = import(/* webpackChunkName: "jquery-roundslider" */ "./jquery.roundslider");
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import {
|
|||||||
Constructor,
|
Constructor,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
property,
|
property,
|
||||||
|
PropertyDeclarations,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { Auth, Connection } from "home-assistant-js-websocket";
|
import { Auth, Connection } from "home-assistant-js-websocket";
|
||||||
import { HomeAssistant } from "../types";
|
import { HomeAssistant } from "../types";
|
||||||
@ -26,8 +27,15 @@ export default <T>(superClass: Constructor<T>): Constructor<T & HassBaseEl> =>
|
|||||||
class extends superClass {
|
class extends superClass {
|
||||||
protected _pendingHass: Partial<HomeAssistant> = {};
|
protected _pendingHass: Partial<HomeAssistant> = {};
|
||||||
private __provideHass: HTMLElement[] = [];
|
private __provideHass: HTMLElement[] = [];
|
||||||
// @ts-ignore
|
|
||||||
@property() protected hass: HomeAssistant;
|
// Decorators not possible in anonymous classes
|
||||||
|
static get properties(): PropertyDeclarations {
|
||||||
|
return {
|
||||||
|
hass: {},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected hass!: HomeAssistant;
|
||||||
|
|
||||||
// Exists so all methods can safely call super method
|
// Exists so all methods can safely call super method
|
||||||
protected hassConnected() {
|
protected hassConnected() {
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
"sourceMap": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
|
54
yarn.lock
54
yarn.lock
@ -3653,6 +3653,13 @@ braces@^2.3.1, braces@^2.3.2:
|
|||||||
split-string "^3.0.2"
|
split-string "^3.0.2"
|
||||||
to-regex "^3.0.1"
|
to-regex "^3.0.1"
|
||||||
|
|
||||||
|
braces@^3.0.1:
|
||||||
|
version "3.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
|
||||||
|
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
|
||||||
|
dependencies:
|
||||||
|
fill-range "^7.0.1"
|
||||||
|
|
||||||
brorand@^1.0.1:
|
brorand@^1.0.1:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
|
resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
|
||||||
@ -5518,7 +5525,7 @@ engine.io@~3.3.1:
|
|||||||
engine.io-parser "~2.1.0"
|
engine.io-parser "~2.1.0"
|
||||||
ws "~6.1.0"
|
ws "~6.1.0"
|
||||||
|
|
||||||
enhanced-resolve@^4.1.0:
|
enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0:
|
||||||
version "4.1.0"
|
version "4.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f"
|
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f"
|
||||||
integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==
|
integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==
|
||||||
@ -6287,6 +6294,13 @@ fill-range@^4.0.0:
|
|||||||
repeat-string "^1.6.1"
|
repeat-string "^1.6.1"
|
||||||
to-regex-range "^2.1.0"
|
to-regex-range "^2.1.0"
|
||||||
|
|
||||||
|
fill-range@^7.0.1:
|
||||||
|
version "7.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
|
||||||
|
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
|
||||||
|
dependencies:
|
||||||
|
to-regex-range "^5.0.1"
|
||||||
|
|
||||||
filled-array@^1.0.0:
|
filled-array@^1.0.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/filled-array/-/filled-array-1.1.0.tgz#c3c4f6c663b923459a9aa29912d2d031f1507f84"
|
resolved "https://registry.yarnpkg.com/filled-array/-/filled-array-1.1.0.tgz#c3c4f6c663b923459a9aa29912d2d031f1507f84"
|
||||||
@ -8070,6 +8084,11 @@ is-number@^4.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff"
|
resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff"
|
||||||
integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==
|
integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==
|
||||||
|
|
||||||
|
is-number@^7.0.0:
|
||||||
|
version "7.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
|
||||||
|
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
|
||||||
|
|
||||||
is-obj@^1.0.0, is-obj@^1.0.1:
|
is-obj@^1.0.0, is-obj@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f"
|
resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f"
|
||||||
@ -9504,6 +9523,14 @@ micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8:
|
|||||||
snapdragon "^0.8.1"
|
snapdragon "^0.8.1"
|
||||||
to-regex "^3.0.2"
|
to-regex "^3.0.2"
|
||||||
|
|
||||||
|
micromatch@^4.0.0:
|
||||||
|
version "4.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259"
|
||||||
|
integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==
|
||||||
|
dependencies:
|
||||||
|
braces "^3.0.1"
|
||||||
|
picomatch "^2.0.5"
|
||||||
|
|
||||||
miller-rabin@^4.0.0:
|
miller-rabin@^4.0.0:
|
||||||
version "4.0.1"
|
version "4.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d"
|
resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d"
|
||||||
@ -10689,6 +10716,11 @@ performance-now@^2.1.0:
|
|||||||
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
|
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
|
||||||
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
|
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
|
||||||
|
|
||||||
|
picomatch@^2.0.5:
|
||||||
|
version "2.0.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6"
|
||||||
|
integrity sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==
|
||||||
|
|
||||||
pify@^2.0.0, pify@^2.3.0:
|
pify@^2.0.0, pify@^2.3.0:
|
||||||
version "2.3.0"
|
version "2.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
||||||
@ -12075,7 +12107,7 @@ semver-greatest-satisfied-range@^1.1.0:
|
|||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
|
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
|
||||||
integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==
|
integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==
|
||||||
|
|
||||||
semver@^6.1.2:
|
semver@^6.0.0, semver@^6.1.2:
|
||||||
version "6.3.0"
|
version "6.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
|
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
|
||||||
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
|
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
|
||||||
@ -13257,6 +13289,13 @@ to-regex-range@^2.1.0:
|
|||||||
is-number "^3.0.0"
|
is-number "^3.0.0"
|
||||||
repeat-string "^1.6.1"
|
repeat-string "^1.6.1"
|
||||||
|
|
||||||
|
to-regex-range@^5.0.1:
|
||||||
|
version "5.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
|
||||||
|
integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
|
||||||
|
dependencies:
|
||||||
|
is-number "^7.0.0"
|
||||||
|
|
||||||
to-regex@^3.0.1, to-regex@^3.0.2:
|
to-regex@^3.0.1, to-regex@^3.0.2:
|
||||||
version "3.0.2"
|
version "3.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce"
|
resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce"
|
||||||
@ -13321,6 +13360,17 @@ triple-beam@^1.2.0, triple-beam@^1.3.0:
|
|||||||
resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9"
|
resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9"
|
||||||
integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==
|
integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==
|
||||||
|
|
||||||
|
ts-loader@^6.0.4:
|
||||||
|
version "6.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-6.0.4.tgz#bc331ad91a887a60632d94c9f79448666f2c4b63"
|
||||||
|
integrity sha512-p2zJYe7OtwR+49kv4gs7v4dMrfYD1IPpOtqiSPCbe8oR+4zEBtdHwzM7A7M91F+suReqgzZrlClk4LRSSp882g==
|
||||||
|
dependencies:
|
||||||
|
chalk "^2.3.0"
|
||||||
|
enhanced-resolve "^4.0.0"
|
||||||
|
loader-utils "^1.0.2"
|
||||||
|
micromatch "^4.0.0"
|
||||||
|
semver "^6.0.0"
|
||||||
|
|
||||||
ts-mocha@^6.0.0:
|
ts-mocha@^6.0.0:
|
||||||
version "6.0.0"
|
version "6.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-6.0.0.tgz#40b8c5462ffce6f5dcee5ff729655b2958f26e50"
|
resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-6.0.0.tgz#40b8c5462ffce6f5dcee5ff729655b2958f26e50"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user