which would essentially be a more general way to resolve https://github.com/plotly/plotly.js/pull/1736
I'm thinking this strict/debug mode would be set as a config argument. We could either log the attribute errors (as Plotly.validate currently does) or throw an error.
Random question: does a bundle with stripped metadata affect at all what or how it's able to report errors? (Otherwise I like the idea of this as a config argument and of reporting as much/helpful information as we can.)
does a bundle with stripped metadata affect at all what or how it's able to report errors
In its current implementation, Plotly.validate doesn't log the attribute descriptions, so no, it wouldn't matter.
cc @phxnsharp if you weren't aware of this.
This sounds like exactly what we would prefer. Is there a sense of what type of performance hit this would involve?
Is there a sense of what type of performance hit this would involve?
At the moment, Plotly.validate is fairly fast. It clocks in at no worse than 50ms. Plotly.validate's execution time, in its current state, _scales_ with the number of "data" and "layout" attributes set.
That said, if we choose to implement https://github.com/plotly/plotly.js/issues/1998, Plotly.validate will likely slow down a little bit. It we only check for data arrays lengths, the performance hit will be small. But if we choose to check for invalid data items (e.g. null in scatter marker traces), this will make Plotly.validate's execution time _scale_ with the length of the data array - which will slow it down considerably for graphs with many data points.
cross-referencing https://github.com/plotly/plotly.js/issues/167