Closed ffMathy closed 11 months ago
@gismya if you want a clean diff of this before the other one is merged, I made a draft PR here: https://github.com/ffMathy/ftrack-ts-schema-generator/pull/1/files
I forgot to mention that this fixes #16.
Conflicts resolved!
A fork of #23, so that should probably be merged first. Please don't look at this before that has been merged, as that gives a bad impression diff-wise.
This feature adds strong-typing of attributes, their labels and names, but also allows runtime introspection of such attributes. This can be helpful for adding validation (making sure a particular field is actually a valid custom attribute name) etc. The opportunities are huge for this.
The actual runtime information is behind an emitted function (
getAttributeConfigurations
) on purpose. This is because it is then tree-shakeable, so it doesn't become part of the compiled bundle of most web apps today, if not used. If you do not like this, I can make a version that only has the types. However, we have several use-cases where we'd love to have the information readily available at runtime as well.CC @gismya.
Changes
Test