Skip to content

Conversation

@comfyui-wiki
Copy link
Member

Summary

This PR synchronizes the Chinese documentation (zh-CN/custom-nodes/js/javascript_examples.mdx) with the changes made in PR #508 (Contextmenu migration).

The Chinese version was still using deprecated monkey-patching patterns while the English version has been updated to use the new recommended extension hooks.

Changes

  • Background menu section: Updated to use getCanvasMenuItems method instead of monkey-patching LGraphCanvas.prototype.getCanvasMenuOptions
  • Node menu section: Updated to use getNodeMenuItems method instead of monkey-patching in beforeRegisterNodeDef()
  • Submenu section: Updated to use declarative submenu property with options array instead of LiteGraph.ContextMenu

Context

These changes align with the best practices introduced in the context menu migration guide (PR #508) and ensure the Chinese documentation stays in sync with the English documentation.

Related

🤖 Generated with Claude Code

mintlify bot and others added 5 commits October 28, 2025 04:27
This PR synchronizes the Chinese documentation with the changes made in PR #508 (Contextmenu migration). The updates replace deprecated monkey-patching patterns with the new recommended extension hooks for context menus.

Changes:
- Updated background menu section to use `getCanvasMenuItems` method instead of monkey-patching `LGraphCanvas.prototype.getCanvasMenuOptions`
- Updated node menu section to use `getNodeMenuItems` method instead of monkey-patching in `beforeRegisterNodeDef()`
- Updated submenu section to use declarative `submenu` property with `options` array instead of `LiteGraph.ContextMenu`

These changes align with the best practices introduced in the context menu migration guide and ensure Chinese documentation stays in sync with English documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@comfyui-wiki comfyui-wiki merged commit fa7b3b9 into main Oct 29, 2025
8 of 9 checks passed
@github-actions github-actions bot deleted the sync-zh-cn-javascript-examples branch October 29, 2025 12:05
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.

Update Chinese version for #508 PR

2 participants