Skip to content

feat(redis): support ioredis v6 - #19

Closed
mattstrayer wants to merge 1 commit into
Julien-R44:mainfrom
mattstrayer:feat/ioredis-v6
Closed

mattstrayer wants to merge 1 commit into
Julien-R44:mainfrom
mattstrayer:feat/ioredis-v6

Conversation

@mattstrayer

Copy link
Copy Markdown

Closes #18

Problem

@verrou/core limits the ioredis peer range to ^5.3.2. ioredis 6.0.0 is now latest. When another dependency needs v6, pnpm installs a private second copy of v5 for verrou. The two copies have different type identities, so passing the app's v6 client to redisStore({ connection }) fails typecheck.

Changes

  1. Widen the peer range to ^5.3.2 || ^6.0.0.
  2. Type the connection option as a structural RedisConnection interface that lists the five commands the driver calls (set, setnx, eval, del, get). It replaces the import of the ioredis Redis class. A v5 client, a v6 client, a Redis<"resp3"> client and a Cluster instance all satisfy it, and the option no longer depends on the class shape.
  3. Add a type test that asserts Redis and Cluster match RedisConnection.
  4. Docs: note that v5 and v6 both work and that v6 needs Node.js 20 or newer.

The devDependency stays at ^5.8.2, so the lockfile is untouched.

Verification

With ioredis 5.8.2 installed:

  • tsc --noEmit: no errors
  • eslint .: no errors
  • pnpm build: passes
  • tests/drivers/redis.spec.ts against Redis 8: 27 tests pass

With ioredis 6.0.0 installed in place of 5.8.2:

  • tsc --noEmit: no errors
  • Same 27 tests pass
  • Redis<'resp3'> is assignable to RedisConnection

Widen the ioredis peer range to `^5.3.2 || ^6.0.0` so package managers
stop installing a private second copy when another dependency needs v6.

Type the `connection` option as a structural `RedisConnection` interface
that lists the five commands the driver calls, instead of the ioredis
`Redis` class. This accepts a v5 client, a v6 client, a `Redis<"resp3">`
client and a `Cluster` instance, and no longer depends on the class shape.

Closes Julien-R44#18
@Julien-R44

Copy link
Copy Markdown
Owner

Oops thanks a lot for the PR! I completely missed it and ended up making the changes myself. sorry about that!

Julien-R44 added a commit that referenced this pull request Oct 20, 2026
Integrate the connection typing from PR #19 while retaining ioredis 5 and 6 support. Cover Redis, RESP3, and Cluster connections with a type regression test and document the supported clients.

Remove the dependency update report as requested.

Refs #19
Amp-Thread-ID: https://ampcode.com/threads/T-01a15682-a305-7422-b2a3-342bda7ed125
@Julien-R44 Julien-R44 closed this Oct 20, 2026
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.

Redis driver: support ioredis v6

2 participants