-
Notifications
You must be signed in to change notification settings - Fork 319
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
Selectively silence deprecations and fix missed warnings #4985
Conversation
📋 StatsFile sizes
Modules
View stats and visualisations on the review app Action run for 3738efa |
We want to be able to use `silenceDeprecations`, which is only available in 1.74.0 and above [1]. [1]: https://sass-lang.com/documentation/js-api/interfaces/options/#silenceDeprecations
Silencing all logs means that we may miss: - any deprecations from Sass that we can fix now without breaking support for LibSass and Ruby Sass - tests that need updating because of our own deprecations Instead we can use the new `silenceDeprecations` feature introduced in Sass 1.74.0 and silence just the deprecations we know we can’t do anything about.
We need to pass `sassConfig` which configures Sass to use the mockWarnFunction for the expected warnings, silencing them.
23f202b
to
3738efa
Compare
@@ -18,7 +18,7 @@ const sassPaths = [ | |||
async function compileSassFile(path, options = {}) { | |||
return compileAsync(path, { | |||
loadPaths: sassPaths, | |||
logger: Logger.silent, | |||
silenceDeprecations: ['slash-div'], |
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.
@36degrees Really glad this is out now, I had my eyes on this 🙌
Remember I had to write my own logger for Sass builds? Can probably whip that out now too
It's suppressing these two currently:
suppressed: [
'Using / for division is deprecated and will be removed in Dart Sass 2.0.0.',
'Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.'
]
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 for the heads up! 🙌🏻
I'll raise an issue as something to do in a follow up PR.
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.
That silenceDeprecations
is quite handy 🙌🏻 Thanks for tidying up the tests 😊
Silencing all logs means that we may miss:
all
entrypoints!)Instead we can use the new
silenceDeprecations
option introduced in Sass 1.74.0 and silence just the deprecations we know we can’t do anything about.Fix the deprecation warnings that we can now see 🎉