chore(deps): update dependency dart to v42039 #3751
Closed
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.2.4->42039Release Notes
dart-lang/sdk (dart)
v3.5.3Compare Source
issue resulting in a missing tab bar when DevTools is embedded in
IntelliJ and Android Studio (issue#56607).
DevTools is opened instead of only the first time (issue#56607).
embedded in IntelliJ and Android Studio (issue#56607).
v3.5.2Compare Source
ZLibDecoderwould incorrectly attempt to decompress datapast the end of the zlib footer (issue #56481).
dartfromPATHcould result in some commands notworking as expected (issues #56080, #56306, #56499).
setContextRootsrequests orbeing provided incorrect context roots in multi-package workspaces (issue
#56475).
v3.5.1Compare Source
include:inanalysis_options.yamlfile in a nestedfolder in the workspace (issue#56464).
dart compile wasmwhen optimizations areenabled (issue #56423).
dart2wasmcompiler in unsound-O3/-O4modes where aimplicit setter for a field of generic type will store
nullinstead of thefield value (issue #56374).
dart2wasmcompiler that can trigger in certain situationswhen using partial instantiations of generic tear-offs (constructors or static
methods) in constant expressions (issue #56440).
also known is UP, is provided the missing implementation for
StructuralParameterTypeobjects. In some corner cases cases thelacking implementation resulted in a crash of the compiler (issue #56457).
v3.5.0Compare Source
Language
Breaking Change #55418: The context used by the compiler to perform
type inference on the operand of an
awaitexpression has been changed tomatch the behavior of the analyzer. This change is not expected to make any
difference in practice.
Breaking Change #55436: The context used by the compiler to perform
type inference on the right hand side of an "if-null" expression (
e1 ?? e2)has been changed to match the behavior of the analyzer. change is expected to
have low impact on real-world code. But in principle it could cause
compile-time errors or changes in runtime behavior by changing inferred
types. The old behavior can be restored by supplying explicit types.
Libraries
dart:coreDateTimeon the web platform now storesmicroseconds. The web implementation is now practically compatible with the
native implementation, where it is possible to round-trip a timestamp in
microseconds through a
DateTimevalue without rounding the lowerdigits. This change might be breaking for apps that rely in some way on the
.microsecondcomponent always being zero, for example, expecting only threefractional second digits in the
toString()representation. Smalldiscrepancies in arithmetic due to rounding of web integers may still occur
for extreme values, (1)
microsecondsSinceEpochoutside the safe range,corresponding to dates with a year outside of 1685..2255, and (2) arithmetic
(
add,subtract,difference) where theDurationargument or resultexceeds 570 years.
dart:ioBreaking Change #55786:
SecurityContextis nowfinal. This meansthat
SecurityContextcan no longer be subclassed.SecurityContextsubclasses were never able to interoperate with other parts of
dart:io.A
ConnectionTaskcan now be created using an existingFuture<Socket>.Fixes #55562.
dart:typed_dataBreaking Change #53785: The unmodifiable view classes for typed data
have been removed. These classes were deprecated in Dart 3.4.
To create an unmodifiable view of a typed-data object, use the
asUnmodifiableView()methods added in Dart 3.3.Added superinterface
TypedDataListto typed data lists, implementing bothListandTypedData. Allows abstracting over all such lists without losingaccess to either the
Listor theTypedDatamembers.A
ByteDatais still only aTypedData, not a list.dart:js_interopBreaking Change #55508:
importModulenow accepts aJSAnyinsteadof a
Stringto support other JS values as well, likeTrustedScriptURLs.Breaking Change #55267:
isTruthyandnotnow returnJSBooleaninstead of
boolto be consistent with the other operators.Breaking Change
ExternalDartReferenceno longer implementsObject.ExternalDartReferencenow accepts a type parameterTwith a bound ofObject?to capture the type of the Dart object that is externalized.ExternalDartReferenceToObject.toDartObjectnow returns aT.ExternalDartReferenceToObjectandObjectToExternalDartReferenceare nowextensions on
TandExternalDartReference<T>, respectively, whereT extends Object?. See #55342 and #55536 for more details.Fixed some consistency issues with
Function.toJSacross all compilers.Specifically, calling
Function.toJSon the same function gives you a new JSfunction (see issue #55515), the maximum number of arguments that are
passed to the JS function is determined by the static type of the Dart
function, and extra arguments are dropped when passed to the JS function in
all compilers (see #48186).
Tools
Linter
unintended_html_in_doc_comment][unintended_html_in_doc_comment] lint.invalid_runtime_check_with_js_interop_types][invalid_runtime_check_with_js_interop_types] lint.document_ignores][document_ignores] lint.Pub
dart pub downgrade --tightento restrict lower bounds ofdependencies' constraints to the minimum that can be resolved.
Dart Runtime
The Dart VM only executes sound null safe code, running of unsound null
safe code using the option
--no-sound-null-safetyhas been removed.Dart_NewListOfandDart_IsLegacyTypefunctions areremoved from Dart C API.
Dart_DefaultCanonicalizeUrlis removed from the Dart C API.v3.4.4Compare Source
This is a patch release that:
Fixes an issue where pub would crash when failing to fetch advisories from
the server. (issue pub#4269).
Fixes an issue where
const bool.fromEnvironment('dart.library.ffi')is trueand conditional import condition
dart.library.ffiis true in dart2wasm.(issue #55948).
Fixes an issue where FFI calls with variadic arguments on MacOS Arm64
would mangle the arguments. (issue #55943).
v3.4.3Compare Source
This is a patch release that:
Fixes an issue where
DART_VM_OPTIONSwere not correctly parsed forstandalone Dart executables created with
dart compile exe(issue#55818).
Fixes a bug in dart2wasm that can result in a runtime error that says
array.new_fixed()has a constant larger than 10000 (issue #55873).Adds support for
--enable-experimentflag todart compilewasm(issue #55894).
Fixes an issue in dart2wasm compiler that can result in incorrect
nullability of type parameter (see #55895).
Disallows
dart:ffiimports in user code in dart2wasm (e.g. issue[#53910]) as dart2wasm's currently only supports a small subset of
dart:ffi(issue #55890).v3.4.2Compare Source
This is a patch release that:
Marks
dart compile wasmas no longer experimental.Fixes two bugs in exception handling in
asyncfunctions in dart2wasm(issues #55347, #55457).
Fixes restoration of
thisvariable insync*andasyncfunctions indart2wasm.
Implements missing control flow constructs (exceptions, switch/case with
yields) in
sync*in dart2wasm (issues #51342, #51343).Fixes a bug dart2wasm compiler that surfaces as a compiler crash when indexing
lists where the compiler proofs the list to be constant and the index is
out-of-bounds (issue #55817).
v3.4.1Compare Source
This is a patch release that:
Fixes a bug in the CFE which could manifest as compilation errors of Flutter
web apps when compiled with dart2wasm (issue #55714).
Fixes a bug in the pub client, such that
dart runwill not interfere withFlutter l10n (at least for most cases) (issue #55758).
v3.4.0Compare Source
Language
Dart 3.4 makes improvements to the type analysis of conditional expressions
(
e1 ? e2 : e3), if-null expressions (e1 ?? e2), if-null assignments(
e1 ??= e2), and switch expressions (switch (e) { p1 => e1, ... }). To takeadvantage of these improvements, set your package's
SDK constraint lower bound to 3.4 or greater
(
sdk: '^3.4.0').Breaking Change #54640: The pattern context type schema for
cast patterns has been changed from
Object?to_(the unknowntype), to align with the specification. This change is not expected
to make any difference in practice.
Breaking Change #54828: The type schema used by the compiler front end
to perform type inference on the operand of a null-aware spread operator
(
...?) in map and set literals has been made nullable, to match whatcurrently happens in list literals. This makes the compiler front end behavior
consistent with that of the analyzer. This change is expected to be very low
impact.
Libraries
dart:asyncParallelWaitErrorto get some meta-information thatit can expose in its
toString, and theIterable<Future>.waitand(Future,...,Future).waitextension methods now provide that information.Should make a
ParallelWaitErroreasier to log.dart:cliwaitForis removed in 3.4.dart:ffiStruct.createandUnion.createto create struct and union viewsof the sequence of bytes stored in a subtype of
TypedData.dart:ioBreaking change #53863:
Stdouthas a new fieldlineTerminator,which allows developers to control the line ending used by
stdoutandstderr. Classes thatimplement Stdoutmust define thelineTerminatorfield. The default semantics of
stdoutandstderrare not changed.Deprecates
FileSystemDeleteEvent.isDirectory, which always returnsfalse.dart:js_interopFixes an issue with several comparison operators in
JSAnyOperatorExtensionthat were declared to return
JSBooleanbut really returnedbool. This ledto runtime errors when trying to use the return values. The implementation now
returns a
JSBooleanto align with the interface. See issue #55024 formore details.
Added
ExternalDartReferenceand related conversion functionstoExternalReferenceandtoDartObject. This is a faster alternative toJSBoxedDartObject, but with fewer safety guarantees and fewerinteroperability capabilities. See #55187 for more details.
On dart2wasm,
JSBoxedDartObjectnow is an actual JS object that wraps theopaque Dart value instead of only externalizing the value. Like the JS
backends, you'll now get a more useful error when trying to use it in another
Dart runtime.
Added
isAhelper to make type checks easier with interop types. See#54138 for more details.
dart:typed_dataBREAKING CHANGE #53218 #53785: The unmodifiable view classes for
typed data are deprecated.
To create an unmodifiable view of a typed-data object, use the
asUnmodifiableView()methods added in Dart 3.3:The reason for this change is to allow more flexibility in the implementation
of typed data, so the native and web platforms can use different strategies
to ensure that typed data has good performance.
The deprecated types will be removed in Dart 3.5.
Tools
Analyzer
Improved code completion. Fixed over 50% of completion correctness bugs,
tagged
analyzer-completion-correctnessin the issuetracker.
Support for new annotations introduced in version 1.14.0 of the meta
package.
Support for the [
@doNotSubmit][@doNotSubmit] annotation, noting that any usage of anannotated member should not be submitted to source control.
Support for the [
@mustBeConst][@mustBeConst] annotation, which indicates that anannotated parameter only accepts constant arguments.
Linter
unnecessary_library_name][unnecessary_library_name] lint.missing_code_block_language_in_doc_comment][missing_code_block_language_in_doc_comment] lint.Compilers
value
""for alldart.library.foostrings, wheredart:foois not anavailable library. Instead there will only be entries for the available
libraries, like
dart.library.core, where the value was, and still is,"true". This should have no effect onconst bool.fromEnvironment(...)orconst String.fromEnvironment(...)without adefaultValueargument, anargument which was always ignored previously. It changes the behavior of
const bool.hasEnvironment(...)on such an input, away from always beingtrueand therefore useless.DevTools
To learn more, check out the release notes for versions
2.32.0 and 2.33.0.
Pub
Dependency resolution and
dart pub outdatedwill now surface if a dependencyis affected by a security advisory, unless the advisory is listed under a
ignored_advisoriessection in thepubspec.yamlfile. To learn more aboutpub's support for security advisories, visit
dart.dev/go/pub-security-advisories.
path-dependencies insidegit-dependencies are now resolved relative to thegit repo.
All
dart pubcommands can now be run from any subdirectory of a project. Pubwill find the first parent directory with a
pubspec.yamland operaterelative it.
New command
dart pub unpackthat downloads a package from pub.dev andextracts it to a subfolder of the current directory.
This can be useful for inspecting the code, or playing with examples.
Dart Runtime
Dart VM flags and options can now be provided to any executable generated
using
dart compile exevia theDART_VM_OPTIONSenvironment variable.DART_VM_OPTIONSshould be set to a list of comma-separated flags and optionswith no whitespace. Options that allow for multiple values to be provided as
comma-separated values are not supported (e.g.,
--timeline-streams=Dart,GC,Compiler).Example of a valid
DART_VM_OPTIONSenvironment variable:Dart VM no longer supports external strings:
Dart_IsExternalString,Dart_NewExternalLatin1StringandDart_NewExternalUTF16Stringfunctions areremoved from Dart C API.
v3.3.4Compare Source
This is a patch release that:
the enclosing library's
@JSannotation were actually using the invocation'senclosing library's
@JSannotation. (issue #55430).v3.3.3Compare Source
This is a patch release that:
v3.3.2Compare Source
This is a patch release that:
of their context in the code restored from dill files, causing crashes in the
incremental compiler whenever it restored a typedef from dill such that the
typedef contained a generic function type on its right-hand side (issue
#55158).
resolved in initializers of extension types (issue #55194).
DateTime.timeZoneNameon Windows, which was checking whether current date is in the summer or
standard time rather than checking if the given moment is in the summer or
standard time (issue #55240).
v3.3.1Compare Source
This is a patch release that:
extension types would fail to compile without an
@JSannotation on thelibrary (issue #55057).
operand of an
awaitexpression, unless the extension type itself implementsFuture(issue #55095).v3.3.0Compare Source
Language
Dart 3.3 adds extension types to the language. To use them, set your
package's [SDK constraint][language version] lower bound to 3.3 or greater
(
sdk: '^3.3.0').Extension types
An extension type wraps an existing type with a different, static-only
interface. It works in a way which is in many ways similar to a class that
contains a single final instance variable holding the wrapped object, but
without the space and time overhead of an actual wrapper object.
Extension types are introduced by extension type declarations. Each
such declaration declares a new named type (not just a new name for the
same type). It declares a representation variable whose type is the
representation type. The effect of using an extension type is that the
representation (that is, the value of the representation variable) has
the members declared by the extension type rather than the members declared
by its "own" type (the representation type). Example:
The declaration
Metersis an extension type that has representation typeint. It introduces an implicit constructorMeters(int value);and agetter
int get value.mandm.valueis the very same object, butmhas type
Metersandm.valuehas typeint. The point is thatmhas the members of
Metersandm.valuehas the members ofint.Extension types are entirely static, they do not exist at run time. If
ois the value of an expression whose static type is an extension type
Ewith representation type
R, thenois just a normal object whoserun-time type is a subtype of
R, exactly like the value of an expressionof type
R. Also the run-time value ofEisR(for example,E == Ris true). In short: At run time, an extension type is erased to the
corresponding representation type.
A method call on an expression of an extension type is resolved at
compile-time, based on the static type of the receiver, similar to how
extension method calls work. There is no virtual or dynamic dispatch. This,
combined with no memory overhead, means that extension types are zero-cost
wrappers around their representation value.
While there is thus no performance cost to using extension types, there is
a safety cost. Since extension types are erased at compile time, run-time
type tests on values that are statically typed as an extension type will
check the type of the representation object instead, and if the type check
looks like it tests for an extension type, like
is Meters, it actuallychecks for the representation type, that is, it works exactly like
is intat run time. Moreover, as mentioned above, if an extension type is used as
a type argument to a generic class or function, the type variable will be
bound to the representation type at run time. For example:
Extension types are useful when you are willing to sacrifice some run-time
encapsulation in order to avoid the overhead of wrapping values in
instances of wrapper classes, but still want to provide a different
interface than the wrapped object. An example of that is interop, where you
may have data that are not Dart objects to begin with (for example, raw
JavaScript objects when using JavaScript interop), and you may have large
collections of objects where it's not efficient to allocate an extra object
for each element.
Other changes
Breaking Change #54056: The rules for private field promotion have
been changed so that an abstract getter is considered promotable if there are
no conflicting declarations. There are no conflicting declarations if
there are no non-final fields, external fields, concrete getters, or
noSuchMethodforwarding getters with the same name in the same library.This makes the implementation more consistent and allows
type promotion in a few rare scenarios where it wasn't previously allowed.
It is unlikely, but this change could cause a breakage by changing
an inferred type in a way that breaks later code. For example:
Affected code can be fixed by adding an explicit type annotation.
For example, in the above snippet,
var xcan be changed toint? x.It's also possible that some continuous integration configurations might fail
if they have been configured to treat warnings as errors, because the expanded
type promotion could lead to one of the following warnings:
unnecessary_non_null_assertionunnecessary_castinvalid_null_aware_operatorThese warnings can be addressed in the usual way, by removing the unnecessary
operation in the first two cases, or changing
?.to.in the third case.To learn more about other rules surrounding type promotion,
check out the guide on Fixing type promotion failures.
Libraries
dart:coreString.fromCharCodesnow allowstartandendto be after the end ofthe
Iterableargument, just likeskipandtakedoes on anIterable.dart:ffi@Nativecan now be used on fields.Native.addressOf.elementAtpointer arithmetic extension methods oncore
Pointertypes are now deprecated.Migrate to the new
-and+operators instead.@FfiNativeannotation has been removed.Usages should be updated to use the
@Nativeannotation.dart:js_interoplike
JSAnywere previously represented using a custom erasure of@staticInteroptypes that were compiler-specific. They are now representedas extension types where their representation types are compiler-specific.
This means that user-defined
@staticInteroptypes that implementedJSAnyor
JSObjectcan no longer do so and need to useJSObject.fromInteropObject. Going forward, it's recommended to use extensiontypes to define interop APIs. Those extension types can still implement JS
types.
JSArrayandJSPromiseare now generictypes whose type parameter is a subtype of
JSAny?. Conversions to and fromthese types are changed to account for the type parameters of the Dart or JS
type, respectively.
dart:js_interopextensionmembers are moved to different extensions on the same type or a supertype to
better organize the API surface. See
JSAnyUtilityExtensionandJSAnyOperatorExtensionfor the new extensions. This shouldn't make adifference unless the extension names were explicitly used.
importModuleto allow users to dynamically import modules using the JSimport()expression.dart:js_interop_unsafehashelper to makehasPropertycalls more concise.dart:typed_dataBREAKING CHANGE (https://github.com/dart-lang/sdk/issues/53218) The
unmodifiable view classes for typed data are deprecated. Instead of using the
constructors for these classes to create an unmodifiable view, e.g.
use the new
asUnmodifiableView()methods:The reason for this change is to allow more flexibility in the implementation
of typed data so the native and web platforms can use different strategies
for ensuring typed data has good performance.
The deprecated types will be removed in a future Dart version.
dart:nativewrappersbasesothat none of their subtypes can be implemented. Implementing subtypes can lead
to crashes when passing such native wrapper to a native call, as it will try
to unwrap a native field that doesn't exist.
Tools
Dart command line
dart createcommand now uses v3 ofpackage:lints,including multiple new recommended lints by default.
To learn more about the updated collection of lints,
check out the
package:lints3.0.0 changelog entry.DevTools
To learn more, check out the release notes for versions
2.29.0, 2.30.0,
and 2.31.0.
Wasm compiler (dart2wasm)
dart:js_util,package:js, anddart:jsare now disallowed from being imported when compiling with
dart2wasm. Preferusing
dart:js_interopanddart:js_interop_unsafe.Development JavaScript compiler (DDC)
Type arguments of
package:jsinterop types are now printed asanyinsteadof being omitted. This is simply a change to the textual representation of
package js types that have type arguments. These type arguments are still
completely ignored by the type system at runtime.
Removed "implements <...>" text from the Chrome custom formatter display for
Dart classes. This information provides little value and keeping it imposes an
unnecessary maintenance cost.
Production JavaScript compiler (dart2js)
The
Invocationthat is passed tonoSuchMethodwill no longer have aminified
memberName, even when dart2js is invoked with--minify.See #54201 for more details.
Analyzer
pubspec.yamlfiles byadding an
# ignore: <diagnostic_id>comment.dart doccomment directives are now reported.flutter_style_todos][flutter_style_todos] lint now has a quick fix.Linter
iterable_contains_unrelated_typeandlist_remove_unrelated_typelints.Consider migrating to the expanded
[
collection_methods_unrelated_type][collection_methods_unrelated_type] lint.always_require_non_null_named_parametersavoid_returning_null,avoid_returning_null_for_futurev3.2.6Compare Source
v3.2.5Compare Source
Configuration
📅 Schedule: Branch creation - "after 4pm on friday,before 9am on monday,every weekend" in timezone Europe/Paris, 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.