[build] Remove gzip files (#138508)

* [build] Remove gzip files

All browsers in our support matrix support brotli.
https://caniuse.com/brotli

We still have fallbacks to hapi gzip, and uncompressed in the event of
an error.

* update snapshots

* fix

* update snapshots
This commit is contained in:
Jonathan Budzenski 2022-08-17 09:54:14 -04:00 committed by GitHub
parent 19db56efec
commit c4da7bd75a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 3 additions and 58 deletions

View file

@ -1182,7 +1182,6 @@
"geckodriver": "^3.0.2",
"gulp-babel": "^8.0.0",
"gulp-brotli": "^3.0.0",
"gulp-gzip": "^1.4.2",
"gulp-postcss": "^9.0.1",
"gulp-sourcemaps": "2.6.5",
"gulp-terser": "^2.1.0",

View file

@ -261,9 +261,4 @@ const expectFileMatchesSnapshotWithCompression = (filePath: string, snapshotLabe
Fs.readFileSync(Path.resolve(MOCK_REPO_DIR, `${filePath}.br`))
).toString()
).toEqual(raw);
// Verify the gzip variant matches
expect(
Zlib.gunzipSync(Fs.readFileSync(Path.resolve(MOCK_REPO_DIR, `${filePath}.gz`))).toString()
).toEqual(raw);
};

View file

@ -282,12 +282,6 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker:
level: 11,
},
}),
new CompressionPlugin({
algorithm: 'gzip',
filename: '[path].gz',
test: /\.(js|css)$/,
cache: false,
}),
],
optimization: {

View file

@ -95,10 +95,8 @@ it('builds a generated plugin into a viable archive', async () => {
"kibana/fooTestPlugin/server/types.js",
"kibana/fooTestPlugin/target/public/fooTestPlugin.chunk.1.js",
"kibana/fooTestPlugin/target/public/fooTestPlugin.chunk.1.js.br",
"kibana/fooTestPlugin/target/public/fooTestPlugin.chunk.1.js.gz",
"kibana/fooTestPlugin/target/public/fooTestPlugin.plugin.js",
"kibana/fooTestPlugin/target/public/fooTestPlugin.plugin.js.br",
"kibana/fooTestPlugin/target/public/fooTestPlugin.plugin.js.gz",
"kibana/fooTestPlugin/translations/ja-JP.json",
"kibana/fooTestPlugin/tsconfig.json",
]

View file

@ -40,10 +40,6 @@ export async function selectCompressedFile(acceptEncodingHeader: string | undefi
fileEncoding = 'br';
fd = await tryToOpenFile(`${path}.br`);
}
if (!fd && supportedEncodings.includes('gzip')) {
fileEncoding = 'gzip';
fd = await tryToOpenFile(`${path}.gz`);
}
}
if (!fd) {

View file

@ -14,8 +14,6 @@ import fs from 'fs';
import gulpBrotli from 'gulp-brotli';
// @ts-expect-error
import gulpGzip from 'gulp-gzip';
// @ts-expect-error
import gulpPostCSS from 'gulp-postcss';
// @ts-expect-error
import gulpTerser from 'gulp-terser';
@ -66,17 +64,6 @@ async function optimizeAssets(log: ToolingLog, assetDir: string) {
}),
vfs.dest(assetDir)
);
log.debug('GZip compress');
await asyncPipeline(
vfs.src(['**/*.{js,css}'], { cwd: assetDir }),
gulpGzip({
gzipOptions: {
level: 9,
},
}),
vfs.dest(assetDir)
);
} finally {
log.indent(-4);
}

View file

@ -9536,11 +9536,6 @@ any-observable@^0.3.0:
resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b"
integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==
any-promise@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
integrity sha1-q8av7tzqUugJzcA3au0845Y10X8=
anymatch@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb"
@ -10952,7 +10947,7 @@ bytes@3.0.0:
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=
bytes@3.1.2, bytes@^3.0.0:
bytes@3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5"
integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==
@ -15143,7 +15138,7 @@ faker@^5.1.0:
resolved "https://registry.yarnpkg.com/faker/-/faker-5.1.0.tgz#e10fa1dec4502551aee0eb771617a7e7b94692e8"
integrity sha512-RrWKFSSA/aNLP0g3o2WW1Zez7/MnMr7xkiZmoCfAGZmdkDQZ6l2KtuXHN5XjdvpRjDl8+3vf+Rrtl06Z352+Mw==
fancy-log@^1.3.2, fancy-log@^1.3.3:
fancy-log@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7"
integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==
@ -16458,18 +16453,6 @@ gulp-brotli@^3.0.0:
plugin-error "^1.0.1"
through2 "^3.0.1"
gulp-gzip@^1.4.2:
version "1.4.2"
resolved "https://registry.yarnpkg.com/gulp-gzip/-/gulp-gzip-1.4.2.tgz#0422a94014248655b5b1a9eea1c2abee1d4f4337"
integrity sha512-ZIxfkUwk2XmZPTT9pPHrHUQlZMyp9nPhg2sfoeN27mBGpi7OaHnOD+WCN41NXjfJQ69lV1nQ9LLm1hYxx4h3UQ==
dependencies:
ansi-colors "^1.0.1"
bytes "^3.0.0"
fancy-log "^1.3.2"
plugin-error "^1.0.0"
stream-to-array "^2.3.0"
through2 "^2.0.3"
gulp-postcss@^9.0.1:
version "9.0.1"
resolved "https://registry.yarnpkg.com/gulp-postcss/-/gulp-postcss-9.0.1.tgz#d43caa2f2ce1018f889f7c1296faf82e9928b66f"
@ -22601,7 +22584,7 @@ playwright@^1.17.1:
dependencies:
playwright-core "=1.17.1"
plugin-error@^1.0.0, plugin-error@^1.0.1:
plugin-error@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c"
integrity sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==
@ -26527,13 +26510,6 @@ stream-splicer@^2.0.0:
inherits "^2.0.1"
readable-stream "^2.0.2"
stream-to-array@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/stream-to-array/-/stream-to-array-2.3.0.tgz#bbf6b39f5f43ec30bc71babcb37557acecf34353"
integrity sha1-u/azn19D7DC8cbq8s3VXrOzzQ1M=
dependencies:
any-promise "^1.1.0"
stream-to-async-iterator@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/stream-to-async-iterator/-/stream-to-async-iterator-0.2.0.tgz#bef5c885e9524f98b2fa5effecc357bd58483780"