By making this change we get the best of both worlds in terms of the FFI behaviour:
If a theme is unused it will be erased during DCE
There should be no chance of DCE or webpack or whatever erasing the used themes, since they're part of a value that is now used.
Having the closed sum type of built in themes didn't really seem to have much advantage, as in theory that sum should be open as people could register their own themes for echarts via the FFI, so now all they have to do is construct one of these BuiltInTheme records.
By making this change we get the best of both worlds in terms of the FFI behaviour:
Having the closed sum type of built in themes didn't really seem to have much advantage, as in theory that sum should be open as people could register their own themes for echarts via the FFI, so now all they have to do is construct one of these
BuiltInTheme
records.