-
Notifications
You must be signed in to change notification settings - Fork 347
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
Changes from 11 commits
9a40e3a
8f3dae1
323aa1c
e3f1e9e
96df02f
d1f28f5
7e23ec8
6b3e6f0
d00498c
a4bc07d
a3a8974
1d38e63
b03ac1d
91c23dd
2b99fef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ import 'package:sass/src/executable/repl.dart'; | |
import 'package:sass/src/executable/watch.dart'; | ||
import 'package:sass/src/import_cache.dart'; | ||
import 'package:sass/src/io.dart'; | ||
import 'package:sass/src/logger/deprecation_handling.dart'; | ||
import 'package:sass/src/stylesheet_graph.dart'; | ||
import 'package:sass/src/utils.dart'; | ||
|
||
|
@@ -52,8 +53,15 @@ Future<void> main(List<String> args) async { | |
return; | ||
} | ||
|
||
var graph = StylesheetGraph( | ||
ImportCache(loadPaths: options.loadPaths, logger: options.logger)); | ||
var graph = StylesheetGraph(ImportCache( | ||
loadPaths: options.loadPaths, | ||
logger: DeprecationHandlingLogger(options.logger, | ||
fatalDeprecations: options.fatalDeprecations, | ||
futureDeprecations: options.futureDeprecations, | ||
// This logger may be reused by multiple parses, so we don't want | ||
// warnings from a previous parse to cause subsequent warnings to | ||
// be skipped. | ||
limitRepetition: false))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a couple questions here:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This wrapped logger is only used during parsing. This matches the current behavior with the We could change There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
if (options.watch) { | ||
await watch(options, graph); | ||
return; | ||
|
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