Skip to content

feat: add Valkey GLIDE adapter#11

Merged
lan17 merged 2 commits into
mainfrom
codex/valkey-glide
Jul 13, 2026
Merged

feat: add Valkey GLIDE adapter#11
lan17 merged 2 commits into
mainfrom
codex/valkey-glide

Conversation

@lan17

@lan17 lan17 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Add first-party Valkey GLIDE support without coupling DialCache core to a particular Redis client.

The new dialcache/valkey-glide subpath wraps an already-created standalone or cluster GLIDE client. DialCache continues to depend only on the semantic DialCacheRedisClient boundary and preserves the existing version-1 Redis wire frame.

Design

Client ownership

Applications remain responsible for creating, configuring, connecting, and closing their GLIDE client. The adapter owns only its five native GLIDE Script handles and exposes an idempotent dispose() method to release them after outstanding cache operations complete.

Disposal rejects while script invocations are in flight, preventing GLIDE's local script source from being released during automatic NOSCRIPT recovery.

Script execution and payloads

The adapter:

  • invokes the existing tracked and untracked Lua sources through GLIDE's native Script API;
  • declares script keys for cluster routing;
  • requests Decoder.Bytes replies so arbitrary serializer output remains lossless;
  • passes Buffer payloads directly without base64 conversion;
  • validates read and integer replies at the client boundary; and
  • requests all-primary routing for cluster flushAll().

The payload encoding selector and response-frame decoder live in a small internal helper shared by node-redis and GLIDE. Client-specific invocation and lifecycle behavior remain in their respective adapters.

Package surface

  • Add dialcache/valkey-glide ESM, CJS, and declaration exports.
  • Add @valkey/valkey-glide@^2.4.2 as an optional peer dependency.
  • Keep core DialCache usable without installing GLIDE.
  • Document installation, construction, ownership, and shutdown behavior.
  • Retain the mainline Node 20 || >=22 support contract.

Test architecture

Adapter conformance runs node-redis and Valkey GLIDE against one Redis 6.2 standalone server. This validates DialCache's adapter boundary at the oldest server version supported by GLIDE without duplicating GLIDE's upstream Redis/Valkey compatibility matrix.

The shared suite covers UTF-8, arbitrary binary and tracked payloads, invalidation, malformed frames, automatic script-cache recovery, full DialCache serializer use, flush behavior, and node-redis/GLIDE cross-client wire compatibility.

Unit tests validate GLIDE-specific argument construction, byte decoding, reply validation, explicit all-primary cluster flush routing, script disposal, and in-flight disposal protection. The repository's node-redis Redis/Valkey protocol matrix and Redis Cluster integration suite remain covered.

Rebase integration

The branch is rebased onto main commit 24ca4eeb3da3450c118b88af868ffd1938f6f4eb, which added the bounded local LRU and raised the Node support floor. The README conflict was resolved by retaining both the global local-cache documentation and the GLIDE adapter behavior.

Validation

  • pnpm check — typecheck, 106 unit tests with coverage thresholds, build, and packaged ESM/CJS/TypeScript consumers
  • pnpm test:integration — 48 Docker-backed integration tests
  • packaged consumer verified on Node 20.11.0 and Node 22.22.0
  • pnpm audit --prod — no known vulnerabilities
  • git diff --check

@lan17 lan17 force-pushed the codex/valkey-glide branch from f837bfe to 9c6f4fd Compare July 13, 2026 04:08
@lan17 lan17 marked this pull request as ready for review July 13, 2026 04:21
@lan17 lan17 merged commit 973ac05 into main Jul 13, 2026
4 checks passed
@lan17 lan17 deleted the codex/valkey-glide branch July 13, 2026 04:21
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