When I save the animation object as shown above, I don’t have strict types to validate the structure. This makes the code type-unsafe. For instance, if I accidentally miss a required property, the error will only show up at runtime.
Question:
Does Babylon.js provide a built-in type (like an interface or a class) that I can use to type objects like diceRotationAnimation? Or do I need to manually create my own type for this purpose?
I think I read that the Parse format changes over time. Either it was said, or I inferred that it shouldn’t be relied on to be stable from release to release. Does incorporating strict typing change that? What happens when a new element is added to the Parse definition and doesn’t exist in a user’s JSON?
I think the goal would be that the parsing silently defaults the unspecified property. Aside from making sure to not increase the maintenance burden of developers, this seems like a decent (and expansive) change.
But who am I to talk about expansive: I’m working on incorporating most of CSS into the GUI?? Holy smokes, CSS is huge!
If Parse changes and breaks from release to release, then the entire code relying on it will break as well with each new release.
Strict typing helps catch such issues at the compilation stage, providing an early warning system for breaking changes (not in realtime)
Don’t worry, you can also described it in the type definition as optional or deprecated fields, making the behavior explicit and reducing ambiguity for developers.