You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
romaricpascal
changed the title
Investigate how to make TypeScript happy with more options for createAll
Investigate impact on types and TypeScript of our plans for createAllAug 8, 2024
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 callThe text was updated successfully, but these errors were encountered: