Skip to content

Zlib's brotli methods are not supported #37

Open

Description

@pimterry

The zlib module's new (11.7+) brotli methods are not supported. Docs here: https://nodejs.org/api/zlib.html#zlib_class_zlib_brotlicompress.

Presumably this is because Pako doesn't support them? It'd be good to list this in the readme though.

Notably it is possible to at least decode brotli on the web using https://www.npmjs.com/package/brotli. The encode part of that package only works in node though.

Activity

  1. devongovett commented on Sep 7, 2019

    @devongovett
    Member

    I also maintain the brotli package. If you'd like to add support for brotli to browserify-zlib using a dependency on the brotli package, it would be a welcome PR!

    The encoding part should work in the browser too - it's ported with emscripten. The decoding is hand ported.

  2. pimterry commented on Sep 8, 2019

    @pimterry
    Author

    The encoding part should work in the browser too - it's ported with emscripten.

    Sadly it doesn't, see foliojs/brotli.js#20.

    In my app I do use brotli for decoding, but for encoding I use wasm-brotli instead. Works fine, I'm not sure how it compares in detail, but I suspect it won't play nicely anywhere without proper webassembly support.

  3. devongovett commented on Sep 8, 2019

    @devongovett
    Member

    Seems fairly safe now, except for IE 11: https://caniuse.com/#feat=wasm.

    I'd happily accept PRs to fix the browser issues in brotli. A WASM compiled version would also be greatly appreciated.

  4. devongovett commented on Sep 8, 2019

    @devongovett
    Member

    Also, I'm planning on transferring this repo to the browserify organization on GitHub so more maintainers can work on browserify-zlib.

  5. HeCorr commented on Jul 14, 2023

    @HeCorr

    Any update on this? it seems the brotli package has been abandoned and wasm-brotli is not working for me either in Webpack.

  6. pimterry commented on Jul 14, 2023

    @pimterry
    Author

    I had issues with wasm-brotli so I built https://github.com/httptoolkit/brotli-wasm, does that work for you @HeCorr?

  7. HeCorr commented on Jul 14, 2023

    @HeCorr

    @pimterry Sorry, that's the package I tried (I miswrote the name). I couldn't make it work with Webpack 5 because the project forces me to use import and brotli-wasm seems to enforce the web version unless I use require and I couldn't import either pkg.node or pkg.bundler directly. I'll create an issue in your repo soon.

  8. HeCorr commented on Jul 14, 2023

    @HeCorr

    @pimterry Never mind, the errors I was originally having suddenly went away and I'm getting different errors now (from a different package).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions