Skip to content

Update dependency dart to v3.12.0 - #139

Merged
quoc-huynh-cosee merged 1 commit into
mainfrom
renovate/dart-3.x
May 24, 2026
Merged

Update dependency dart to v3.12.0#139
quoc-huynh-cosee merged 1 commit into
mainfrom
renovate/dart-3.x

Conversation

@renovate

@renovate renovate Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Update Change
dart (source) minor 3.11.63.12.0

Release Notes

dart-lang/sdk (dart)

v3.12.0

Compare Source

Released on: Unreleased

Language
Private named parameters

Dart now supports private named parameters. Before 3.12, it was an error to
have a named parameter that starts with an underscore:

class Point {
  final int _x, _y;
  // Compile error in Dart 3.11.
  Point({required this._x, required this._y});
}

This means that, before 3.12, initializing a private field from
a named parameter required an explicit initializer list:

class Point {
  final int _x, _y;
  Point({required int x, required int y})
    : _x = x,
      _y = y;
}

All the initializer list is doing is removing the leading _.
In Dart 3.12, the language does that for you. Now you can write:

class Point {
  final int _x, _y; // Private fields.
  Point({required this._x, required this._y});
}

This code behaves exactly like the previous example. The initialized fields are
private, but the argument names written at the call site are public:

void main() {
  print(Point(x: 1, y: 2));
}
Libraries
dart:core
  • The Dart VM's RegExp implementation now supports
    modifier spans and duplicate named capture groups.
dart:js_interop
  • Breaking change in extension name of isA: isA is moved from
    JSAnyUtilityExtension to NullableObjectUtilExtension to support
    type-checking any Object?. isA<JSObject>() also now handles JS objects
    with no prototypes correctly and isA<JSAny>() does a non-trivial check to
    make sure the value is a JS value. See #​56905 for more details. As
    JSAnyUtilityExtension is on JSAny? and NullableObjectUtilExtension is on
    the supertype Object?, this change is only breaking if users referred to the
    extension name directly, either through applying the extension directly or
    through using show/hide directives.

  • isA<JSExportedDartFunction>() now checks whether the function is
    actually a JS wrapper function that is returned from
    Function.toJS or Function.toJSCaptureThis.

  • Added JSIterableProtocol, JSIterable, JSIteratorProtocol, JSIterator,
    and JSIteratorResult types to model JavaScript's iteration protocols.
    JSArray and JSString now implement JSIterable.

  • Added extension types to provide Iterable.toJSIterable,
    JSIterable.toDartIterable, Iterator.toJSIterator, and
    JSIterator.toDartIterator.

Tools
Analyzer
  • The new simple_directive_paths lint and its associated fix
    flag and simplify unnecessarily complex import and export paths,
    such as those containing redundant ./ or backtracking ../ segments.

    Use dart fix --code=simple_directive_paths (with either --dry-run or
    --apply) to bulk fix existing lint violations.

  • The prefer_initializing_formals lint rule highlights named parameters
    that could be private named parameters.

    Use dart fix --code=prefer_initializing_formals (with either --dry-run or
    --apply) to bulk fix existing lint violations.

  • Violations of the avoid_final_parameters lint can now be
    fixed with dart fix --code=avoid_final_parameters.

  • The analyzer now warns when a function that contains a
    parameter annotated with @mustBeConst is torn off.

  • The invalid_runtime_check_with_js_interop_types rule now checks for JS
    interop types used in a catch clause's on-type and instructs users to
    use isA for type checks instead.

  • Analyzer plugins: Initial support for 'print debugging' via new sections in
    the "Plugins" Insights (Diagnostics) page. When a plugin is computing lint
    and warning diagnostics, print calls are now redirected to the analysis
    server, which presents the messages in the appropriate plugin's section on
    the Plugins page.

  • Improved support for extension types in many existing lint rules.

  • Improved support for null-aware elements in existing lint rules.

  • The analysis server starts up faster with the help of improved analysis
    options file caching. The improvement depends on the number of analysis
    options files in the workspace, and the number of included analysis options
    files. The improvement is greater for systems with slower disk access.

  • Various other improvements to analysis performance.

Pub
  • dart pub cache repair now, by default, only repairs the
    packages referenced by the current project's pubspec.lock file.
    For the old behavior of repairing all packages, use the --all flag.
  • dart pub add and dart pub unpack now accept @ as an alternative to :
    for separating a package name from its version constraint.
  • Git dependencies now support Git Large File Storage (LFS).
dart2wasm
  • Updated deferred loading module loader API to allow batched fetching of
    deferred modules. The embedder now takes loadDeferredModules instead of
    loadDeferredModule where the new function should now expect an array of
    module names rather than individual module names. All the module loading
    functions must now also accept an instantiator callback to which they
    should pass the loaded results.
dart2js
  • JSExportedDartFunction.toDart sometimes incorrectly returned the original
    Dart function even if the wrapper JS function was cast from a call to the
    deprecated allowInterop. Instead, to be consistent with DDC and dart2wasm,
    it now throws if the wrapper JS function wasn't a result of Function.toJS or
    Function.toJSCaptureThis.

Configuration

📅 Schedule: (in timezone Europe/Berlin)

  • Branch creation
    • "before 5am on monday"
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Never, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@quoc-huynh-cosee
quoc-huynh-cosee merged commit bd75ddf into main May 24, 2026
1 check passed
@quoc-huynh-cosee
quoc-huynh-cosee deleted the renovate/dart-3.x branch May 24, 2026 14:53
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.

1 participant