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

Renames js- css prefix to govuk-js- #1444

Merged
merged 2 commits into from
Jun 13, 2019
Merged

Renames js- css prefix to govuk-js- #1444

merged 2 commits into from
Jun 13, 2019

Conversation

aliuk2012
Copy link
Contributor

@aliuk2012 aliuk2012 commented Jun 11, 2019

Currently two components(character count & header) have js- interaction
hooks. Unfortunately we have found somes instances where other 3rd party js or
legacy js (govuk-elements etc) had some unexpected behaviour with
the components and in some cases raised js errors.

We decided as a team that we should instead namespace (using govuk-js)
these hooks so that we have confidence in the initialising and interaction of the components on a page with other scripts.

fixes #1270

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1444 June 11, 2019 11:15 Inactive
@aliuk2012 aliuk2012 added this to the v3.0.0 milestone Jun 11, 2019
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1444 June 12, 2019 08:47 Inactive
@aliuk2012 aliuk2012 marked this pull request as ready for review June 12, 2019 08:49
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1444 June 12, 2019 08:49 Inactive
@kr8n3r
Copy link

kr8n3r commented Jun 12, 2019

does this change extend to the template? https://github.com/alphagov/govuk-frontend/blob/master/src/template.njk#L31

@aliuk2012
Copy link
Contributor Author

Hi @kr8n3r,

No it doesn't, the team decided that js-enabled was to widely used for styling components and we could not think of a use case were you would use 'js-enabled' as a hook to add interactions.

As you pointed out with this line of code, if JavaScript fails or is disabled then 'js-enabled' would not be added to the body element and no JavaScript would run anyway.

@NickColley
Copy link
Contributor

One big reason to avoid changing js-enabled is that it'd make it harder for users using GOV.UK Template with GOV.UK Frontend

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1444 June 12, 2019 10:16 Inactive
CHANGELOG.md Outdated Show resolved Hide resolved
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1444 June 13, 2019 11:53 Inactive
Copy link
Contributor

@NickColley NickColley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CHANGELOG works, I think could have some style improvements but we can do that with Mark later

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1444 June 13, 2019 12:07 Inactive
Currently two components(character count & header) have `js-` interaction
hooks. Unfortunately we have found somes instances where other 3rd party js or
legacy js (govuk-elements etc) had some unexpected behaviour with
the components and in some cases raised js errors.

We decided as a team that we should instead namespace (using `govuk-js`)
these hooks so that we have confidence in the initialising and interacting
on a page with other scripts.
@aliuk2012 aliuk2012 merged commit 155ea70 into v3 Jun 13, 2019
@NickColley NickColley deleted the al/prefix-js-classnames branch June 13, 2019 12:19
peteryates added a commit to x-govuk/govuk-form-builder that referenced this pull request Aug 5, 2019
Again, this is due to the namespacing changes[0] made in V3 of the GOV.UK
Design System

[0] alphagov/govuk-frontend#1444
peteryates added a commit to x-govuk/govuk-form-builder that referenced this pull request Jan 9, 2020
Again, this is due to the namespacing changes[0] made in V3 of the GOV.UK
Design System

[0] alphagov/govuk-frontend#1444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

4 participants