adding-deprecation-warnings

Adds backward-compatible deprecation warnings for renamed or removed TypeScript properties.

2.0k|679|Updated Jun 13, 2024
One-click install
npx skills add https://github.com/Comfy-Org/ComfyUI_frontend --skill adding-deprecation-warnings
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adding-deprecation-warnings
Source: https://github.com/Comfy-Org/ComfyUI_frontend/tree/main/.claude/skills/adding-deprecation-warnings
Command: npx skills add https://github.com/Comfy-Org/ComfyUI_frontend --skill adding-deprecation-warnings

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Renaming or removing properties in a frontend codebase breaks third-party custom nodes that still reference the old names. This Skill guides you through adding backward-compatible deprecation warnings so legacy usage keeps working while developers are nudged toward the new API.

Core Features & Use Cases

  • Ecosystem Impact Search: Searches the ComfyUI custom node ecosystem for all usage patterns of the deprecated property before making changes.
  • Deprecation Helper Application: Applies the defineDeprecatedProperty helper from src/lib/litegraph/src/utils/feedback.ts to create getter/setter aliases with deduplicated warnings.
  • JSDoc and PR Documentation: Adds @deprecated JSDoc tags for IDE support and generates a PR comment summarizing ecosystem compatibility.
  • Use Case: You renamed widget.oldProp to widget.newProp in ComfyUI_frontend. Use this Skill to verify ecosystem usage, add the deprecation alias, and confirm truthiness checks, caching, and serialization all still work.

Quick Start

Add a deprecation warning for the renamed property oldProp on widget objects and verify ecosystem compatibility.

Frequently Asked Questions about adding-deprecation-warnings

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deprecate a renamed property in TypeScript without breaking existing code?

Use the defineDeprecatedProperty helper from src/lib/litegraph/src/utils/feedback.ts. It creates an Object.defineProperty getter/setter alias on the target object that forwards reads and writes to the new property while logging a deduplicated deprecation warning.

How do I check if custom nodes use a property before deprecating it?

Search the ComfyUI custom node ecosystem with the comfy_codesearch tool for both the qualified name like widget.oldProp and the bare property name. Document all access patterns such as truthiness checks, local caching, and style mutation to confirm they remain compatible.

Does defineDeprecatedProperty affect JSON serialization of objects?

No, the alias is created with enumerable set to false, so it is excluded from Object.keys, for...in loops, and JSON.stringify output. It is also configurable, allowing later redefinition if needed.

Why does the deprecation warning only appear once per session?

The warnDeprecated function deduplicates messages using a Set, so each unique warning message is logged only once per session. This prevents console spam even when the deprecated property is accessed heavily inside loops.

When should I use a deprecation alias instead of removing a property outright?

Use a deprecation alias when third-party custom nodes still reference the old property name and backward compatibility must be preserved during a grace period. Direct removal is only safe when ecosystem searches confirm zero remaining usage.