-
Notifications
You must be signed in to change notification settings - Fork 331
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
Warn if importing core, overrides without dependencies #1807
Warn if importing core, overrides without dependencies #1807
Conversation
db88ee4
to
6c79763
Compare
Add deprecation warnings if users import files from the core and overrides layers without first importing the settings, helpers and tools layers. We'll remove the imports of "base" from files in these layers in 4.0[1], so this will no longer work. [1]: #1800
6c79763
to
7557564
Compare
@m-green it'd be good to get your thoughts on the deprecation notice we're using:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that I don't see a warning as long as I import just one of /tools/all
or /helpers/all
(and no warning if I neglect to import /settings/all
). This is an edge case but you wouldn't see a warning if you were already doing
@import "govuk-frontend/govuk/helpers/all";
@import "govuk-frontend/govuk/core/global-styles";
I think that's probably OK as an edge case, as it should also be communicated in the release notes (which should probably be done as part of this PR) and in the release notes for 4.0 when it goes out? Thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @36degrees yes I think that makes sense, just wanted to flag it as something to be aware of.
Nice work with getting this done 👍
Importing files from this layer without first importing the 'base' file was deprecated in #1807. Anyone who was relying on the import should already be seeing warnings. If this change affects them, they'll just need to ensure they're importing the base layer first. This is part of a change to the way that the base layers (settings, tools and helpers) are imported within different parts of GOV.UK Frontend’s Sass, designed to reduce the time it takes to compile the Sass to CSS. Remove the tests, which were only checking that the deprecation warning was emitted as expected.
Importing files from this layer without first importing the 'base' file was deprecated in #1807. Anyone who was relying on the import should already be seeing warnings. If this change affects them, they'll just need to ensure they're importing the base layer first. This is part of a change to the way that the base layers (settings, tools and helpers) are imported within different parts of GOV.UK Frontend’s Sass, designed to reduce the time it takes to compile the Sass to CSS. Remove the tests, which were only checking that the deprecation warning was emitted as expected.
Add deprecation warnings if users import files from the core and overrides layers without first importing the settings, helpers and tools layers.
We'll remove the imports of "base" from files in these layers in 4.0, so this will no longer work.
Closes #1798