Skip to content

Commit

Permalink
Remove Zopfli compression (#23157)
Browse files Browse the repository at this point in the history
  • Loading branch information
MindFreeze authored Dec 5, 2024
1 parent 926972c commit 4092f56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 95 deletions.
32 changes: 2 additions & 30 deletions build-scripts/gulp/compress.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { constants } from "node:zlib";
import gulp from "gulp";
import brotli from "gulp-brotli";
import zopfli from "gulp-zopfli-green";
import paths from "../paths.cjs";

const filesGlob = "*.{js,json,css,svg,xml}";
Expand All @@ -13,7 +12,6 @@ const brotliOptions = {
[constants.BROTLI_PARAM_QUALITY]: constants.BROTLI_MAX_QUALITY,
},
};
const zopfliOptions = { threshold: 150 };

const compressDistBrotli = (rootDir, modernDir, compressServiceWorker = true) =>
gulp
Expand All @@ -29,20 +27,6 @@ const compressDistBrotli = (rootDir, modernDir, compressServiceWorker = true) =>
.pipe(brotli(brotliOptions))
.pipe(gulp.dest(rootDir));

const compressDistZopfli = (rootDir, modernDir, compressModern = false) =>
gulp
.src(
[
`${rootDir}/**/${filesGlob}`,
compressModern ? undefined : `!${modernDir}/**/${filesGlob}`,
`!${rootDir}/{sw-modern,service_worker}.js`,
`${rootDir}/{authorize,onboarding}.html`,
].filter(Boolean),
{ base: rootDir }
)
.pipe(zopfli(zopfliOptions))
.pipe(gulp.dest(rootDir));

const compressAppBrotli = () =>
compressDistBrotli(paths.app_output_root, paths.app_output_latest);
const compressHassioBrotli = () =>
Expand All @@ -52,17 +36,5 @@ const compressHassioBrotli = () =>
false
);

const compressAppZopfli = () =>
compressDistZopfli(paths.app_output_root, paths.app_output_latest);
const compressHassioZopfli = () =>
compressDistZopfli(
paths.hassio_output_root,
paths.hassio_output_latest,
true
);

gulp.task("compress-app", gulp.parallel(compressAppBrotli, compressAppZopfli));
gulp.task(
"compress-hassio",
gulp.parallel(compressHassioBrotli, compressHassioZopfli)
);
gulp.task("compress-app", compressAppBrotli);
gulp.task("compress-hassio", compressHassioBrotli);
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@
"gulp-brotli": "3.0.0",
"gulp-json-transform": "0.5.0",
"gulp-rename": "2.0.0",
"gulp-zopfli-green": "6.0.2",
"html-minifier-terser": "7.2.0",
"husky": "9.1.7",
"jszip": "3.10.1",
Expand Down
69 changes: 5 additions & 64 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1843,15 +1843,6 @@ __metadata:
languageName: node
linkType: hard

"@gfx/zopfli@npm:^1.0.15":
version: 1.0.15
resolution: "@gfx/zopfli@npm:1.0.15"
dependencies:
base64-js: "npm:^1.3.0"
checksum: 10/2721ad8c0cbbdac7d5ca9e01ad05f232b4e3cdcecf88f9b0ef9a2bdc7d05e1ca54ea68905430cf36338ef1077acec178aa7b258c67baa7a4c2b6d74067605723
languageName: node
linkType: hard

"@gulpjs/messages@npm:^1.1.0":
version: 1.1.0
resolution: "@gulpjs/messages@npm:1.1.0"
Expand Down Expand Up @@ -5984,13 +5975,6 @@ __metadata:
languageName: node
linkType: hard

"any-promise@npm:^1.1.0":
version: 1.3.0
resolution: "any-promise@npm:1.3.0"
checksum: 10/6737469ba353b5becf29e4dc3680736b9caa06d300bda6548812a8fee63ae7d336d756f88572fa6b5219aed36698d808fa55f62af3e7e6845c7a1dc77d240edb
languageName: node
linkType: hard

"anymatch@npm:^3.1.3, anymatch@npm:~3.1.2":
version: 3.1.3
resolution: "anymatch@npm:3.1.3"
Expand Down Expand Up @@ -6361,7 +6345,7 @@ __metadata:
languageName: node
linkType: hard

"base64-js@npm:^1.3.0, base64-js@npm:^1.3.1":
"base64-js@npm:^1.3.1":
version: 1.5.1
resolution: "base64-js@npm:1.5.1"
checksum: 10/669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005
Expand Down Expand Up @@ -6575,7 +6559,7 @@ __metadata:
languageName: node
linkType: hard

"bytes@npm:3.1.2, bytes@npm:^3.1.2":
"bytes@npm:3.1.2":
version: 3.1.2
resolution: "bytes@npm:3.1.2"
checksum: 10/a10abf2ba70c784471d6b4f58778c0beeb2b5d405148e66affa91f23a9f13d07603d0a0354667310ae1d6dc141474ffd44e2a074be0f6e2254edb8fc21445388
Expand Down Expand Up @@ -7434,7 +7418,7 @@ __metadata:
languageName: node
linkType: hard

"defaults@npm:^1.0.3, defaults@npm:^1.0.4":
"defaults@npm:^1.0.3":
version: 1.0.4
resolution: "defaults@npm:1.0.4"
dependencies:
Expand Down Expand Up @@ -8540,7 +8524,7 @@ __metadata:
languageName: node
linkType: hard

"fancy-log@npm:2.0.0, fancy-log@npm:^2.0.0":
"fancy-log@npm:2.0.0":
version: 2.0.0
resolution: "fancy-log@npm:2.0.0"
dependencies:
Expand Down Expand Up @@ -9346,21 +9330,6 @@ __metadata:
languageName: node
linkType: hard

"gulp-zopfli-green@npm:6.0.2":
version: 6.0.2
resolution: "gulp-zopfli-green@npm:6.0.2"
dependencies:
"@gfx/zopfli": "npm:^1.0.15"
bytes: "npm:^3.1.2"
defaults: "npm:^1.0.4"
fancy-log: "npm:^2.0.0"
plugin-error: "npm:^2.0.1"
stream-to-array: "npm:^2.3.0"
through2: "npm:^4.0.2"
checksum: 10/52e899dfb86777ff8f97a23af99c59e203ea485fbf04d0a8f4f1cfbd4d4c496808a3593ae8dac16584fc4b4d81cf127b2eda5355a61bcc213875c95cc86d41da
languageName: node
linkType: hard

"gulp@npm:5.0.0":
version: 5.0.0
resolution: "gulp@npm:5.0.0"
Expand Down Expand Up @@ -9636,7 +9605,6 @@ __metadata:
gulp-brotli: "npm:3.0.0"
gulp-json-transform: "npm:0.5.0"
gulp-rename: "npm:2.0.0"
gulp-zopfli-green: "npm:6.0.2"
hls.js: "patch:hls.js@npm%3A1.5.7#~/.yarn/patches/hls.js-npm-1.5.7-f5bbd3d060.patch"
home-assistant-js-websocket: "npm:9.4.0"
html-minifier-terser: "npm:7.2.0"
Expand Down Expand Up @@ -12655,15 +12623,6 @@ __metadata:
languageName: node
linkType: hard

"plugin-error@npm:^2.0.1":
version: 2.0.1
resolution: "plugin-error@npm:2.0.1"
dependencies:
ansi-colors: "npm:^1.0.1"
checksum: 10/9a4f91461cd24cce401112098969991d7aa6b4c94f78e0381234280c07da779570a8b21ab143292b534ec0117c09705a67e5d756c1c303d4706fdd7f861bf5bc
languageName: node
linkType: hard

"pngjs@npm:^3.0.0, pngjs@npm:^3.3.3":
version: 3.4.0
resolution: "pngjs@npm:3.4.0"
Expand Down Expand Up @@ -12911,7 +12870,7 @@ __metadata:
languageName: node
linkType: hard

"readable-stream@npm:2 || 3, readable-stream@npm:3, readable-stream@npm:^3.0.6, readable-stream@npm:^3.4.0, readable-stream@npm:^3.6.0":
"readable-stream@npm:2 || 3, readable-stream@npm:^3.0.6, readable-stream@npm:^3.4.0, readable-stream@npm:^3.6.0":
version: 3.6.2
resolution: "readable-stream@npm:3.6.2"
dependencies:
Expand Down Expand Up @@ -14058,15 +14017,6 @@ __metadata:
languageName: node
linkType: hard

"stream-to-array@npm:^2.3.0":
version: 2.3.0
resolution: "stream-to-array@npm:2.3.0"
dependencies:
any-promise: "npm:^1.1.0"
checksum: 10/7feaf63b38399b850615e6ffcaa951e96e4c8f46745dbce4b553a94c5dc43966933813747014935a3ff97793e7f30a65270bde19f82b2932871a1879229a77cf
languageName: node
linkType: hard

"streamx@npm:^2.12.0, streamx@npm:^2.12.5, streamx@npm:^2.13.2, streamx@npm:^2.14.0":
version: 2.20.1
resolution: "streamx@npm:2.20.1"
Expand Down Expand Up @@ -14513,15 +14463,6 @@ __metadata:
languageName: node
linkType: hard

"through2@npm:^4.0.2":
version: 4.0.2
resolution: "through2@npm:4.0.2"
dependencies:
readable-stream: "npm:3"
checksum: 10/72c246233d9a989bbebeb6b698ef0b7b9064cb1c47930f79b25d87b6c867e075432811f69b7b2ac8da00ca308191c507bdab913944be8019ac43b036ce88f6ba
languageName: node
linkType: hard

"thunky@npm:^1.0.2":
version: 1.1.0
resolution: "thunky@npm:1.1.0"
Expand Down

0 comments on commit 4092f56

Please sign in to comment.