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
Remove the init() method from our JavaScript components and move their initialisation to the bottom constructor().
Why
The init() method adds an unnecessary step for our components' initialisation,
without tangible benefits for what our components do. Without it we can simplify both how our components are initialised, as well as their internal implementation as we're looking to throw errors at instantiation.
Removing it entirely and moving its code to the constructor will ensure that components don't get a double initialisation by services that may have missed a .init() call during their migration. Instead, they'll get a clear error telling them that they're calling a method that no longer exists.
What
Remove the
init()
method from our JavaScript components and move their initialisation to the bottomconstructor()
.Why
The
init()
method adds an unnecessary step for our components' initialisation,without tangible benefits for what our components do. Without it we can simplify both how our components are initialised, as well as their internal implementation as we're looking to throw errors at instantiation.
Removing it entirely and moving its code to the
constructor
will ensure that components don't get a double initialisation by services that may have missed a.init()
call during their migration. Instead, they'll get a clear error telling them that they're calling a method that no longer exists.You can find more explanations of that decision in our decision record.
Who needs to work on this
Developers
Who needs to review this
Developers
Done when
init
method removed and initialisation moved to theconstructor()
The text was updated successfully, but these errors were encountered: