Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace zip dependencies for CompressionStream browser API #2703

Open
oliviertassinari opened this issue Feb 22, 2024 · 3 comments
Open

Replace zip dependencies for CompressionStream browser API #2703

oliviertassinari opened this issue Feb 22, 2024 · 3 comments

Comments

@oliviertassinari
Copy link

oliviertassinari commented Feb 22, 2024

🚀 Feature Proposal

Replace zip dependencies for the CompressionStream browser API.

There might be a need for separate browser and server bundles.

Motivation

This project has a dependency on jszip, archiver, and unzipper:

exceljs/package.json

Lines 98 to 108 in 5bed18b

"dependencies": {
"archiver": "^5.0.0",
"dayjs": "^1.8.34",
"fast-csv": "^4.3.1",
"jszip": "^3.10.1",
"readable-stream": "^3.6.0",
"saxes": "^5.0.1",
"tmp": "^0.2.0",
"unzipper": "^0.10.11",
"uuid": "^8.3.0"
},

which are bundlesize heavy https://bundlephobia.com/package/jszip, over 150 kB gzipped combined. Instead, we could use https://developer.mozilla.org/en-US/docs/Web/API/Compression_Streams_API. The browser support starts to be good enough.

@cherniavskii
Copy link

This would also solve #713 (comment) 👍🏻

@pnappa
Copy link

pnappa commented Feb 29, 2024

The above linked PR removes the node-unzipper dependency with another one (see #2687). The reason for doing so was:

a) remove a security vulnerability in a transitive dependency of node-unzipper, and
b) remove a transitive dependency on a package with no licensing.

However, I believe what's suggested here is even better than using the yauzl-promise library (given it also addresses package size). Note that implementing zipping via the CompressionStream API would bump the required NodeJS version to version 18, but my above linked PR also does so.

I'm not even using this library, so I don't have the bandwidth to port this (and I'm not sure if it'll be merged, given the bump in minimum node version), but it'll probably be about a 4-8 hour patch?

@AyushAher
Copy link

@alubbe @Siemienik @Alanscut Could you please investigate this issue? The node-unzipper library is no longer maintained and has known vulnerabilities. Consequently, we cannot use the exceljs library in projects where security vulnerabilities are a significant concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants