feat: decouple GLIDE adapter runtime#81
Merged
Merged
Conversation
Require callers to pass their GLIDE module namespace so Script handles and Decoder.Bytes come from the same runtime as the client. The required second argument intentionally advances the pre-1.0 API through the repository's minor-release path.
lan17
marked this pull request as ready for review
July 23, 2026 05:44
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
Make the Valkey GLIDE adapter depend on the caller's GLIDE runtime capabilities instead of importing a particular installed
@valkey/valkey-glideruntime.Callers now pass the same module namespace that created their standalone or cluster client:
Why
GLIDE
Scriptobjects are native lifecycle handles. In source-linked workspaces or other dependency layouts, the application and DialCache can resolve different physical GLIDE module instances even when the optional peer range is broad. Constructing scripts through DialCache's module copy can therefore register them outside the runtime used by the caller's client.The intended ownership flow is now explicit:
Design
invokeScript, the releasable script handle, and the minimal runtime namespace.DialCacheRedisClientboundary and Redis/Lua protocol unchanged.This is capability compatibility, not a promise that every historical or future GLIDE release has identical semantics. Applications remain responsible for passing the module namespace associated with their client.
Migration and release
createValkeyGlideDialCacheClientnow requires the GLIDE runtime namespace as its second argument. This intentionally advances the pre-1.0 API through the repository'sfeat -> minorrelease rule, so the next planned version is0.8.0rather than1.0.0.The README installation example no longer pins an application GLIDE version and its timeout references now use the official version-neutral Node API documentation.
Test coverage
Decoder.Bytescome only from the supplied runtime while retaining script disposal and protocol validation coverage.2.2.10alongside a distinct aliased GLIDE2.4.2module and assert native constructor/decoder identity.GlideClientandGlideClusterClienttypes against the structural adapter API.SCRIPT FLUSHrecovery explicitly invokes all five production scripts through each client, including tracked read/write and invalidation.Validation
pnpm checkon Node 22.22.0pnpm test:packageon Node 20.17.0git diff --checkThe live Redis/Valkey integration suite was not run locally because it performs database writes; GitHub Actions runs the complete suite against ephemeral containers.