Investigate how we need to change the types of createAll arguments and return value to allow it to handle:
initialising components that did not come from GOV.UK Frontend
initialising multiple components in a single call
If necessary, it would be faire to add extra static properties on components (like a lower-case name of the component to pick from an object storing multiple component configuration in a similar shape that the one initAll receives).
If typing becomes too complex, we can also consider having two functions, one for initialising a single type of component and another for a list of components.
Why
As we're looking to make createAll initialise components that do not belong to GOV.UK Frontend and possibly multiple components, we need to figure out how to describe the type of arguments it receives and its return value so our type checking remains accurate.
Who needs to work on this
Developers
Who needs to review this
Developers
Done when
[ ] We've assessed the impact of allowing createAll to receive components not from GOV.UK Frontend
[ ] We've assessed the impact of allowing createAll to initialising multiple components in a single call
[ ] We've recorded the solutions we have to work around both
What
Investigate how we need to change the types of
createAll
arguments and return value to allow it to handle:If necessary, it would be faire to add extra static properties on components (like a lower-case name of the component to pick from an object storing multiple component configuration in a similar shape that the one
initAll
receives).If typing becomes too complex, we can also consider having two functions, one for initialising a single type of component and another for a list of components.
Why
As we're looking to make
createAll
initialise components that do not belong to GOV.UK Frontend and possibly multiple components, we need to figure out how to describe the type of arguments it receives and its return value so our type checking remains accurate.Who needs to work on this
Developers
Who needs to review this
Developers
Done when
createAll
to receive components not from GOV.UK FrontendcreateAll
to initialising multiple components in a single call