Comfy-Org / Comfy-Org/ComfyUI_frontend

[DevTask] Update serialisation methods

Open
#4,724 0 comments 0 reactions 0 assignees View on GitHub
area:litegraph developer experience perf:memory perf:speed
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

### Current

- `serialize` methods in Litegraph do not perform serialisation; they return an object that may be serialised
- In many cases, properties are simply copied to a new object, retaining collection refs
- In newer usage, many objects are shallow-cloned
- The intent is that the results from these functions are used exclusively for actions such as serialisation by the caller
- This is an ongoing cause of bugs due to (understandable) confusion around what these functions actually do

### Possible solutions

1. Shallow clone everything
- Performance impact on larger graphs
1. Actually serialise
- Strings cannot be easily modified downstream before writing to file
1. ...

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-4724-DevTask-Update-serialisation-methods-2476d73d365081cdab8ffa217dc1dc4c) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.