Skip to content

Upgrade to Dart 3.13.0 - #2835

Merged
nex3 merged 10 commits into
mainfrom
dart-sdk-version
Aug 17, 2026
Merged

nex3 merged 10 commits into
mainfrom
dart-sdk-version

Conversation

@nex3

@nex3 nex3 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

This includes reformatting with the new Dart style logic and using a number of new language features.

@nex3
nex3 requested a review from jathak August 14, 2026 01:01
@nex3
nex3 force-pushed the dart-sdk-version branch from 67fd820 to 4db242b Compare August 14, 2026 01:04

@jathak jathak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking through this, converting everything to primary constructors where possible seems like the right move even if it's sometimes a bit awkward.

final class ModifiableCssAtRule(
@override final CssValue<String> name,
@override final FileSpan span, {
bool childless = false,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a specific reason we use childless for the parameter but isChildless for the field here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The style guide says that boolean properties should be verb phrases (like "is childless"), but suggests that as parameters the verb should be omitted.

required this.parsedAsSassScript,
FileSpan? valueSpanForMap,
}) : valueSpanForMap = valueSpanForMap ?? value.span {
this {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it might make sense to move constructor bodies to the top of the class when present to avoid the parameter list being separated from the body.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I understand the impulse, but what used to be "a constructor" is now intrinsically split across multiple locations—the parameters are in the class header, additional field initializers are at the field locations, and the constructor body is at the this call. I think it makes sense to have the constructor body after field initializers, since it's run after they're initialized.

Given that constructor bodies should come after fields, I think it makes sense to put them after properties as well, for the same reason we've historically put constructors after properties: the properties (like fields) provide a view into the "state" of the object from a user's perspective, even if they're computable from other state internally.

Comment thread lib/src/ast/css/modifiable/import.dart
Comment thread lib/src/ast/sass/expression/legacy_if.dart
/// {@category Parsing}
@sealed
abstract class Expression implements SassNode {
abstract class Expression() implements SassNode {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe you'd said you would leave off the primary constructors for classes with implicit zero-argument constructors. Is that not the case here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope, this is just a mistake 😄.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The failing tests reminded me why this was necessary: because this class has a factory constructor, it doesn't have an implicit zero-argument constructor. One needs to be declared explicitly.

Comment thread lib/src/ast/node.dart Outdated

/// Creates a parser that parses CSS selectors.
///
/// If [_allowParent] is `false`, this will throw a [SassFormatException] if

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure if it matters in this case since these docs aren't rendered for sass or sass_api, but when using private named parameters, should the reference be to the version with the underscore (as it appears here) or to the name without an underscore (as they would appear when calling this)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Dartdoc complains if it's not the version with the underscore, apparently.

@nex3 nex3 changed the title Upgrade to Dart 1.13.0 Upgrade to Dart 3.13.0 Aug 17, 2026
@nex3
nex3 requested a review from jathak August 17, 2026 21:00
@nex3
nex3 force-pushed the dart-sdk-version branch from 7912587 to 287f9ba Compare August 17, 2026 21:08
@nex3
nex3 merged commit f3bd86a into main Aug 17, 2026
41 checks passed
@nex3
nex3 deleted the dart-sdk-version branch August 17, 2026 22:44
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.

2 participants