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

Provide zip.esm.min.js #441

Closed
rwv opened this issue Aug 8, 2023 · 6 comments
Closed

Provide zip.esm.min.js #441

rwv opened this issue Aug 8, 2023 · 6 comments

Comments

@rwv
Copy link

rwv commented Aug 8, 2023

Could you please provide a zip.esm.min.js in dist/? index.js is esm but not suitable for browser usage.

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Aug 8, 2023

What do you mean by "not suitable for browser usage"? Here is a demo which imports index.js and works fine in browsers: https://jsfiddle.net/dns7pkxt/

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Aug 8, 2023

I added the file in the version 2.7.22. It is named index.min.js and located in the root folder of the project. You can find a demo here: https://jsfiddle.net/zjy1r29p/.

@rwv
Copy link
Author

rwv commented Aug 9, 2023

What do you mean by "not suitable for browser usage"? Here is a demo which imports index.js and works fine in browsers: https://jsfiddle.net/dns7pkxt/

index.js is not bundled and minified. In browser environment this will have multiple http request and increase latency.

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Aug 9, 2023

In 2023, as a library provider and even though I added the bundled file in the project, I consider I am not supposed to provide a bundled ES2015 module. You're supposed, as an integrator, to do this job via the toolchain of your application/website. This is one of the major features of modules, in ES2015 or Node.js.

@rwv
Copy link
Author

rwv commented Aug 9, 2023

My use case is to import @zip.js/zip.js directly in browser from public CDN like JsDelivr, increase performance and cache can be shared across sites. But you’re right, this is a niche case. Thank you again for creating such a wonderful project!

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Aug 9, 2023

You're welcome and thank you for your continued support!

I agree that it looks like HTTP/3 and QUIC are not yet sufficient to solve this issue today, unfortunately. I hope that in the future no one will have to use bundlers, like in the 90s :)

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

2 participants