-
Notifications
You must be signed in to change notification settings - Fork 57
added Try Valkey support #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Is this a draft or ready to review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces the "Try Valkey" feature, enabling users to interact with Valkey‑CLI commands via a browser-based virtualized environment powered by v86.
- Implements a new HTML template (valkey-try-me.html) that sets up and configures the virtual machine, including binary caching and emulator lifecycle management.
- Adds a navigation link to the Try Valkey page in the default template.
- Provides a minimal Markdown file to route the Try Valkey page.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
templates/valkey-try-me.html | New template for the in-browser emulator, including caching and VM controls |
templates/default.html | Added navigation link for Try Valkey |
content/try-valkey/index.md | Added frontmatter to set up the Try Valkey page |
const decompressedData = pako.ungzip(new Uint8Array(xhr.response)); | ||
callback(decompressedData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding error handling around pako.ungzip to catch decompression errors and provide a user-friendly error message.
const decompressedData = pako.ungzip(new Uint8Array(xhr.response)); | |
callback(decompressedData); | |
try { | |
const decompressedData = pako.ungzip(new Uint8Array(xhr.response)); | |
callback(decompressedData); | |
} catch (error) { | |
console.error("Decompression error:", error); | |
document.getElementById("progressText").innerText = "Decompression failed. Please try again."; | |
} |
Copilot uses AI. Check for mistakes.
["mousemove", "keydown", "touchstart"].forEach(event => { | ||
window.addEventListener(event, resetInactivityTimer); | ||
}); | ||
|
||
serialAdapter.term.onKey(() => resetInactivityTimer()); // Typing | ||
serialAdapter.term.onData(() => resetInactivityTimer()); // Sending data | ||
serialAdapter.term.onCursorMove(() => resetInactivityTimer()); // Mouse activity | ||
}; | ||
} | ||
|
||
let inactivityTimeout; | ||
const INACTIVITY_LIMIT = 60*1000*10 //inactivity limit is 10 minutes | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider debouncing the calls to resetInactivityTimer to reduce potential performance overhead during rapid key events.
["mousemove", "keydown", "touchstart"].forEach(event => { | |
window.addEventListener(event, resetInactivityTimer); | |
}); | |
serialAdapter.term.onKey(() => resetInactivityTimer()); // Typing | |
serialAdapter.term.onData(() => resetInactivityTimer()); // Sending data | |
serialAdapter.term.onCursorMove(() => resetInactivityTimer()); // Mouse activity | |
}; | |
} | |
let inactivityTimeout; | |
const INACTIVITY_LIMIT = 60*1000*10 //inactivity limit is 10 minutes | |
const debouncedResetInactivityTimer = debounce(resetInactivityTimer, 200); | |
["mousemove", "keydown", "touchstart"].forEach(event => { | |
window.addEventListener(event, debouncedResetInactivityTimer); | |
}); | |
serialAdapter.term.onKey(() => debouncedResetInactivityTimer()); // Typing | |
serialAdapter.term.onData(() => debouncedResetInactivityTimer()); // Sending data | |
serialAdapter.term.onCursorMove(() => debouncedResetInactivityTimer()); // Mouse activity | |
}; | |
} | |
let inactivityTimeout; | |
const INACTIVITY_LIMIT = 60*1000*10 //inactivity limit is 10 minutes | |
function debounce(func, wait) { | |
let timeout; | |
return function(...args) { | |
clearTimeout(timeout); | |
timeout = setTimeout(() => func.apply(this, args), wait); | |
}; | |
} |
Copilot uses AI. Check for mistakes.
const LAST_MODIFIED_KEY = "valkey_last_modified"; | ||
let emulator; | ||
|
||
// Open or create IndexedDB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider adding more detailed comments explaining the structure and purpose of the IndexedDB caching logic to improve maintainability.
// Open or create IndexedDB | |
/** | |
* Opens an IndexedDB database named "binaryCacheDB" or creates it if it doesn't exist. | |
* This database is used to cache the binary data for the emulator, reducing the need | |
* to repeatedly download the binary file. The database contains a single object store | |
* named "cache" with a keyPath of "key". | |
* | |
* @returns {Promise<IDBDatabase>} A promise that resolves to the opened database instance. | |
*/ |
Copilot uses AI. Check for mistakes.
@madolson currently the content is pointing a test bucket with preloaded binaries. I think the PR should be reviewed after @zarkash-aws will change it to point to our production bucket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
over all the PR LGTM
@zarkash-aws Can you please render this PR and attach the screen shots to this PR top comment.
<script src="https://download.valkey.io/try-me-valkey/vos/v86/libv86.js"></script> | ||
<script src="https://download.valkey.io/try-me-valkey/vos/xterm/xterm.min.js"></script> | ||
<script src="https://download.valkey.io/try-me-valkey/vos/pako/pako.min.js"></script> | ||
<script src="https://download.valkey.io/try-me-valkey/vos/v86/serial_xterm.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CDN usage looks good to me
@stockholmux @ranshid Do either of you two want to look it over? I didn't really look into the JS code that closely. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is slick. Really close but we need to resolve some issues when the screen doesn't fit the terminal window.
templates/valkey-try-me.html
Outdated
</div> | ||
<!-- Warning Section --> | ||
<div id="warningContainer" style="text-align: center; margin-top: 20px;"> | ||
<button id="startButton" style="padding: 10px 20px; font-size: 18px; margin-top: 10px;">Load Emulator</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This button doesn't turn the cursor into a pointer, so it's less obvious that it's actually clickable. Add cursor: pointer;" in the
style` attribute.
templates/valkey-try-me.html
Outdated
|
||
{%- endblock -%} | ||
{% block main_content %} | ||
<p>This is an in-browser Valkey server and CLI that runs directly within your browser using a V86 emulator, requiring no external installations. </p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link "V86" emulator to https://github.com/copy/v86
{% block main_content %} | ||
<p>This is an in-browser Valkey server and CLI that runs directly within your browser using a V86 emulator, requiring no external installations. </p> | ||
<p>Try it out below:</p> | ||
<div id="terminalWrapper" class="container" style="display: none;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think we have to find a way to handle this better when the browser is narrow or short as the current implementation breaks. Here is what it looks like when I set Chrome to emulate a phone:
It also happens if you just make your window small.
I certainly don't think we need to have a perfect experience on these devices or screen areas, but it can't be broken.
|
||
<script> | ||
"use strict"; | ||
const FILE_URL = "https://download.valkey.io/try-me-valkey/8.1.0/states/state.bin.gz"; // Path to the .gz file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does this stay up-to-date?
serialAdapter.show(); | ||
|
||
document.getElementById("loadingContainer").style.display = "none"; | ||
document.getElementById("terminalWrapper").style.display = "flex"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is likely the culprit of the wide/narrow issues.
Signed-off-by: Shai Zarka <[email protected]>
Signed-off-by: Shai Zarka <[email protected]>
Signed-off-by: Shai Zarka <[email protected]>
feat(ui): update hero background image <img width="1728" alt="Screenshot 2025-04-22 at 11 42 10 AM" src="https://github.com/user-attachments/assets/533c4864-e136-49b2-8893-168dd996c86d" /> Signed-off-by: Daniel Phillips <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
Signed-off-by: Shai Zarka <[email protected]>
Signed-off-by: Shai Zarka <[email protected]>
Signed-off-by: Shai Zarka <[email protected]>
…alkey-io#249) The documentation tiles on the homepage were stacking awkwardly at screen widths between 768px and 1090px. Modified the grid layout to create a more natural 2x2 layout at these intermediate screen sizes, ensuring consistent spacing and better visual organization. <img width="1023" alt="Screenshot 2025-04-24 at 4 53 59 PM" src="https://github.com/user-attachments/assets/237bce45-1cec-46ad-925a-766d0627fd93" /> <img width="480" alt="Screenshot 2025-04-24 at 4 54 13 PM" src="https://github.com/user-attachments/assets/ee8e564a-44d1-45f4-914b-248787ae9340" /> Signed-off-by: Daniel Phillips <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
Feat: redesign footer with social media icons and links. Add social media icons and links to the footer, including Slack, GitHub, LinkedIn, X (Twitter), and Connect. Improve footer layout and styling. <img width="1727" alt="Screenshot 2025-04-17 at 1 58 53 PM" src="https://github.com/user-attachments/assets/5f311820-ac2e-460c-8ddd-93fe77e7a81d" /> <img width="514" alt="Screenshot 2025-04-17 at 1 59 03 PM" src="https://github.com/user-attachments/assets/5de67d56-9b69-4810-b615-4af75d9487e6" /> --------- Signed-off-by: Daniel Phillips <[email protected]> Co-authored-by: Madelyn Olson <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
…n the Valkey Website (valkey-io#230) ### Description This PR will add the JSON commands on the Valkey website. Note that this PR was created off of a branch of the [bloom filter documentation PR](valkey-io#212). Merge conflicts will occur if that PR needs to be changed so I will update accordingly. Example: <img width="958" alt="Screenshot 2025-04-02 at 5 10 01 PM" src="https://github.com/user-attachments/assets/0e4e7b6f-6a82-4757-a70f-e320dc9cae00" /> ### Check List - [ X] Commits are signed per the DCO using `--signoff` By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License. --------- Signed-off-by: zackcam <[email protected]> Signed-off-by: Nikhil Manglore <[email protected]> Signed-off-by: Nikhil Manglore <[email protected]> Co-authored-by: zackcam <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
### Description <!-- Describe what this change achieves--> ### Issues Resolved <!-- List any issues this PR will resolve. --> <!-- Example: closes #1234 --> ### Check List - [X ] Commits are signed per the DCO using `--signoff` By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License. --------- Signed-off-by: Nikhil Manglore <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
Signed-off-by: zackcam <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
…alkey-io#242) feat: restyle Commands Page with new layout and search functionality - Add left sidebar with command categories and alphabetical list - Implement responsive design with mobile-first approach - Add search functionality with real-time filtering - Style command groups with improved readability - Add no-results message for empty searches <img width="1727" alt="Screenshot 2025-04-18 at 7 43 52 PM" src="https://github.com/user-attachments/assets/e9bdbf91-bef4-4277-b944-d4fc1233a59d" /> <img width="1728" alt="Screenshot 2025-04-18 at 7 43 59 PM" src="https://github.com/user-attachments/assets/00df6c44-0a11-4361-aa6a-b77d81886c71" /> Signed-off-by: Daniel Phillips <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
## Description Restyle Topics Page layout and components - Update left-aside layout with reversed flex direction - Style topic cards with new background and hover states - Add rounded corners to main content area - Implement responsive layout adjustments for mobile/desktop - Update typography and spacing for topic descriptions ### Dependencies - This PR depends on #[242](valkey-io#242) (feat-ui-redesign-commands-page) - The changes in this PR should be reviewed and merged after the base PR is merged <img width="1728" alt="Screenshot 2025-04-24 at 1 20 16 PM" src="https://github.com/user-attachments/assets/31875fcc-5331-41d7-85bf-5ac5523f096b" /> --------- Signed-off-by: Daniel Phillips <[email protected]> Signed-off-by: Madelyn Olson <[email protected]> Co-authored-by: Madelyn Olson <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
### Description Adds blog and author information ### Issues Resolved ### Check List - [x] Commits are signed per the DCO using `--signoff` By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License. --------- Signed-off-by: Nigel Brown <[email protected]> Signed-off-by: Nigel Brown <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
### Description Blog post describing updates to Valkey Modules Rust SDK ### Issues Resolved <!-- List any issues this PR will resolve. --> <!-- Example: closes #1234 --> ### Check List - [ ] Commits are signed per the DCO using `--signoff` By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License. --------- Signed-off-by: Dmitry Polyakovsky <[email protected]> Signed-off-by: Daniel Phillips <[email protected]> Signed-off-by: dmitrypol <[email protected]> Co-authored-by: Madelyn Olson <[email protected]> Co-authored-by: Daniel Phillips <[email protected]> Co-authored-by: Dmitry Polyakovsky <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
) ### Description Currently implicit categories aren't shown on the website. This pr parses the command flags and adds the implicit categories based on this Example images    If more screenshots are needed I can add to display all categories. ### Issues Resolved This will fully finish valkey-io/valkey-doc#272 (comment) ### Check List - [x] Commits are signed per the DCO using `--signoff` By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License. Signed-off-by: zackcam <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
valkey-io#236) ### Description Adding documentation for the new read strategy AzAffinityReplicasAndPrimary relates to issues valkey-io/valkey-glide#2792 and valkey-io/valkey-glide#3085 <!-- Describe what this change achieves--> ### Issues Resolved <!-- List any issues this PR will resolve. --> <!-- Example: closes #1234 --> ### Check List - [x] Commits are signed per the DCO using `--signoff` By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License. --------- Signed-off-by: Muhammad Awawdi <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
…ey-io#262) Performance Optimization Methodology for Valkey - Part 1 --------- ### Description <!-- Describe what this change achieves--> ### Issues Resolved <!-- List any issues this PR will resolve. --> <!-- Example: closes #1234 --> ### Check List - [ ] Commits are signed per the DCO using `--signoff` By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License. --------- Signed-off-by: Lipeng Zhu <[email protected]> Co-authored-by: Wangyang Guo <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
With this PR, I have added support for `valkey-search` website content (topic + commands reference). Related PR (man pages): valkey-io/valkey-doc#275 <img width="1918" alt="Screenshot 2025-05-14 at 19 19 15" src="https://github.com/user-attachments/assets/23d1ee8b-262f-498e-949e-9e30b9b8ccb4" /> <img width="1797" alt="Screenshot 2025-05-14 at 19 18 40" src="https://github.com/user-attachments/assets/36618369-ec1d-441d-bb70-1916c493a491" /> Signed-off-by: Eran Ifrah <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
- Create community page template and content - Update navigation menu to match new design and include Community page link  --------- Signed-off-by: Daniel Phillips <[email protected]> Signed-off-by: Madelyn Olson <[email protected]> Co-authored-by: Madelyn Olson <[email protected]>
### Description Fixes spelling errors and accessibility issues ### Issues Resolved N/A ### Check List - [x] Commits are signed per the DCO using `--signoff` By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License. --------- Signed-off-by: Josh Soref <[email protected]> Signed-off-by: Madelyn Olson <[email protected]> Co-authored-by: Madelyn Olson <[email protected]> Signed-off-by: Shai Zarka <[email protected]>
Signed-off-by: Shai Zarka <[email protected]>
General Description
This PR implements a browser-based environment that allows users to interact with Valkey-CLI commands without needing local installation. This feature was initially introduced in Issue #1412, and it aims to provide a lightweight, easy-to-access platform for users to explore Valkey’s functionalities directly in the browser.
Implementation
The solution uses a virtualized environment powered by v86, a tool that emulates an x86-compatible CPU and hardware. The machine code for the environment is translated into WebAssembly modules at runtime, allowing it to run entirely within the browser.
Serving of Binary Files
The virtual machine used for this setup relies on two main binary file components:
These binaries are served from an S3 bucket (currently set as a test bucket) via CloudFront CDN.
New Image Creation Process
Currently, the creation of new images for future Valkey versions will be done manually. However, we plan to automate this process in the future to simplify updates as new versions of Valkey are released.
I have also created a repository for documentation and for creating new images for Try Valkey.
Screenshots
new "Try Valkey" tab



data warning
after pressing "load emulator"