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

Make the I18n class private #2941

Merged
merged 2 commits into from
Oct 24, 2022
Merged

Make the I18n class private #2941

merged 2 commits into from
Oct 24, 2022

Conversation

romaricpascal
Copy link
Member

@romaricpascal romaricpascal commented Oct 24, 2022

Removes the class export from the all.mjs module

This makes the class unavailable when importing from the all.mjs, and removes the I18n property from the GOVUKFrontent object. Tests have been updated to not check the presence of the property (and tidied up as they were excluding it when bulk testing the components were available on the object).

Flags the class with @private in its JSDoc and reinforce that its internal in its description

It won't stop anyone from running import {I18n} from 'govuk-front/govuk-esm/I18n.mjs, but will make it clear that they'd be using a private class that may change in the future. Unfortunately, we do need to have that file in the package as the accordion.mjs and character-count.mjs files will import it if they're imported individually.

Closes #2927.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2941 October 24, 2022 15:57 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2941 October 24, 2022 15:59 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2941 October 24, 2022 16:03 Inactive
@romaricpascal romaricpascal marked this pull request as ready for review October 24, 2022 16:06
@romaricpascal romaricpascal requested a review from a team October 24, 2022 16:14
@romaricpascal romaricpascal merged commit bc446da into main Oct 24, 2022
@romaricpascal romaricpascal deleted the i18n-private branch October 24, 2022 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider making the I18n class private
3 participants