retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
10.17k stars 653 forks source link

Node meta not exported with toJSON #616

Closed joshuakarp closed 1 year ago

joshuakarp commented 1 year ago

I'm trying to persist some data in Node.meta, export the editor toJSON, and then have the ability to reconstruct with fromJSON (including each node's data in both data and meta) . I'm currently using Node.data as a separate collection of data, and this works well. However, it doesn't seem that meta is persisted in the same way and a peek into the source confirms this: https://github.com/retejs/rete/blob/dd11a09783bbe038377eb1c3cb42774f7f9b264a/src/node.ts#L106-L113

Is the only way to persist data with Node.data?

joshuakarp commented 1 year ago

I no longer require this - I'm using a workaround that doesn't require the meta to be persisted now.

Ni55aN commented 1 year ago

The meta property was intended for runtime-only data, but this concept is no longer used in v2