Skip to content

memcache - feat: migrating from memjs to memcache#1846

Merged
jaredwray merged 6 commits intomainfrom
memcache---feat-migrating-from-memjs-to-memcache
Feb 17, 2026
Merged

memcache - feat: migrating from memjs to memcache#1846
jaredwray merged 6 commits intomainfrom
memcache---feat-migrating-from-memjs-to-memcache

Conversation

@jaredwray
Copy link
Owner

@jaredwray jaredwray commented Feb 17, 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, ...)
memcache - feat: migrating from memjs to memcache

@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 introduces a significant upgrade to the @keyv/memcache storage adapter by migrating its underlying client from memjs to the more modern memcache package. This change enhances the adapter with a native Promise-based API, improved TypeScript support, and removes the need for the buffer polyfill. The update also includes necessary adjustments to the API, such as revised options handling and the addition of a disconnect method, ensuring a more robust and streamlined integration with memcache services.

Highlights

  • Memcache Client Migration: The underlying memcache client has been migrated from memjs to the memcache package, providing a fully Promise-based API and built-in TypeScript types.
  • Dependency Updates: The memjs package and its associated @types/memjs have been removed, along with the buffer dependency. The new memcache package has been added.
  • API Changes and disconnect() Method: The KeyvMemcacheOptions type and the client property type have been updated to align with the new memcache client. A new disconnect() method has been introduced for graceful connection closure.
  • Documentation and Examples: The README.md has been significantly updated to reflect the breaking changes from v2 to v6, provide new usage examples, and streamline the setup instructions for Memcached and Google Cloud.
Changelog
  • pnpm-lock.yaml
    • Removed buffer and memjs dependencies.
    • Added memcache dependency.
    • Removed @types/memjs dev dependency.
    • Updated hookified version.
  • pnpm-workspace.yaml
    • Added memcache to the minimumReleaseAgeExclude list.
  • storage/memcache/README.md
    • Updated the project description to reference the new memcache client.
    • Added a Table of Contents for improved navigation.
    • Revised usage examples to reflect the new client's connection string format and added disconnect() calls.
    • Removed sections for Memcachier and Redislabs, focusing on Memcached and Google Cloud.
    • Added a detailed 'Breaking Changes from v2 to v6' section outlining the client change, type changes, disconnect() method, and buffer dependency removal.
  • storage/memcache/package.json
    • Removed buffer and memjs from dependencies.
    • Added memcache to dependencies.
    • Removed @types/memjs from devDependencies.
  • storage/memcache/src/index.ts
    • Removed Buffer import.
    • Replaced memjs import with Memcache and MemcacheOptions from the memcache package.
    • Updated KeyvMemcacheOptions type to extend Partial<MemcacheOptions>.
    • Changed the client property type from memjs.Client to Memcache.
    • Modified the constructor to initialize the new Memcache client, extracting relevant options.
    • Refactored get, set, delete, and clear methods to use the async/await pattern with the memcache client's Promise-based API.
    • Adjusted the set method to correctly pass exptime in seconds.
    • Added an async disconnect() method to gracefully close the client connection.
  • storage/memcache/test/test.ts
    • Removed logger options from error test cases, adapting to the new memcache client's option handling.
    • Added a new test case to verify the functionality of the disconnect() method.
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 successfully migrates the @keyv/memcache package from memjs to the memcache library, which is a great improvement that modernizes the codebase with async/await and removes outdated dependencies. The documentation has also been significantly updated. However, I've identified a critical issue in the constructor's logic that can cause runtime errors under certain instantiation patterns. Additionally, there are a couple of minor issues in the README file that could be improved for clarity and correctness.

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.95%. Comparing base (e35f9de) to head (95e9112).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1846   +/-   ##
=======================================
  Coverage   99.95%   99.95%           
=======================================
  Files          32       32           
  Lines        2432     2436    +4     
  Branches      448      441    -7     
=======================================
+ Hits         2431     2435    +4     
  Misses          1        1           

☔ 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.

@jaredwray jaredwray merged commit 3651aa7 into main Feb 17, 2026
10 checks passed
@jaredwray jaredwray deleted the memcache---feat-migrating-from-memjs-to-memcache branch February 17, 2026 02:49
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