rusackas commented on code in PR #39369:
URL: https://github.com/apache/superset/pull/39369#discussion_r3263753541
##########
superset-frontend/package.json:
##########
@@ -223,7 +223,7 @@
"redux-undo": "^1.0.0-beta9-9-7",
"rison": "^0.1.1",
"scroll-into-view-if-needed": "^3.1.0",
- "simple-zstd": "^1.4.2",
+ "simple-zstd": "^2.1.0",
Review Comment:
The repo already requires Node ≥22 — `superset-frontend/package.json`
declares `"engines": { "node": "^22.22.0" }`. CI matrix runs Node 22 in the
`current` and `next` variants. The `previous` variant runs Node 20, which trips
an `EBADENGINE` *warning* (non-fatal), not a hard install failure. No action
needed.
##########
superset-frontend/webpack.proxy-config.js:
##########
@@ -17,7 +17,7 @@
* under the License.
*/
const zlib = require('zlib');
-const { ZSTDDecompress } = require('simple-zstd');
+const { decompress: zstdDecompress } = require('simple-zstd');
Review Comment:
v2's `decompress(opts?)` returns `Promise<Duplex>` — it's the streaming
variant. The one-shot Buffer→Buffer function is `decompressBuffer(buffer,
opts?)`. The PR's `uncompress = await zstdDecompress()` correctly awaits the
Promise to get a `Duplex`, which is pipeable via
`originalResponse.pipe(uncompress)`. See
[`dist/src/index.d.ts`](https://unpkg.com/[email protected]/dist/src/index.d.ts):
`export declare function decompress(opts?: ZSTDOpts): Promise<Duplex>`.
##########
superset-frontend/webpack.proxy-config.js:
##########
@@ -116,21 +116,21 @@ function copyHeaders(originalResponse, response) {
* Manipulate HTML server response to replace asset files with
* local webpack-dev-server build.
*/
-function processHTML(proxyResponse, response) {
+async function processHTML(proxyResponse, response) {
let body = Buffer.from([]);
let originalResponse = proxyResponse;
- let uncompress;
const responseEncoding = originalResponse.headers['content-encoding'];
// decode GZIP response
+ let uncompress;
if (responseEncoding === 'gzip') {
uncompress = zlib.createGunzip();
} else if (responseEncoding === 'br') {
uncompress = zlib.createBrotliDecompress();
} else if (responseEncoding === 'deflate') {
uncompress = zlib.createInflate();
} else if (responseEncoding === 'zstd') {
- uncompress = ZSTDDecompress();
+ uncompress = await zstdDecompress();
Review Comment:
Same as the `:20` thread — v2's `decompress(opts?): Promise<Duplex>` is the
streaming API, not the Buffer→Buffer one. Awaiting it yields a Duplex stream
that `originalResponse.pipe(uncompress)` correctly accepts.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]