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 redundant import in accordion component #1923

Merged
merged 3 commits into from
Feb 12, 2021

Conversation

alex-ju
Copy link
Contributor

@alex-ju alex-ju commented Feb 11, 2021

What

Remove redundant import in the accordion component that was accidentally introduced in #1884.

We do however need it for the print stylesheet, as we have two applications requiring the components/print/accordion but not the component_support. This could potentially be fixed in future by removing component_support from print/_accordion and updating the suggested print imports to include component_support.

Why

This import resulted in a considerable increase in our render-blocking resources.

Visual Changes

No visual changes

@bevanloon bevanloon temporarily deployed to govuk-publis-remove-acc-gwkn4i February 11, 2021 15:27 Inactive
Copy link
Contributor

@andysellick andysellick left a comment

Choose a reason for hiding this comment

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

Looks sensible. Can you record here specifically what it is that this component needs from component_support?

@alex-ju
Copy link
Contributor Author

alex-ju commented Feb 11, 2021

Looks sensible. Can you record here specifically what it is that this component needs from component_support?

All the govuk-frontend mixins used in accordion 🙂

@bevanloon bevanloon temporarily deployed to govuk-publis-remove-acc-gwkn4i February 11, 2021 18:19 Inactive
This import resulted in an increase of our render-blocking resource
`components/print/accordion` requires `govuk-frontend` mixins as it imports the main `components/accordion` on line 5
@alex-ju alex-ju force-pushed the remove-accidental-component-support-import branch from 74fd2b0 to e8903fd Compare February 12, 2021 10:16
@bevanloon bevanloon temporarily deployed to govuk-publis-remove-acc-gwkn4i February 12, 2021 10:16 Inactive
@alex-ju alex-ju merged commit 8a561c9 into master Feb 12, 2021
@alex-ju alex-ju deleted the remove-accidental-component-support-import branch February 12, 2021 10:30
@chris-gds
Copy link
Contributor

Ahh thanks for this @alex-ju! Do we want to use the govuk-frontend mixins in this way? 🤔

@alex-ju
Copy link
Contributor Author

alex-ju commented Feb 12, 2021

Ahh thanks for this @alex-ju! Do we want to use the govuk-frontend mixins in this way? 🤔

Yes, we want to use govuk-frontend mixins as much as possible as it helps with building components in a more consistent way, but these are already included by each app, so there's no need to import them into each component. The only different thing with this component is that the accordion print stylesheet requires the accordion component stylesheet (as the Design System doesn't ship print stylesheets at the moment) so we don't show buttons and other unnecessary elements when printing the page.

alex-ju added a commit that referenced this pull request Feb 15, 2021
## 24.1.1

* Fix deprecation warnings when running tests ([PR #1899](#1899))
* Update `govuk-frontend` base SCSS imports ([PR #1922](#1922))
* Remove redundant import in accordion component ([PR #1923](#1923))
* Fix toggle click tracking on step-by-steps ([PR #1925](#1925))
* Accordion summary design adjustment ([PR #1926](#1926))
* Fix `layout_header` layout and spacing issues ([PR #1924](#1924))
@alex-ju alex-ju mentioned this pull request Feb 15, 2021
This was referenced Mar 17, 2021
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.

4 participants