Entries come back as SystemTransformation — the registered entry plus origin/position. For a
DataTransformerConfig that is harmless, since the extra keys are ignored by transformDataFrame and
by readers.
The custom-operator case is not. A registered CustomTransformOperator (a function) comes back as
{ operator, topic }, which transformDataFrame will not take and which sends any "is this entry a
function or a config" branch — picking a display name, say — down the wrong path.
So every consumer writes the same unwrap. In Grafana it is most of a module, plus a WeakMap keyed on
the object scenes returned, because the unwrapped arrays are React effect deps and rebuilding them per
render would resubscribe every editor row (grafana/grafana#131174).
Asks:
- Return the entries as registered, or expose a companion that does, so the result can go straight to
transformDataFrame. If the tags must travel, { transformation, origin, position } with the
original entry intact would also do it.
- Document the returned object's per-pass identity stability as contract — React consumers have no
other way to keep effect deps stable and are relying on it already.
Entries come back as
SystemTransformation— the registered entry plusorigin/position. For aDataTransformerConfigthat is harmless, since the extra keys are ignored bytransformDataFrameandby readers.
The custom-operator case is not. A registered
CustomTransformOperator(a function) comes back as{ operator, topic }, whichtransformDataFramewill not take and which sends any "is this entry afunction or a config" branch — picking a display name, say — down the wrong path.
So every consumer writes the same unwrap. In Grafana it is most of a module, plus a
WeakMapkeyed onthe object scenes returned, because the unwrapped arrays are React effect deps and rebuilding them per
render would resubscribe every editor row (grafana/grafana#131174).
Asks:
transformDataFrame. If the tags must travel,{ transformation, origin, position }with theoriginal entry intact would also do it.
other way to keep effect deps stable and are relying on it already.