Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add --fatal-deprecations and --future-deprecations #1820
Add --fatal-deprecations and --future-deprecations #1820
Changes from 9 commits
9a40e3a
8f3dae1
323aa1c
e3f1e9e
96df02f
d1f28f5
7e23ec8
6b3e6f0
d00498c
a4bc07d
a3a8974
1d38e63
b03ac1d
91c23dd
2b99fef
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What if users are writing custom functions that have behavior that becomes deprecated?
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 was thinking they would pass
Deprecation.userAuthored
, but do you think it would make more sense to just leave the boolean parameter un-deprecated? (since right now if they passdeprecation: true
with nodeprecationType
, it defaults toDeprecation.userAuthored
)Or could it be confusing to have both
deprecation
anddeprecationType
un-deprecated, since then you could potentially call it with a deprecation type but explicitly passdeprecation: false
? (in which case the boolean parameter would be ignored)Would making
deprecation
nullable but un-deprecated work?If we do leave the
deprecation
un-deprecated inEvaluationContext.warn
, should we also do the same forLogger.warn
? If we do that, should we just leave thewarnForDeprecation
extension forLogger
as private? (since custom functions should usually be just usingDeprecation.userAuthored
anyway)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.
What if we just have two separate functions for both
EvaluationContext
andLogger
, one for public consumption that takes a booleandeprecation
flag and one that's private to Sass which takes aDeprecation
?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.
Done
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 have a couple questions here:
Previously, the
Options
class was responsible for setting up the logger according to the options passed. Why not do the same withDeprecationHandlingLogger
?If we don't limit repetitions here, under what circumstances will we limit repetitions on the CLI?
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.
This wrapped logger is only used during parsing.
options.logger
is wrapped by aDeprecationHandlingLogger
again during the actual compilation (this time, withlimitRepetition
set to true ifverbose
is false).This matches the current behavior with the
TerseLogger
thatDeprecationHandlingLogger
replaces (repetitions aren't limited for deprecation warnings during parsing). The need to reset the state ofDeprecationHandlingLogger
is also why we don't just haveoptions.logger
produce it.We could change
options.logger
to just produce a singleDeprecationHandlingLogger
, but we'd then need some way forStylesheetGraph
and the compiler to reset its state after each run. Do you think that makes more sense instead of wrapping the base logger multiple times?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.
No, I think this is fine. It might be worth documenting more of what you just said in the comments, though.
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.
Done