Update dependency dart to >=3.8.3 <4.0.0 #438
Open
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.
This PR contains the following updates:
>=3.6.0 <4.0.0
->>=3.8.3 <4.0.0
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
dart-lang/sdk (dart)
v3.8.3
Compare Source
v3.8.2
Compare Source
v3.8.1
Compare Source
Released on: 2025-05-28
This is a patch release that:
async function bodies (issue #60748).
v3.8.0
Compare Source
Released on: 2025-05-20
Language
Dart 3.8 adds null-aware elements to the language. To use them, set
your package's [SDK constraint][language version] lower bound to 3.8
or greater (
sdk: '^3.8.0'
).Null-aware elements
Null-aware elements make it easier to omit a value from a collection literal if
it's
null
. The syntax works in list literals, set literals, and map literals.Within map literals, both null-aware keys and values are supported.
Here is an example a list literal written in both styles,
without using null-aware elements and using them:
To learn more about null-aware collection elements,
check out the documentation
and the feature specification.
Libraries
dart:core
Iterable.withIterator
constructor.dart:io
HttpClientBearerCredentials
.Stdout.supportsAnsiEscapes
andStdin.supportsAnsiEscapes
toreturn
true
forTERM
containingtmux
values.dart:html
dart:html
, likeHtmlElement
, can nolonger be extended. Long ago, to support custom elements, element classes
exposed a
.created
constructor that adhered to the v0.5 spec of webcomponents. On this release, those constructors have been removed and with
that change, the classes can no longer be extended. In a future change, they
may be marked as interface classes as well. This is a follow up from an
earlier breaking change in 3.0.0 that removed the
registerElement
APIs. See#53264 for details.
dart:ffi
Array.elements
which exposes anIterable
over theArray
's content.Tools
Analyzer
enables external elements to be referenced in documentation comments without
actually importing them. See the
documentation
for details.
the suggestions are improved when completing text in a comment reference on a
documentation comment for an extension, a typedef, or a directive (an import,
an export, or a library). Additionally, instance members can now be suggested
in a documentation comment reference.
FutureBuilder
widget.ValueListenableBuilder
.getter declaration.
omitting types:
omit_local_variable_types
,omit_obvious_local_variable_types
, andomit_obvious_property_types
.invocation" error.
this
references in order to avoidname collisions.
in subclasses in other libraries.
show
clause or removes names from ahide
clause can now add or remove multiple names simultaneously, in order toresolve as many "undefined" errors as possible.
required arguments.
show
orhide
clauses, which are never necessary.autocompletion.
use_null_aware_elements
lint rule.unnecessary_ignore
lint rule.enhancements!)
Dart Development Compiler (dartdevc)
In order to align with dart2js semantics, DDC will now throw a runtime error
when a redirecting factory is torn off and one of its optional non-nullable
parameters is provided no value. The implicit null passed to the factory will
not match the non-nullable type and this will now throw.
In the future this will likely be a compile-time error and will be entirely
disallowed.
Dart to Javascript Compiler (dart2js)
Removed the
--experiment-new-rti
and--use-old-rti
flags.Dart native compiler
Added cross-compilation support for the
Linux x64 and Linux ARM64 target platforms.
Dart format
In 3.7.0, we released a largely rewritten formatter supporting a new
"tall" style. Since then, we've gotten a lot of feedback and bug
reports and made a number of fixes in response to that.
Features
Some users strongly prefer the old behavior where a trailing comma will be
preserved by the formatter and force the surrounding construct to split. That
behavior is supported again (but off by default) and can enabled by adding this
to a surrounding
analysis_options.yaml
file:This is similar to how trailing commas work in the old short style formatter
applied to code before language version 3.7.
Bug fixes
a trailing comment (issue dart-lang/dart_style#1639).
Style changes
The following style changes are language versioned and only
affect code whose [language version][] is 3.8 or later.
Dart code at 3.7 or earlier is formatted the same as it was before.
Allow more code on the same line as a named argument or
=>
.Allow the target or property chain part of a split method chain on the RHS of
=
,:
, and=>
.Allow the condition part of a split conditional expression on the RHS of
=
,:
, and=>
.Don't indent conditional branches redundantly after
=
,:
, and=>
.Indent conditional branches past the operators.
Block format record types in typedefs:
Eagerly split argument lists whose contents are complex enough to be easier
to read spread across multiple lines even if they would otherwise fit on a
single line.
The heuristic is that the argument list must contain at least three named
arguments, some of which are nested and some of which are not.
v3.7.3
Compare Source
Released on: 2025-04-16
This is a patch release that:
v3.7.2
Compare Source
Released on: 2025-03-12
This is a patch release that:
js-string
builtin function with anon-nullable parameter type where it must use a nullable one (issue #59899).
v3.7.1
Compare Source
Released on: 2025-02-26
This is a patch release that:
traffic to be dropped (issue #8888).
factory constructors containing generic local functions (issue #160338).
in formal parameters, causing the wildcard variables to appear in
variable lists while debugging (issue #60121).
v3.7.0
Compare Source
Released on: 2025-02-12
Language
Dart 3.7 adds wildcard variables and inference using
bounds to the language. To use
them, set your package's [SDK constraint][language version] lower
bound to 3.7 or greater (
sdk: '^3.7.0'
).Wildcard variables
Local variables and parameters named
_
are now non-binding and they canbe declared multiple times without collisions. You will no longer be able to use
these variables nor access their values. All wildcard variable declaration types
that have this behavior are described in the
wildcard variables specification.
Top-level variables, top-level function names, type names, member names, etc.
are unchanged. They can be named
_
and used as they are today.These are a few examples of where wildcard variables can be used:
Inference using bounds
With the inference using bounds feature, Dart's type inference
algorithm generates constraints by combining existing constraints with
the declared type bounds, not just best-effort approximations.
This is especially important for F-bounded types, where inference
using bounds correctly infers that, in the example below,
X
can bebound to
B
. Without the feature, the type argument must be specifiedexplicitly:
f<B>(C())
:The feature is described in more details in the
inference using bounds specification.
Other language changes
Null
using
is
oras
, this type promotion is now properly accounted for inreachability analysis. This makes the type system more self-consistent,
because it mirrors the behavior of promoted local variables. This change is
not expected to make any difference in practice.
Tools
Analyzer
declaration.
prefer_relative_imports
andalways_use_package_imports
lint rules.~/
operation into/
, when the~/
operation is not available.
await
if the expression is currentlynot assignable, but awaiting it would make it assignable.
forEach
call into a for-loop nowconsider the
prefer_final_in_for_each
andalways_specify_types
lintrules.
cascade_invocations
lint rule violation.Expanded
widget,and with a
Flexible
widget.else-block to read
else if
.use_decorated_box
by swapping theContainer
withColoredBox
as suggested by the lint.the
show
combinator on an existing import.import directive with the given prefix.
hide
combinator.
show
combinator, and optionally a prefix.initializer of a late field.
prefer_const_declarations
lint rule, preferring to addconst
to a variabledeclaration rather than the initial value.
on
keyword in an extension declaration.override.
(Thanks @FMorschel for the above enhancements!
sort_constructors_first
lintrule.
function-typed parameters.
strict_top_level_inference
lint rule.unnecessary_underscores
lint rule.specify_nonobvious_property_types
lint rule.omit_obvious_property_types
lint rule.unnecessary_async
lint rule.unsafe_variance
lint rule.package_api_docs
lint rule.unsafe_html
lint rule.Dart format
The formatter implements a new style better suited for the kind of
declarative code that many Dart users are writing today. The new style looks
similar to the style you get when you add trailing commas to argument lists,
except that now the formatter will add and remove those commas for you.
The
dart format
command uses the language version ofeach input file to determine which style it gets. If the language version is 3.6
or lower, the code is formatted with the old style. If 3.7 or later, it gets the
new tall style.
You typically control the language version by setting a min SDK constraint in
your package's pubspec. This means that when you update the SDK
constraint in your pubspec to move to 3.7, you are also opting in to the new
style.
In order to correctly determine the language version of each file it formats,
dart format
(like otherdart
commands) looks for apackage_config.json
file surrounding the files being formatted. This means that you need to run
dart pub get
before formatting code in your package. If you have formatchecks in your continuous integration server, you'll want to make sure it runs
dart pub get
too.We don't intend to support both styles indefinitely. At some point in the
future when most of the ecosystem is on 3.7 or later, support for the old style
will be removed.
In addition to the new formatting style, a number of other changes are included,
some of them breaking:
Project-wide page width configuration. By long request, you can now
configure your preferred formatting page width on a project-wide basis. When
formatting a file, the formatter will look in the file's directory and any
surrounding directories for an
analysis_options.yaml
file. If it finds one,it looks for YAML like so:
If it finds a page width matching that schema, then the file is formatted
using that width. Since the formatter will walk the surrounding directories
until it finds an
analysis_options.yaml
file, this can be used to globallyset the page width for an entire directory, package, or even collection of
packages. Since
analysis_options.yaml
files already support aninclude
key to reference other
analysis_options.yaml
files, you can define a singleconfiguration and share it across a number of packages.
Opting out a region of code from formatting. In code formatted using the
new style, you can use a pair of special marker comments to opt a region of
code out of automated formatting:
The comments must be exactly
// dart format off
and// dart format on
.A file may have multiple regions, but they can't overlap or nest.
This can be useful for highly structured data where custom layout helps the
reader understand the data, like large lists of numbers.
Overriding the page width for a single file. In code formatted
using the new tall style, you can use a special marker comment to control the
page width that it's formatted using:
This comment must appear before any code in the file and must match that
format exactly. The width set by the comment overrides the width set by any
surrounding
analysis_options.yaml
file.This feature is mainly for code generators that generate and immediately
format code but don't know about any surrounding
analysis_options.yaml
that might be configuring the page width. By inserting this comment in the
generated code before formatting, it ensures that the code generator's
behavior matches the behavior of
dart format
.End users should mostly use
analysis_options.yaml
for configuring theirpreferred page width (or do nothing and continue to use the default page width
of 80).
Breaking change: Remove support for
dart format --fix
. Instead, usedart fix
. It supports all of the fixes thatdart format --fix
could applyand many more.
Treat the
--stdin-name
name as a path when inferring language version.When reading input on stdin, the formatter still needs to know its language
version to know what style to apply. If the
--stdin-name
option is set, thenthat is treated as a file path and the formatter looks for a package config
surrounding that file path to infer the language version from.
If you don't want that behavior, pass in an explicit language version using
--language-version=
, or use--language-version=latest
to parse the inputusing the latest language version supported by the formatter.
If
--stdin-name
and--language-version
are both omitted, then theformatter parses stdin using the latest supported language version.
Rename the
--line-length
option to--page-width
. This is consistentwith the public API, internal implementation, and docs, which all use "page
width" to refer to the limit that the formatter tries to fit code into.
The
--line-length
name is still supported for backwards compatibility, butmay be removed at some point in the future. You're encouraged to move to
--page-width
. Use of this option (however it's named) is rare, and willlikely be even rarer now that project-wide configuration is supported, so
this shouldn't affect many users.
Dart to Javascript Compiler (dart2js)
The dart2js compiler which is invoked when the command
dart compile js
isused has been switched to use an AOT snapshot instead of a JIT snapshot.
Dart Development Compiler (dartdevc)
The dartdevc compiler and kernel_worker utility have been switched to
use an AOT snapshot instead of a JIT snapshot,
the SDK build still includes a JIT snapshot of these tools as
package:build
andpackage:build_web_compiler
depend on it.The AOT snapshot can be used as follows to run DDC:
Libraries
dart:html
dart:html
is marked deprecated and will be removed in an upcoming release.Users should migrate to using
dart:js_interop
andpackage:web
. See#59716.
dart:indexed_db
dart:indexed_db
is marked deprecated and will be removed in an upcomingrelease. Users should migrate to using
dart:js_interop
andpackage:web
.See #59716.
dart:io
HttpException
will be thrown byHttpClient
andHttpServer
if aNUL
(
0x00
) appears in a received HTTP header value.dart:svg
dart:svg
is marked deprecated and will be removed in an upcoming release.Users should migrate to using
dart:js_interop
andpackage:web
. See#59716.
dart:web_audio
dart:web_audio
is marked deprecated and will be removed in an upcomingrelease. Users should migrate to using
dart:js_interop
andpackage:web
.See #59716.
dart:web_gl
dart:web_gl
is marked deprecated and will be removed in an upcoming release.Users should migrate to using
dart:js_interop
andpackage:web
. See#59716.
dart:js
dart:js
is marked deprecated and will be removed in an upcoming release.Users should migrate to using
dart:js_interop
. See #59716.dart:js_util
dart:js_util
is marked deprecated and will be removed in an upcomingrelease. Users should migrate to using
dart:js_interop
. See #59716.v3.6.2
Compare Source
Released on: 2025-01-30
HttpServer
responses were not correctly encodedif a "Content-Type" header was set (issue #59719).
dart format
to parse code at language version 3.6 so that digitseparators can be parsed correctly (issue #59815, dart_style issue
#1630).
between new and legacy inspector events (issue #59884).
dart fix
on a folder that contains a library with multiplefiles and more than one needs a fix, the fix will now be applied correctly
only once to each file (issue #59572).
v3.6.1
Compare Source
Released on: 2025-01-08
pub get
will now delete stray.dart_tool/package_config.json
files in directories between theworkspace root and workspace directories. Preventing confusing behavior
when migrating a repository to pub workspaces (issue pub#4445).
the incorrect generic covariant field in a constant object (issue
#57084).
(issue #56552).
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.