mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 04:46:34 +00:00
Update compatibility and fix polyfills for ES5 (#7298)
This commit is contained in:
parent
0641022ec5
commit
d3ad56a307
@ -52,7 +52,10 @@ module.exports.terserOptions = (latestBuild) => ({
|
|||||||
module.exports.babelOptions = ({ latestBuild }) => ({
|
module.exports.babelOptions = ({ latestBuild }) => ({
|
||||||
babelrc: false,
|
babelrc: false,
|
||||||
presets: [
|
presets: [
|
||||||
!latestBuild && [require("@babel/preset-env").default, { modules: false }],
|
!latestBuild && [
|
||||||
|
require("@babel/preset-env").default,
|
||||||
|
{ modules: false, useBuiltIns: "entry", corejs: 3 },
|
||||||
|
],
|
||||||
require("@babel/preset-typescript").default,
|
require("@babel/preset-typescript").default,
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
plugins: [
|
plugins: [
|
||||||
|
@ -88,11 +88,11 @@
|
|||||||
"chartjs-chart-timeline": "^0.3.0",
|
"chartjs-chart-timeline": "^0.3.0",
|
||||||
"codemirror": "^5.49.0",
|
"codemirror": "^5.49.0",
|
||||||
"comlink": "^4.3.0",
|
"comlink": "^4.3.0",
|
||||||
|
"core-js": "^3.6.5",
|
||||||
"cpx": "^1.5.0",
|
"cpx": "^1.5.0",
|
||||||
"cropperjs": "^1.5.7",
|
"cropperjs": "^1.5.7",
|
||||||
"deep-clone-simple": "^1.1.1",
|
"deep-clone-simple": "^1.1.1",
|
||||||
"deep-freeze": "^0.0.1",
|
"deep-freeze": "^0.0.1",
|
||||||
"es6-object-assign": "^1.1.0",
|
|
||||||
"fecha": "^4.2.0",
|
"fecha": "^4.2.0",
|
||||||
"fuse.js": "^6.0.0",
|
"fuse.js": "^6.0.0",
|
||||||
"google-timezones-json": "^1.0.2",
|
"google-timezones-json": "^1.0.2",
|
||||||
|
@ -1,33 +1,5 @@
|
|||||||
import objAssign from "es6-object-assign";
|
import "core-js";
|
||||||
import "mdn-polyfills/Array.prototype.includes";
|
|
||||||
import "regenerator-runtime/runtime";
|
import "regenerator-runtime/runtime";
|
||||||
import "unfetch/polyfill";
|
import "unfetch/polyfill";
|
||||||
// To use comlink under ES5
|
// To use comlink under ES5
|
||||||
import "proxy-polyfill";
|
import "proxy-polyfill";
|
||||||
|
|
||||||
objAssign.polyfill();
|
|
||||||
|
|
||||||
if (Object.values === undefined) {
|
|
||||||
Object.values = (target) => {
|
|
||||||
return Object.keys(target).map((key) => target[key]);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/* eslint-disable */
|
|
||||||
// https://github.com/uxitten/polyfill/blob/master/string.polyfill.js
|
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart
|
|
||||||
if (!String.prototype.padStart) {
|
|
||||||
String.prototype.padStart = function padStart(targetLength, padString) {
|
|
||||||
targetLength >>= 0; // truncate if number, or convert non-number to 0;
|
|
||||||
padString = String(typeof padString !== "undefined" ? padString : " ");
|
|
||||||
if (this.length >= targetLength) {
|
|
||||||
return String(this);
|
|
||||||
}
|
|
||||||
targetLength -= this.length;
|
|
||||||
if (targetLength > padString.length) {
|
|
||||||
padString += padString.repeat(targetLength / padString.length); // append to original to ensure we are longer than needed
|
|
||||||
}
|
|
||||||
return padString.slice(0, targetLength) + String(this);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
/* eslint-enable */
|
|
||||||
|
10
yarn.lock
10
yarn.lock
@ -5854,6 +5854,11 @@ core-js@^3.4.1:
|
|||||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.4.tgz#440a83536b458114b9cb2ac1580ba377dc470647"
|
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.4.tgz#440a83536b458114b9cb2ac1580ba377dc470647"
|
||||||
integrity sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==
|
integrity sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==
|
||||||
|
|
||||||
|
core-js@^3.6.5:
|
||||||
|
version "3.6.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a"
|
||||||
|
integrity sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==
|
||||||
|
|
||||||
core-util-is@1.0.2, core-util-is@~1.0.0:
|
core-util-is@1.0.2, core-util-is@~1.0.0:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||||
@ -6633,11 +6638,6 @@ es6-iterator@^2.0.1, es6-iterator@~2.0.3:
|
|||||||
es5-ext "^0.10.35"
|
es5-ext "^0.10.35"
|
||||||
es6-symbol "^3.1.1"
|
es6-symbol "^3.1.1"
|
||||||
|
|
||||||
es6-object-assign@^1.1.0:
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c"
|
|
||||||
integrity sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=
|
|
||||||
|
|
||||||
es6-symbol@^3.1.1, es6-symbol@~3.1.1:
|
es6-symbol@^3.1.1, es6-symbol@~3.1.1:
|
||||||
version "3.1.1"
|
version "3.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77"
|
resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user