Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove init() method from our JavaScript components #4008

Closed
1 task
Tracked by #3478
romaricpascal opened this issue Jul 25, 2023 · 0 comments · Fixed by #4011
Closed
1 task
Tracked by #3478

Remove init() method from our JavaScript components #4008

romaricpascal opened this issue Jul 25, 2023 · 0 comments · Fixed by #4011
Assignees
Milestone

Comments

@romaricpascal
Copy link
Member

What

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.

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

  • All components have had their init method removed and initialisation moved to the constructor()
@romaricpascal romaricpascal added awaiting triage Needs triaging by team javascript labels Jul 25, 2023
@romaricpascal romaricpascal added this to the v5.0 milestone Jul 25, 2023
@romaricpascal romaricpascal moved this from Backlog 🗄 to Sprint Backlog 🏃🏼‍♀️ in GOV.UK Design System cycle board Jul 25, 2023
@romaricpascal romaricpascal moved this from Sprint Backlog 🏃🏼‍♀️ to Backlog 🗄 in GOV.UK Design System cycle board Jul 25, 2023
@domoscargin domoscargin self-assigned this Jul 26, 2023
@stevenjmesser stevenjmesser moved this from Backlog 🗄 to Sprint Backlog 🏃🏼‍♀️ in GOV.UK Design System cycle board Jul 26, 2023
@domoscargin domoscargin moved this from Sprint Backlog 🏃🏼‍♀️ to In progress 📝 in GOV.UK Design System cycle board Jul 26, 2023
@domoscargin domoscargin moved this from In progress 📝 to Needs review 🔍 in GOV.UK Design System cycle board Jul 26, 2023
@colinrotherham colinrotherham moved this from Needs review 🔍 to Ready to release 🚀 in GOV.UK Design System cycle board Jul 28, 2023
@36degrees 36degrees removed the awaiting triage Needs triaging by team label Jul 31, 2023
@36degrees 36degrees moved this from Ready to release 🚀 to Done 🏁 in GOV.UK Design System cycle board Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants