Component APIs and how to enforce them
Since Fusion components are increasingly provided with their own API, it’s time to have a look at that in detail. The props array is both flexible for changes and flawed regarding stability and testability. I’ll discuss two current alternative approaches as well as a new idea for type-safe Fusion.
Arrays don’t make for good API specifications, especially when literally anyone can override those specifications in the way that we know from Fusion prototypes and their props arrays. Typos can cascade through the component hierarchies undetected, leading to broken leaf components while EEL silently catches all errors giving real challenges for integrators when debugging the code.
PropTypes are one approach to enforce component APIs to a certain extent, while PresentationObjects take an even stricter stance virtually eliminating integration errors for good using PHP capabilities. Both methods have their ups and downs which will be discussed, leading to the topic of a completely new concept in the world of Fusion Rendering and what it could look like.
- Neos Conference 2022
- Studio Stage