Skip to content

compress-brotli - feat: moving to native zlib brotli engine#1841

Merged
jaredwray merged 2 commits intomainfrom
compress-brotli---feat-moving-to-native-zlib-brotli-engine
Feb 12, 2026
Merged

compress-brotli - feat: moving to native zlib brotli engine#1841
jaredwray merged 2 commits intomainfrom
compress-brotli---feat-moving-to-native-zlib-brotli-engine

Conversation

@jaredwray
Copy link
Owner

@jaredwray jaredwray commented Feb 12, 2026

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
compress-brotli - feat: moving to native zlib brotli engine

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jaredwray, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly updates the compress-brotli package by migrating its compression and decompression functionality from an external library to Node.js's built-in zlib module. This change streamlines the dependency tree, potentially improves performance by leveraging native implementations, and provides more granular control over the compression process through internal serialization and deserialization handling.

Highlights

  • Native Brotli Engine Adoption: The compress-brotli package has been refactored to utilize Node.js's native zlib Brotli compression and decompression functions, removing the dependency on an external compress-brotli library.
  • Dependency Removal: The external compress-brotli package and its associated dependencies (@types/json-buffer, json-buffer) have been removed from the project's package.json and pnpm-lock.yaml.
  • Internal Serialization/Deserialization: The KeyvBrotli class now manages its own serialization and deserialization logic internally, allowing for more direct control and integration with the native Brotli functions.
  • Type Definition Updates: Type definitions have been updated to reflect the direct use of node:zlib buffers and the removal of the external Brotli interface and DecompressResult type.
Changelog
  • compression/compress-brotli/package.json
    • Removed the compress-brotli dependency.
  • compression/compress-brotli/src/index.ts
    • Imported promisify, brotliCompress, and brotliDecompress from node:zlib.
    • Removed the import of the external compressBrotli package.
    • Refactored the KeyvBrotli constructor to initialize internal properties for enable, compressOptions, decompressOptions, serialize, and deserialize.
    • Rewrote the compress method to use brotliCompressAsync with internal serialization and options.
    • Rewrote the decompress method to use brotliDecompressAsync with internal deserialization and options.
  • compression/compress-brotli/src/types.ts
    • Updated CompressResult type to Promise<Buffer>.
    • Removed DecompressResult type and the Brotli interface.
    • Adjusted the Options interface to reflect the new internal serialize and deserialize function types and removed iltorb.
  • pnpm-lock.yaml
    • Removed entries for compress-brotli, @types/json-buffer, and json-buffer.
Activity
  • The pull request was created by jaredwray.
  • The author marked the PR as fulfilling the contributing and code of conduct guidelines.
  • The author indicated that this PR introduces a feature: moving to native zlib brotli engine.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a great feature enhancement, moving from the compress-brotli package to the native Node.js zlib module for Brotli compression. The implementation is solid, but I've identified a couple of typing issues that should be addressed to improve type safety and correctness. My feedback focuses on correcting these type definitions.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (cf392fb) to head (2497f51).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1841   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           32        32           
  Lines         2434      2446   +12     
  Branches       446       451    +5     
=========================================
+ Hits          2434      2446   +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Jared Wray <[email protected]>
@jaredwray jaredwray merged commit 99cfbd4 into main Feb 12, 2026
10 checks passed
@jaredwray jaredwray deleted the compress-brotli---feat-moving-to-native-zlib-brotli-engine branch February 12, 2026 05:01
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

Successfully merging this pull request may close these issues.

1 participant