Skip to content

Commit

Permalink
Update HA FE to 20240404.2 and translation fallback (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
farmio authored Apr 23, 2024
1 parent f187f2e commit ed98722
Show file tree
Hide file tree
Showing 12 changed files with 3,657 additions and 3,388 deletions.
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: homeassistant-frontend/.yarn/releases/yarn-4.0.2.cjs
yarnPath: homeassistant-frontend/.yarn/releases/yarn-4.1.1.cjs
5 changes: 3 additions & 2 deletions build-scripts/bundle.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const path = require("path");
const env = require("./env.cjs");
const paths = require("./paths.cjs");
const { dependencies } = require("../package.json");

// Files from NPM Packages that should not be imported
module.exports.ignorePackages = () => [];
Expand Down Expand Up @@ -76,7 +77,7 @@ module.exports.babelOptions = ({ latestBuild }) => ({
"@babel/preset-env",
{
useBuiltIns: latestBuild ? false : "usage",
corejs: latestBuild ? false : "3.33",
corejs: latestBuild ? false : dependencies["core-js"],
bugfixes: true,
shippedProposals: true,
},
Expand All @@ -101,7 +102,7 @@ module.exports.babelOptions = ({ latestBuild }) => ({
// Import helpers and regenerator from runtime package
[
"@babel/plugin-transform-runtime",
{ version: require("../package.json").dependencies["@babel/runtime"] },
{ version: dependencies["@babel/runtime"] },
],
// Support some proposals still in TC39 process
["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: true }],
Expand Down
5 changes: 4 additions & 1 deletion build-scripts/gulp/compress.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ const zopfliOptions = { threshold: 150 };

const compressDist = (rootDir) =>
gulp
.src([`${rootDir}/**/*.{js,json,css,svg}`])
.src([
`${rootDir}/**/*.{js,json,css,svg,xml}`,
`${rootDir}/{authorize,onboarding}.html`,
])
.pipe(zopfli(zopfliOptions))
.pipe(gulp.dest(rootDir));

Expand Down
20 changes: 6 additions & 14 deletions build-scripts/webpack.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const { WebpackManifestPlugin } = require("webpack-manifest-plugin");
const log = require("fancy-log");
const WebpackBar = require("webpackbar");
const {
TransformAsyncModulesPlugin,
} = require("transform-async-modules-webpack-plugin");
const paths = require("./paths.cjs");
const bundle = require("./bundle.cjs");

Expand Down Expand Up @@ -140,25 +143,14 @@ const createWebpackConfig = ({
"homeassistant-frontend/src/util/empty.js"
)
),
// See `src/resources/intl-polyfill-legacy.ts` for explanation
!latestBuild &&
new webpack.NormalModuleReplacementPlugin(
new RegExp(
path.resolve(
paths.polymer_dir,
"homeassistant-frontend/src/resources/intl-polyfill.ts"
)
),
path.resolve(
paths.polymer_dir,
"homeassistant-frontend/src/resources/intl-polyfill-legacy.ts"
)
),
!isProdBuild && new LogStartCompilePlugin(),
!latestBuild &&
new TransformAsyncModulesPlugin({ browserslistEnv: "legacy" }),
].filter(Boolean),
resolve: {
extensions: [".ts", ".js", ".json"],
alias: {
"lit/static-html$": "lit/static-html.js",
"lit/decorators$": "lit/decorators.js",
"lit/directive$": "lit/directive.js",
"lit/directives/until$": "lit/directives/until.js",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant-frontend
Loading

0 comments on commit ed98722

Please sign in to comment.