fix(javascript): move gzip compression to node-only builds, remove fflate#6154
Merged
fix(javascript): move gzip compression to node-only builds, remove fflate#6154
Conversation
3768ec3 to
012bbd4
Compare
Collaborator
💥 Breaking changes detected !!Either this PR or a previous PR not released yet introduced breaking changes, be careful when merging. ✔️ Code generated!
📊 Benchmark resultsBenchmarks performed on the method using a mock server, the results might not reflect the real-world performance.
|
baaeeb7 to
4f27825
Compare
4f27825 to
f404f22
Compare
…late Replace fflate (browser+node gzip library) with node:zlib for server builds and CompressionStream for browser/worker builds. Compression is now injected via a compress function in TransporterOptions. Node/fetch builds: synchronous gzip via node:zlib (always available). Browser/worker builds: async gzip via CompressionStream (noop if unavailable). compress is hidden from ClientOptions — internal implementation detail. - Remove fflate dependency from client-common - Replace compression?: 'gzip' with compress?: function on TransporterOptions - Add gzipSync in node/fetch/liteNode templates, CompressionStream in browser/worker - Enable bundlewatch size check on all PRs, not just release branches
d147145 to
d458af0
Compare
eric-zaharia
approved these changes
Mar 24, 2026
algolia-bot
added a commit
that referenced
this pull request
Mar 24, 2026
…late (#6154) (generated) [skip ci] Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
algolia-bot
added a commit
to algolia/algoliasearch-client-javascript
that referenced
this pull request
Mar 24, 2026
…late (generated) algolia/api-clients-automation#6154 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fflatefromclient-common, usenode:zlibin server builds insteadcompression: 'gzip'onClientOptionscompressionfrom options and provide nocompressimplementationContext
PR #6052 added
fflatetoclient-commonfor gzip compression. Sinceclient-commonis bundled into every browser UMD vianoExternal, fflate (~3.3KB gzip) ended up in all 13 browser bundles. Bundlewatch only ran on release branches, so this was never caught.Design
compression?: 'gzip'ClientOptions(public)compress?: (data: string) => Promise<Uint8Array>TransporterOptions(internal, hidden fromClientOptions)Node/fetch/liteNode: injects
compressvianode:zlib, user enables withcompression: 'gzip'.Browser/worker: no
compressimplementation,compressionstripped from user options at runtime. Manual browser compression is not recommended and blocked by CORS.If
compression: 'gzip'is set but nocompressmethod exists, the transporter logs a warning vialogger.infoand sends uncompressed. WithcreateNullLogger(default), the warning is silently swallowed.