Comfy-Org / Comfy-Org/ComfyUI_frontend
Extract graph lifecycle coordination into systems without expanding class APIs
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
Graph lifecycle coordination still lives in `LGraph` and `LGraphNode`, including graph-ID rekey coordination, owned-graph teardown, and store-backed property synchronization. Extract cohesive systems without widening the extension-facing class API.
Current evidence: `LGraph.ts` imports the existing `rekeyGraphId` helper and coordinates it from the ID setter; `teardownOwnedGraphs` is already a file-level helper. Preserve those extractions rather than claiming all logic remains in new public methods. `LGraphNode` still synchronizes store state through its property setters.
Files: [LGraph.ts](https://github.com/Comfy-Org/ComfyUI_frontend/blob/686a91971eccaec062b39830764b04e5d0aa8a03/src/lib/litegraph/src/LGraph.ts), [LGraphNode.ts](https://github.com/Comfy-Org/ComfyUI_frontend/blob/686a91971eccaec062b39830764b04e5d0aa8a03/src/lib/litegraph/src/LGraphNode.ts).
Follow `AGENTS.md`'s no-god-object-growth constraint and ADR 0003/0008's incremental systems/store architecture. ADR 0008 is proposed/partially implemented; this is a migration follow-up, not a claim that the entire target architecture already exists.
Acceptance:
- Move cohesive rekeying, teardown, and synchronization behavior into systems/stores/composables with plain-data boundaries.
- Retain thin compatibility delegates where extension contracts require them.
- No net-new public methods on LGraph, LGraphNode, or LGraphCanvas in the remediation diff.
- Verify extracted systems are used, with Fallow/knip and focused lifecycle tests; preserve extension behavior.
Upstream transfer for FE-2112. Implementation belongs upstream.
Contributor guide
Research direction
Read AGENTS.md, ADR 0003/0008, LGraph.ts, and LGraphNode.ts first, including the existing rekeyGraphId and teardownOwnedGraphs helpers. Trace the ID setter and property-setter store synchronization, then inspect the focused lifecycle tests and run Fallow/knip. Done means cohesive behavior uses systems or stores with plain-data boundaries, compatibility delegates remain where required, no new public methods are added, and extension behavior is preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100