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

Dependencies on GOV.UK are not clear #147

Closed
gregtyler opened this issue Apr 28, 2021 · 0 comments · Fixed by #285
Closed

Dependencies on GOV.UK are not clear #147

gregtyler opened this issue Apr 28, 2021 · 0 comments · Fixed by #285

Comments

@gregtyler
Copy link
Contributor

Description

Some components have dependencies on functions, variables and mixins from govuk-frontend. For example, the cookie banner relies on govuk-widh-container, govuk-font, govuk-colour and more.

This is not an issue if all of the SCSS files from govuk-frontend are imported, but it is a problem if users only include the bits they need in their app. For example, a DWP service uses the following imports (which doesn't cover govuk-width-container):

@import "../../../../node_modules/govuk-frontend/govuk/base";
@import "../../../../node_modules/govuk-frontend/govuk/core/links";
@import "../../../../node_modules/govuk-frontend/govuk/components/button/index";
@import "../../../../node_modules/govuk-frontend/govuk/components/textarea/textarea";
@import "../../../../node_modules/@ministryofjustice/frontend/moj/all";

Fixes

Two ways of fixing this spring to mind:

  • Updating documentation to tell users what imports they need to make from govuk-frontend, either on a per-component basis or in the install instructions
  • Importing any required files ourselves

The second option certainly seems the cleanest, but we'll need to explore it in depth to ensure there are no adverse side effects or cross-incompatibilities.

gregtyler added a commit that referenced this issue Dec 16, 2021
Make govuk-frontend a package dependency, and import its helpers and width-container into SCSS,
where they're used.

Stop building `.govuk-textarea` in SCSS, instead just apply it onto the element directly.

Mark jQuery as a peer dependency, as it's necessary for the JavaScript to work but not bundled as
part of the package.

BREAKING CHANGE: The package now explicitly depends on govuk-frontend ^4.0.0. If you
already have govuk-frontend installed, ensure that you're using this version.

fixes #147
gregtyler added a commit that referenced this issue Dec 16, 2021
Make govuk-frontend a package dependency, and import its helpers and width-container into SCSS,
where they're used.

Stop building `.govuk-textarea` in SCSS, instead just apply it onto the element directly.

Mark jQuery as a peer dependency, as it's necessary for the JavaScript to work but not bundled as
part of the package.

BREAKING CHANGE: The package now explicitly depends on govuk-frontend >=3.0.0. If you
already have govuk-frontend installed, ensure that you're using a compatible version.

fixes #147
gregtyler added a commit that referenced this issue Dec 17, 2021
Make govuk-frontend a package dependency, and import its helpers and width-container into SCSS,
where they're used.

Stop building `.govuk-textarea` in SCSS, instead just apply it onto the element directly.

Mark jQuery as a peer dependency, as it's necessary for the JavaScript to work but not bundled as
part of the package.

fixes #147
gregtyler added a commit that referenced this issue Dec 20, 2021
Make govuk-frontend a package dependency, and import its helpers and width-container into SCSS,
where they're used.

Stop building `.govuk-textarea` in SCSS, instead just apply it onto the element directly.

Mark jQuery as a peer dependency, as it's necessary for the JavaScript to work but not bundled as
part of the package.

fixes #147
gregtyler added a commit that referenced this issue Dec 20, 2021
Make govuk-frontend a package dependency, and import its helpers and width-container into SCSS,
where they're used.

Stop building `.govuk-textarea` in SCSS, instead just apply it onto the element directly.

Mark jQuery as a peer dependency, as it's necessary for the JavaScript to work but not bundled as
part of the package.

fixes #147
gregtyler pushed a commit that referenced this issue Dec 20, 2021
# [1.1.0](v1.0.1-alpha...v1.1.0-alpha) (2021-12-20)

### Features

* **deps:** make dependencies explicit ([829da49](829da49)), closes [#147](#147)
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 a pull request may close this issue.

1 participant