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

Emit all warnings in the evaluator #2396

Merged
merged 5 commits into from
Oct 18, 2024
Merged

Emit all warnings in the evaluator #2396

merged 5 commits into from
Oct 18, 2024

Conversation

jathak
Copy link
Member

@jathak jathak commented Oct 18, 2024

Fixes #2390.

This changes the parser to store all warnings it would emit in the warnings field on the parsed stylesheet, which are then all emitted when that stylesheet is visited by the evaluator. This eliminates the need to wrap and pass loggers to the parser and ImportCache and ensures that the various deprecation warnings are handled consistently by the DeprecationProcessingLogger created for each evaluation.

See sass/sass-spec#2032.

@jathak jathak requested a review from nex3 October 18, 2024 21:00
"Relative canonical URLs are deprecated and will eventually be "
"disallowed.");
} else if (await importer.isNonCanonicalScheme(result.scheme)) {
if (result.scheme != '' &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment that this should be an error but currently produces a deprecation warning in the evaluator

@@ -119,25 +123,32 @@ abstract class StylesheetParser extends Parser {
return arguments;
});

Expression parseExpression() => _parseSingleProduction(_expression);
({Expression node, List<ParseTimeWarning> warnings}) parseExpression() =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd make the return value positional, since there are only two values with no risk of confusion.

@jathak jathak merged commit 60d440a into main Oct 18, 2024
38 checks passed
@jathak jathak deleted the parse-time-warnings branch October 18, 2024 22:28
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 this pull request may close these issues.

Parse-time deprecation messages are not properly rate limited
2 participants