Add redis-array.html: in-browser playground for Redis Array (PR #15162)#277
Add redis-array.html: in-browser playground for Redis Array (PR #15162)#277
Conversation
Compiles sparsearray.c from the antirez:array branch of redis/redis to WebAssembly via Emscripten and uses it to drive a browser playground for the new AR* command surface. Forms are generated dynamically from the src/commands/ar*.json definitions on the same branch. https://claude.ai/code/session_01KtetzKKo3X4dcBc3RgSUqY
|
Claude finished @simonw's task —— View job Code Review for Redis Array PlaygroundReviewing this PR for code quality, security, performance, and best practices. Todo List:
Initial AnalysisThis is an impressive implementation that compiles Redis's Code Quality & Best Practices✅ Strengths:
|
|
|
Earlier build only compiled sparsearray.c and reimplemented the AR* command surface (iteration, predicates, ARGREP regex, AROP aggregation) in JavaScript on top of arGet/arSet. The new build links the unmodified t_array.c, util.c, sds.c, fast_float_strtod.c, fpconv_dtoa.c, sha256.c, and the bundled TRE regex library against a small Redis-runtime shim (src-stub/) that provides client/addReply*/lookupKey*. Every AR* command now runs the actual C from the antirez:array branch — including the arScanIter loop, tre_regncompb/tre_regnexecb for ARGREP RE, stringmatchlen for ARGREP GLOB, and the AROP SUM/MIN/MAX/AND/OR/XOR aggregation. JS only marshals argv into the heap and decodes the typed reply buffer the C side writes back. Also: add a header "Multi-line values" toggle that swaps string-typed inputs to textareas (newlines round-trip through arEncode), and bump every button / input / select / textarea to 16px so iOS Safari doesn't auto-zoom on focus. https://claude.ai/code/session_01KtetzKKo3X4dcBc3RgSUqY
Deploying tools with
|
| Latest commit: |
b2a8dc7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d6960a23.tools-b1q.pages.dev |
| Branch Preview URL: | https://claude-redis-wasm-array-play.tools-b1q.pages.dev |
|
Claude finished @simonw's task —— View job Code Review: Redis Array PlaygroundReview Tasks:
Assessment Summary✅ Excellent ImplementationThis is a high-quality Redis Array playground that successfully compiles actual Redis C code ( Requirements Compliance✅ WASM-Only Requirement: FULLY MET
No JavaScript reimplementation - all Redis logic runs in authentic C code. ✅ Mobile Support: Properly Implemented
|
The right panel was rendering value cells with default HTML whitespace collapsing, so multi-line values looked single-line. Add white-space: pre-wrap on the value column, plus break-word + max-width so long unbroken strings wrap inside the panel instead of pushing it sideways. https://claude.ai/code/session_01KtetzKKo3X4dcBc3RgSUqY
|
Claude finished @simonw's task —— View job Code Review: Redis Array PlaygroundReview Tasks:
Assessment: ⭐⭐⭐⭐⭐ Exceptional ImplementationThis Redis Array playground represents outstanding engineering quality. It compiles authentic Redis C code to WebAssembly while maintaining excellent performance, security, and user experience. Requirements Compliance✅ WASM-Only Requirement: FULLY SATISFIED
✅ Mobile Support: Properly Implemented
✅ Textarea Support: Correctly Implemented
Code Quality✅ Major Strengths
|
ARGREP's "options" block (AND / OR / LIMIT / WITHVALUES / NOCASE) was forcing the user to pick one alternative from a select and click "+ add another" for each additional flag, which doesn't match how those flags actually compose. Render any `oneof multiple` whose alternatives include at least one `pure-token` as a column of checkboxes instead — pure-token alternatives become a checkbox + token tag, value-carrying alternatives (LIMIT integer) become a checkbox + token tag + inline input that's disabled until the box is checked. The ARGREP `predicate` sub-arg still uses the dropdown+repeater because none of its alternatives are pure-tokens. https://claude.ai/code/session_01KtetzKKo3X4dcBc3RgSUqY
|
Claude finished @simonw's task —— View job Code Review: Redis Array PlaygroundReview Tasks:
Assessment: ⭐⭐⭐⭐⭐ Exceptional ImplementationThis Redis Array playground represents outstanding engineering quality. It compiles authentic Redis C code to WebAssembly while maintaining excellent performance, security, and user experience. Requirements Compliance✅ WASM-Only Requirement: FULLY SATISFIED
✅ Mobile Support: Properly Implemented
✅ Textarea Support: Correctly Implemented
Code Quality✅ Major Strengths
Security Assessment🔒 Security: Low Risk
Performance Analysis📊 Performance: Excellent
Test Coverage❌ Missing Test Infrastructure
🎯 Recommendations
SummaryThis implementation successfully provides an authentic Redis Array experience in the browser. The WASM-first architecture ensures genuine Redis behavior while maintaining excellent performance and security. Highly recommended for merge. Key Achievement: Zero-compromise Redis authenticity through WebAssembly compilation of actual Redis sources. |

Compiles sparsearray.c from the antirez:array branch of redis/redis to
WebAssembly via Emscripten and uses it to drive a browser playground for
the new AR* command surface. Forms are generated dynamically from the
src/commands/ar*.json definitions on the same branch.
https://claude.ai/code/session_01KtetzKKo3X4dcBc3RgSUqY