Repository navigation
DOC-7267 Rebuild the ioredis entries from the declared overloads - #4496
Conversation
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>
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at 2166b40 |
dwdougherty
left a comment
There was a problem hiding this comment.
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! |
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>
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.tsby something that ran text together. Each entry is now matched to the overload it came from and rebuilt from that declaration:bitcount(, key: RedisKey, ...)). 175 are regenerated verbatim from the declaration. Text that already matched stays byte for byte.paramsarrays were often one garbled item (...argstyped[key). 264 are rebuilt with one item per tuple element, asHIMPORT PREPAREalready does. Existing descriptions are kept.Anyon 416 of 429 entries. Every return is now the declaredResult<T, Context>. No non-Anyreturn changed.The merged
data/command-api-mapping.jsonis 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
^5.4.0, and 430 of the 458 existing pieces match a 5.11.1 overload exactly, against 333 for 6.0.0. The sixhimportentries are the exception:himportonly exists in 6.0.0, where they were authored, and they were already correct, so they are untouched.PFCOUNT,PFMERGE, where the old text had a rest parameter beforecallback, which isn't valid TypeScript) are matched by parameter names and rest-ness.tsc --strictcompile oftypeof redis.<name>succeeds on the 5.11.1Redistype for 153 of the 154 distinct method names. The exception ishimport.HEXPIREnow lists ten entries andHPEXPIREten. 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
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.bitopandgeoaddoption 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-mappingJSON 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
paramsnow enumerate each positional/rest argument instead of a single...argsblob. Returns that were previously labeledAnynow expose the declaredResult<T, Context>shapes, and follow-on tweaks (e.g.,mget/msetmap vs tuple variants,HEXPIREoption breakdowns) align with current typings.data/command-api-mapping.jsonis 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.