thema icon indicating copy to clipboard operation
thema copied to clipboard

Eliminate use of Eval() in encoding/cue and any internal helpers

Open sdboyer opened this issue 1 year ago • 0 comments

In the formatters introduced in e.g. in #56 and #59, there are a number of calls to cue.Value.Eval(). IIRC, i used these originally as a quick hack to eliminate printed references to the lineage's joinSchema.

I knew it was suboptimal at the time and left in a bunch of TODOs to remove, but the immediate impacts of doing it did not occur to me. Now that i've tried it against Grafana's dashboard lineage, though, i realized that the eval call definitely eliminates field/list comprehensions. That changes the semantics of the dashboard, which needs those for its (current approach to) composition.

While that hacky composition approach is almost certain to change with #8 - like, that comprehension should probably not be in the body of the schema - it just emphasized to me just how important it is to preserve the original, textual input from the user for these cases.

sdboyer avatar Jul 22 '22 10:07 sdboyer