Skip to content

Narrow CreateNodeOptions to explicit Pick of creation-time properties #9276

@coderabbitai

Description

@coderabbitai

Context

PR #9262 introduced CreateNodeOptions to replace the untyped Dictionary<unknown> parameter in createNode. The current implementation uses Partial<Omit<LGraphNode, 'constructor' | 'inputs' | 'outputs'>> as the base, which exposes the entire LGraphNode surface (hundreds of properties and methods like computeSize, onNodeCreated, connect, etc.) as valid creation-time options.

Proposed Refinement

Narrow CreateNodeOptions to a Pick of properties that actually make sense as creation-time options (e.g., pos, properties, flags, size, mode, title, color, bgcolor).

Key Considerations

This is a deliberate API boundary decision that requires:

  1. Ecosystem audit: Catalog which properties callers actually pass today. Initial scan of ~50 custom node repos shows almost all pass only pos, with one internal caller passing outputs.

  2. Unsupported properties: Decide what happens when someone needs a property not in the Pick set. Do they cast? Do you add it? This creates an ongoing maintenance surface.

  3. Migration path: Consider deprecation/migration path if any external TypeScript consumers were relying on the current permissiveness.

References

This refinement deserves its own focused PR with explicit sign-off on the allowed property set.

┆Issue is synchronized with this Notion page by Unito

Metadata

Metadata

Labels

Public APIAffects or interacts with the public API surface (affecting custom node or extension authors)area:nodesenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions