Skip to content

DOC-7267 Rebuild the ioredis entries from the declared overloads - #4496

Merged
andy-stark-redis merged 1 commit into
mainfrom
DOC-7267-ioredis
Nov 6, 2026
Merged

andy-stark-redis merged 1 commit into
mainfrom
DOC-7267-ioredis

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

DOC-7267 ioredis follow-up (the ticket listed the other clients; this one turned out to be a different defect from redis_py).

The ioredis data was scraped from RedisCommander.d.ts by something that ran text together. Each entry is now matched to the overload it came from and rebuilt from that declaration:

  • Signatures had stray commas and empty leading parameters (bitcount(, key: RedisKey, ...)). 175 are regenerated verbatim from the declaration. Text that already matched stays byte for byte.
  • params arrays were often one garbled item (...args typed [key). 264 are rebuilt with one item per tuple element, as HIMPORT PREPARE already does. Existing descriptions are kept.
  • Returns were Any on 416 of 429 entries. Every return is now the declared Result<T, Context>. No non-Any return changed.
  • 16 entries glued several declarations together: one command's overload, a JSDoc comment, then other commands' overloads, in one string. Collapsed entries are split into their real overloads, so the file goes from 429 to 458 entries. The 16 pieces that belonged to other commands are dropped.

The merged data/command-api-mapping.json is regenerated and equals the per-command data. Its only semantic changes are the 154 ioredis lists. No other client changed. ioredis isn't in the API Methods tab's client list, so nothing renders differently.

How to review

  • Reference version is ioredis 5.11.1, the latest 5.x. The harness pins ^5.4.0, and 430 of the 458 existing pieces match a 5.11.1 overload exactly, against 333 for 6.0.0. The six himport entries are the exception: himport only exists in 6.0.0, where they were authored, and they were already correct, so they are untouched.
  • Every piece matches a declared overload by name and normalized parameters (quote style and redundant parentheses ignored). Two ambiguous ones (PFCOUNT, PFMERGE, where the old text had a rest parameter before callback, which isn't valid TypeScript) are matched by parameter names and rest-ness.
  • A tsc --strict compile of typeof redis.<name> succeeds on the 5.11.1 Redis type for 153 of the 154 distinct method names. The exception is himport.
  • HEXPIRE now lists ten entries and HPEXPIRE ten. Those were each already one entry that contained 8 or 9 real overloads (the NX, XX, GT and LT variants), so splitting preserves information. Whether a command should list that many is a separate question.

Not fixed

  • Overload selection. The data lists a subset of each command's declared overloads (429 entries against 2,891 declared). I kept that selection and didn't try to define a better one.
  • The 16 dropped pieces (hget, hmget, hrandfield, lmove, migrate, script, sdiffstore, sintercard, subscribe, sunionstore, xpending, zcount, incr, incrby, decr, decrby) were not added to those commands' own lists. They were stray fragments, not a reviewed selection.
  • ioredis 6.x differs from 5.x on about 100 overload signatures (bitop and geoadd option names, for one). When the docs move to 6.x, rerun the match.

🤖 Generated with Claude Code


Note

Low Risk
These edits are documentation metadata only; there is no runtime or client-facing behavior change beyond regenerated JSON.

Overview
Refreshes the data/command-api-mapping JSON shards so ioredis entries mirror the actual TypeScript overloads instead of scraped noise.

Signatures drop stray commas/comments and split merged command strings into distinct overloads, while params now enumerate each positional/rest argument instead of a single ...args blob. Returns that were previously labeled Any now expose the declared Result<T, Context> shapes, and follow-on tweaks (e.g., mget/mset map vs tuple variants, HEXPIRE option breakdowns) align with current typings. data/command-api-mapping.json is regenerated from the per-command files so only the ioredis sections change; other clients remain untouched.

Reviewed by Cursor Bugbot for commit 2166b40. Bugbot is set up for automated code reviews on this repo. Configure here.

The ioredis data was scraped from RedisCommander.d.ts by something that ran text together:
signatures with stray commas and empty leading parameters, params arrays reduced to a single
garbled ...args item, 16 entries that glued one command's overload, a JSDoc comment and other
commands' overloads into one string, and an Any return on 416 of 429 entries. Each entry is now
matched to the overload it came from and rebuilt from that declaration.

The reference is ioredis 5.11.1, the latest 5.x. The harness pins ^5.4.0, and 430 of the 458
existing pieces match a 5.11.1 overload exactly against 333 for 6.0.0, so the data is 5.x. The
six himport entries are the exception: himport only exists in 6.0.0, where they were authored,
and they were already correct.

154 command lists change. 175 signatures are regenerated verbatim from the declaration, 264 params
arrays are rebuilt (one item per tuple element, as in HIMPORT PREPARE), and every return becomes
the declared Result<T, Context>. Existing text that already matched stays byte for byte, apart
from the return. Collapsed entries split into their real overloads, so the file grows from 429
to 458 entries, and 16 pieces that belonged to other commands (hget inside HEXPIRE, lmove inside
LLEN, migrate inside MGET and so on) are dropped. The 154 distinct method names all exist on
the 5.11.1 Redis type (checked with tsc), except himport.

Learned: the scraper concatenated declarations, so a collapsed entry can hold another command's overloads, match pieces to declarations before trusting an entry
Constraint: the reference is ioredis 5.x, 6.0.0 differs on about 100 overload signatures (bitop and geoadd option names, for one)
Directive: keep the existing per-command overload selection, do not import all 2,891 declared overloads
Gaps: which overloads each command should list was not reviewed, HEXPIRE now lists ten
Gaps: the pieces dropped from other commands were not added to those commands' own lists
Recheck: when the docs move to ioredis 6.x, rerun the match against its declarations
Ticket: DOC-7267
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7267

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history (5 new this commit):

Memory updated at 2166b40

@andy-stark-redis
andy-stark-redis requested a review from a team November 6, 2026 11:21
@andy-stark-redis andy-stark-redis self-assigned this Nov 6, 2026
@andy-stark-redis andy-stark-redis added the clients Client library docs label Nov 6, 2026

@dwdougherty dwdougherty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not seeing ioredis entries in the pulldown menu, but maybe I'm looking for the wrong thing. That said, I'll go ahead an approve to speed you along.

@andy-stark-redis
andy-stark-redis merged commit 7a84960 into main Nov 6, 2026
109 checks passed
@andy-stark-redis
andy-stark-redis deleted the DOC-7267-ioredis branch November 6, 2026 14:42
@andy-stark-redis

Copy link
Copy Markdown
Contributor Author

I'm not seeing ioredis entries in the pulldown menu, but maybe I'm looking for the wrong thing. That said, I'll go ahead an approve to speed you along.

@dwdougherty Yes, Claude seems to have figured that getting the data in place first merited a separate PR, which does make this one seem a bit odd. You should see ioredis appear soon :-) Anyway, thanks for the review!

andy-stark-redis added a commit that referenced this pull request Nov 6, 2026
The ioredis entries rebuilt in #4496 and the redis_rb entries were never shown: the API Methods
tab builds its dropdown from a fixed client order in api-methods-tab.html, and that list named
every client with a mappingClientId except these two. ioredis now sits after Node.js and Ruby
after PHP, in both the dropdown order and the localStorage tab-sync order. Both also get
genericCall="call", which ioredis declares in RedisCommander.d.ts (5.11.1) and redis-rb v6.0.0
documents as Redis::Commands#call, so a command listed generic_only in the status file would
say how to send it.

Coverage is thin. ioredis has a list for 159 of 527 commands (62 empty, 306 with no key) and
Ruby for 217 (310 with no key), against about 470 for redis-py, Jedis and go-redis. The rest
show the default "No method signature available for this client." No status entries were added,
because most of the gap is typed methods that were never mapped (EVAL and HGET for ioredis),
not commands the client cannot call. RedisVL stays out of the dropdown on purpose, because it is
handled differently from the other clients.

Learned: a client with a mappingClientId in config.toml still does not appear in the tab unless it is in both clientOrder lists in api-methods-tab.html
Directive: add a client to the tab in both $clientOrder and $jsClientOrder, and give it a genericCall
Directive: do not add RedisVL to the API Methods tab client order, the docs team decided it is handled differently
Gaps: most commands have no ioredis or Ruby entry, so the new options show the default message for them
Gaps: built with content/develop/clients ignored, checked SET, EVAL and ACL in the output
Ticket: DOC-7267
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients Client library docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants