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 GOVUKFrontend prefix from GOVUKFrontendComponent class #5497

Open
2 tasks
Tracked by #5373
romaricpascal opened this issue Nov 12, 2024 · 0 comments · May be fixed by #5515
Open
2 tasks
Tracked by #5373

Remove GOVUKFrontend prefix from GOVUKFrontendComponent class #5497

romaricpascal opened this issue Nov 12, 2024 · 0 comments · May be fixed by #5515
Assignees

Comments

@romaricpascal
Copy link
Member

romaricpascal commented Nov 12, 2024

What

Remove GOVUKFrontend prefix from the GOVUKFrontendComponent class, so it's named Component. Because of the name change, we'll also want to rename the file that holds it to component.mjs.

This file move could be a breaking change for people importing from govuk-frontend/dist/govuk/govuk-frontend-component.mjs. To avoid a breaking change, we'll need to keep the govuk-frontend-component.mjs class and ensure it re-exports Component as GOVUKFrontendComponent.

Why

To implement the decision we made on Slack to drop the GOVUKFrontend prefix from both GOVUKFrontendComponent and the new GOVUKFrontendConfigurableComponent (or whatever name it ends up with) in favour of simpler Component and ConfigurableComponent.

This decision was motivated by the fact that:

  • in our own codebase, it's pretty clear components are of GOV.UK Frontend
  • for external codebases, we export it as Component to not give the impression that extending the class makes the component 'automatically' part of GOV.UK Frontend
  • if a naming collision with another library happens, import aliases can be used to clarify which Component is which.

Who needs to work on this

Developers

Who needs to review this

Developers

Done when

  • We've added a deprecation to the changelog for govuk-frontend-component.mjs and its GOVUKFrontendComponent class
  • GOVUKFrontendComponent has been renamed Component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress 📝
2 participants