Pretty up the CHANGELOG in anticipation of 2.8.0.

The changes are mainly:

- Add a brief intro section.

- Fix indentation to make Markdown happy. In particular, +4 is needed
  for nested lists to format correctly.

- Do a little copy-editing on the text. Mostly changing future tense to
  present tense.

- Merge the two dart2js sections together.

- Change some inline links to reference links since those are a little
  easier on the eyes.

Change-Id: I72f4d3a4f74d7b83afa8d02dd95589aeddc613d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140771
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
This commit is contained in:
Robert Nystrom 2020-03-25 18:24:02 +00:00 committed by commit-bot@chromium.org
parent 9e4eb054a4
commit 113c4e1793

View file

@ -1,330 +1,296 @@
## Next release ## 2.8.0
(Add new changes here, and they will be copied to the change section for the
next release) Much of the changes in this release are in preparation for non-nullable types,
which will arrive in a future version. In anticipation of that, we have made a
number of small but technically breaking changes to several core library APIs in
order to make them easier to use in a world with non-nullable types. Almost all
existing Dart code will be unaffected by these changes, but if you see
unexpected failures, note the breaking changes listed below.
### Language ### Language
There are no language changes in this release.
### Core libraries ### Core libraries
#### `dart:async` #### `dart:async`
* Make stack traces non-null. Where methods like `completer.completeError` * Make stack traces non-null. Where methods like `completer.completeError()`
allows omitting a stack trace, the platform will now insert a default allow omitting a stack trace, the platform will now insert a default stack
stack trace rather than propagate a `null` value. trace rather than propagate a `null` value.
Error handling functions need no longer be prepared for `null` stack traces.
* **Breaking change**: [#40681](https://github.com/dart-lang/sdk/issues/40681) Error handling functions need no longer be prepared for `null` stack traces.
The `runZoned` function is split into two functions: `runZoned` and
`runZonedGuarded`, where the latter has a required `onError` parameter, * **Breaking change** [#40681][]: The `runZoned()` function is split into two
and the former has none. functions: `runZoned()` and `runZonedGuarded()`, where the latter has a
This prepares the functions for Null Safety where the two functions will required `onError` parameter, and the former has none. This prepares the
differ in the nullability of their return types. functions for Null Safety where the two functions will differ in the
nullability of their return types.
[#40681]: https://github.com/dart-lang/sdk/issues/40681
#### `dart:core` #### `dart:core`
* Adds `StackTrace.empty` constant which is the stack trace used as default * Adds `StackTrace.empty` constant which is the stack trace used as default
stack trace when no better alternative is available. stack trace when no better alternative is available.
* The class `TypeError` no longer extends `AssertionError`. * The class `TypeError` no longer extends `AssertionError`. This also means
This also means that it no longer inherits the spurious `message` getter that it no longer inherits the spurious `message` getter which was added to
which was added to `AssertionError` when the second operand to `assert` `AssertionError` when the second operand to `assert` was allowed. The value
was allowed. The value of that getter on a `TypeError` was the same of that getter on a `TypeError` was the same string as returned by
string as returned by `toString`, so it is still available. `toString()`, so it is still available.
* `ArgumentError.checkNotNull` and the `RangeError` static methods
`checkValueInInterval`, `checkValidIndex` and `checkNotNegative` * `ArgumentError.checkNotNull()` and the `RangeError` static methods
all return their first argument on success. `checkValueInInterval()`, `checkValidIndex()` and `checkNotNegative()` all
This makes these functions more convenient to use in-line in, return their first argument on success. This makes these functions more
for example, `=>` function bodies or constructor initialization lists. convenient to use in-line in, for example, `=>` function bodies or
constructor initialization lists.
#### `dart:developer` #### `dart:developer`
* The constructors for `TimelineTask` now accept an optional `filterKey` * The constructors for `TimelineTask` now accept an optional `filterKey`
parameter. If provided, the arguments for all events associated with the task parameter. If provided, the arguments for all events associated with the
will contain an entry named `filterKey`, set to the value of the `filterKey` task will contain an entry named `filterKey`, set to the value of the
parameter provided in the constructor. This will be used by tooling to allow `filterKey` parameter provided in the constructor. This will be used by
for better filtering of timeline events. tooling to allow for better filtering of timeline events.
#### `dart:html` #### `dart:html`
* **Breaking Change**: Changed the return type of several html native methods * **Breaking Change** [#39627][]: Changed the return type of several HTML
involving Futures. In return types that matched Future<List<T>>, T was changed native methods involving futures. In return types that matched
to `dynamic`. These methods would have resulted in a runtime error if they were `Future<List<T>>`, `T was` changed to `dynamic`. These methods would have
used (see Issue [39627][]). resulted in a runtime error if they were used.
[39627]: https://github.com/dart-lang/sdk/issues/39627 * **Breaking Change**: `Node.insertAllBefore()` erroneously had a return type
of `Node`, even though it was not returning anything. This has been
corrected to `void`.
* **Breaking Change**: `Node.insertAllBefore` erroneously had a return type of [#39627]: https://github.com/dart-lang/sdk/issues/39627
`Node`, even though it was not returning anything. This has been corrected to
`void`.
#### `dart:io` #### `dart:io`
* Class `HttpParser` will no longer throw an exception when a HTTP response * Class `HttpParser` will no longer throw an exception when a HTTP response
status code is within [0, 999]. Customized status codes in this range are now status code is within [0, 999]. Customized status codes in this range are
valid. now valid.
* **Breaking change** [#33501](https://github.com/dart-lang/sdk/issues/33501): * **Breaking change** [#33501][]: The signature of `HttpHeaders` methods
This is breaking only for classes extending or implementing `HttpHeaders` and `add()` and `set` have been changed to:
having their own `add` or `set` methods without the `bool preserveHeaderCase`
named parameter. The signature of `add` and `set` has been changed to
```dart ```dart
void add(String name, Object value, {bool preserveHeaderCase: false}) void add(String name, Object value, {bool preserveHeaderCase: false})
void set(String name, Object value, {bool preserveHeaderCase: false}) void set(String name, Object value, {bool preserveHeaderCase: false})
``` ```
Setting `preserveHeaderCase` to `true` will preserve the case of the `name` Setting `preserveHeaderCase` to `true` preserves the case of the `name`
parameter instead of converting it to lowercase. The `HttpHeader.forEach()` parameter instead of converting it to lowercase. The `HttpHeader.forEach()`
method provides the current case of each header. method provides the current case of each header.
* **Breaking change** [#40702](https://github.com/dart-lang/sdk/issues/40702): This is breaking only for classes extending or implementing `HttpHeaders`
The `Socket` class will now throw a `SocketException` if the socket has been and having their own `add` or `set` methods without the `bool
explicitly destroyed or upgraded to a secure socket upon setting or getting preserveHeaderCase` named parameter.
socket options. Previously setting a socket option would be ignored and
getting a socket option would return `null`.
* **Breaking change** [#40483](https://github.com/dart-lang/sdk/issues/40483): * **Breaking change** [#40702][]: The `Socket` class now throws a
The `Process` class will now throw a `StateError` if the process is detached `SocketException` if the socket has been explicitly destroyed or upgraded to
(`ProcessStartMode.detached` and `ProcessStartMode.detachedWithStdio`) upon a secure socket upon setting or getting socket options. Previously, setting
accessing the `exitCode` getter. It now also throws when not connected to the a socket option would be ignored and getting a socket option would return
child process's stdio (`ProcessStartMode.detached` and `null`.
`ProcessStartMode.inheritStdio`) upon accessing the `stdin`, `stdout`, and
`stderr` getters. Previously these getters would all return `null`.
* **Breaking change** [#40706](https://github.com/dart-lang/sdk/issues/40706): * **Breaking change** [#40483][]: The `Process` class now throws a
The dummy object returned if `FileStat.stat()` and `FileStat.statSync()` fail `StateError` if the process is detached (`ProcessStartMode.detached` and
now contains Unix epoch timestamps instead of `null` for the `accessed`, `ProcessStartMode.detachedWithStdio`) upon accessing the `exitCode` getter.
`changed`, and `modified` getters. It now also throws when not connected to the child process's stdio
(`ProcessStartMode.detached` and `ProcessStartMode.inheritStdio`) upon
accessing the `stdin`, `stdout`, and `stderr` getters. Previously, these
getters would all return `null`.
* **Breaking change** [#40709](https://github.com/dart-lang/sdk/issues/40709): * **Breaking change** [#40706][]: The dummy object returned if
The `HeaderValue` class now parses more strictly in two invalid edge cases. `FileStat.stat()` or `FileStat.statSync()` fail now contains Unix epoch
This is the class used to parse the semicolon delimited parameters used in the timestamps instead of `null` for the `accessed`, `changed`, and `modified`
`Accept`, `Authorization`, `Content-Type`, and other such HTTP headers. getters.
The empty parameter value without double quotes (which is not allowed by the * **Breaking change** [#40709][]: The `HeaderValue` class now parses more
standards) is now parsed as the empty string rather than `null`. E.g. strictly in two invalid edge cases. This is the class used to parse the
`HeaderValue.parse("v;a=").parameters` now gives `{"a": ""}` rather than semicolon delimited parameters used in the `Accept`, `Authorization`,
`{"a": null}`. `Content-Type`, and other such HTTP headers.
Invalid inputs with unbalanced double quotes are now rejected. E.g. The empty parameter value without double quotes (which is not allowed by the
`HeaderValue.parse('v;a="b').parameters` will now throw a `HttpException` standards) is now parsed as the empty string rather than `null`. E.g.
instead of giving `{"a": "b"}`. `HeaderValue.parse("v;a=").parameters` now gives `{"a": ""}` rather than
`{"a": null}`.
* The `HeaderValue.toString()` method now supports parameters with `null` values Invalid inputs with unbalanced double quotes are now rejected. E.g.
by omitting the value. `HeaderValue("v", {"a": null, "b": "c"}).toString()` `HeaderValue.parse('v;a="b').parameters` will now throw a `HttpException`
now gives `v; a; b=c`. This behavior can be used to implement some features in instead of giving `{"a": "b"}`.
the `Accept` and `Sec-WebSocket-Extensions` headers.
Likewise the empty value and values using characters outside of * The `HeaderValue.toString()` method now supports parameters with `null`
[RFC 7230 tokens](https://tools.ietf.org/html/rfc7230#section-3.2.6) are now values by omitting the value. `HeaderValue("v", {"a": null, "b":
correctly implemented by double quoting such values with escape sequences. "c"}).toString()` now gives `v; a; b=c`. This behavior can be used to
E.g: implement some features in the `Accept` and `Sec-WebSocket-Extensions`
headers.
```dart Likewise the empty value and values using characters outside of [RFC 7230
HeaderValue("v", tokens][] are now correctly implemented by double quoting such values with
{"a": "A", "b": "(B)", "c": "", "d": "ø", "e": "\\\""}).toString() escape sequences. For example:
```
now gives `v;a=A;b="(B)";c="";d="ø";e="\\\""`. ```dart
HeaderValue("v",
{"a": "A", "b": "(B)", "c": "", "d": "ø", "e": "\\\""}).toString()
```
* [Unix domain sockets](https://en.wikipedia.org/wiki/Unix_domain_socket) are Gives: `v;a=A;b="(B)";c="";d="ø";e="\\\""`.
now supported on Linux, Android and MacOS, which can be used by passing a
`InternetAddress` of `InternetAddressType.Unix` into `connect`, `startConnect`
and `bind` methods. `port` argument in those methods will be ignored. Getter
of `port` will always return 0 for Unix domain sockets.
* Class `InternetAddressType` gains one more option `Unix`, which represents a * [Unix domain sockets][] are now supported on Linux, Android and MacOS, which
Unix domain address. can be used by passing a `InternetAddress` of `InternetAddressType.Unix`
into the `connect()`, `startConnect()` and `bind()` methods. The `port`
argument in those methods will be ignored. The `port` getter always returns
0 for Unix domain sockets.
* Class `InternetAddress`: * Class `InternetAddressType` gains one more option `Unix`, which represents a
* `InternetAddress` constructor gains an optional `type` parameter. To create Unix domain address.
a Unix domain address, `type` is set to `InternetAddressType.Unix` and
`address` is a file path.
* `InternetAddress` gains a new constructor `fromRawAddress` that takes an
address in byte format for Internet addresses or raw file path for Unix
domain addresses.
* **Breaking change** [#40681](https://github.com/dart-lang/sdk/issues/40681) * Class `InternetAddress`:
The static method `runZoned` and `runWithHttpOverrides` on `HttpOverrides`
no longer accept `zoneSpecification` and `onError` parameters.
Use the `runZoned` or `runZonedGuarded` functions from `dart:async`
directly if needing to specify those.
* **Breaking change** [#40681](https://github.com/dart-lang/sdk/issues/40681) * `InternetAddress` constructor gains an optional `type` parameter. To
The static method `runZoned` and `runWithIOOverrides` on `IOOverrides` create a Unix domain address, `type` is set to
no longer accept `zoneSpecification` and `onError` parameters. `InternetAddressType.Unix` and `address` is a file path.
Use the `runZoned` or `runZonedGuarded` functions from `dart:async`
directly if needing to specify those. * `InternetAddress` gains a new constructor `fromRawAddress()` that takes
an address in byte format for Internet addresses or raw file path for
Unix domain addresses.
* **Breaking change** [#40681][]: The static methods `runZoned()` and
`runWithHttpOverrides()` on `HttpOverrides` no longer accept
`zoneSpecification` and `onError` parameters. Use the `runZoned()` or
`runZonedGuarded()` functions from `dart:async` directly if needing to
specify those.
* **Breaking change** [#40681][]: The static method `runZoned()` and
`runWithIOOverrides` on `IOOverrides` no longer accepts `zoneSpecification`
and `onError` parameters. Use the `runZoned()` or `runZonedGuarded()`
functions from `dart:async` directly if needing to specify those.
[#33501]: https://github.com/dart-lang/sdk/issues/33501
[#40702]: https://github.com/dart-lang/sdk/issues/40702
[#40483]: https://github.com/dart-lang/sdk/issues/40483
[#40706]: https://github.com/dart-lang/sdk/issues/40706
[#40709]: https://github.com/dart-lang/sdk/issues/40709
[RFC 7230 tokens]: https://tools.ietf.org/html/rfc7230#section-3.2.6
[Unix domain sockets]: https://en.wikipedia.org/wiki/Unix_domain_socket
#### `dart:mirrors` #### `dart:mirrors`
* Added `MirrorSystem.neverType`. * Added `MirrorSystem.neverType`.
### Dart VM ### Dart VM
* Added `Dart_TypeDynamic`, `Dart_TypeVoid` and `Dart_TypeNever`. Type dynamic * Added `Dart_TypeDynamic`, `Dart_TypeVoid` and `Dart_TypeNever`. Type
can no longer by reached by `Dart_GetType(dart:core, dynamic)`. `dynamic` can no longer by reached using `Dart_GetType(dart:core, dynamic)`.
* Added the following methods to the VM embedding API:
* `Dart_GetNonNullableType` * Added the following methods to the VM embedding API:
* `Dart_GetNullableType`
* `Dart_TypeToNonNullable` * `Dart_GetNonNullableType()`
* `Dart_TypeToNullable` * `Dart_GetNullableType()`
* `Dart_IsLegacyType` * `Dart_TypeToNonNullable()`
* `Dart_IsNonNullableType` * `Dart_TypeToNullable()`
* `Dart_IsNullableType` * `Dart_IsLegacyType()`
* `Dart_IsNonNullableType()`
* `Dart_IsNullableType()`
### Foreign Function Interface (`dart:ffi`) ### Foreign Function Interface (`dart:ffi`)
* **Breaking Change**: `Pointer.asFunction` and `DynamicLibrary.lookupFunction` * **Breaking Change**: Changed `Pointer.asFunction()` and
changed to extension methods. Invoking them dynamically previously already `DynamicLibrary.lookupFunction()` to extension methods. Invoking them
threw an Exception, so runtime behavior stays the same. However, the dynamically previously already threw an exception, so the runtime behavior
extension methods are only visible if `dart:ffi` is imported directly. So stays the same. However, the extension methods are only visible if
this breaks code where `dart:ffi` is not directly imported. Fix: add an `dart:ffi` is imported directly. This breaks code where `dart:ffi` is not
import of `dart:ffi`. directly imported. To fix, add:
```dart
import 'dart:ffi';
```
### Tools ### Tools
#### Dart Dev Compiler (DDC) #### Dart Dev Compiler (DDC)
* **Breaking Change**: Deleted the legacy (analyzer based) version of DDC. For We fixed several inconsistencies between DDC and Dart2JS so that users less
additional details see the [announcement]. frequently encounter code that is accepted by one compiler but then fails in the
* The `--kernel` option is now ignored and defaults to true. There is no other.
longer any way to invoke the legacy (analyzer based) version of DDC.
* Command line arguments that were only used for the legacy DDC have been
removed.
* The pre-compiled ddc_sdk.js artifacts generated by legacy DDC have
been deleted from `dart-sdk/lib/dev_compiler` in favor of the versions
located at `dart-sdk/lib/dev_compiler/kernel`.
* **Breaking Change**: Functions passed to JavaScript using the recommended
`package:js` interop specification must now be wrapped with a call to
`allowInterop`. This behavior was always enforced by `dart2js`, but was not
enforced consistently in `ddc`. It will now be enforced in both.
* **Breaking Change**: Constructors in `@JS()` classes must be marked with
`external`. Previously the external could be omitted in some cases with DDC
but doing so would cause incorrect behavior with `dart2js`.
* JS interop classes with an index operator are now static errors.
* All remaining support from the `dart:mirrors` library has been removed.
Use of this library on the web has been unsupported and prevented by the Dart
build systems since Dart v2.0.0. All known exception cases have been cleaned
up. This change makes DDC and dart2js now behave consistently.
The library can still be imported on web apps, but all APIs throw. In a future * **Breaking Change**: Deleted the legacy (analyzer based) version of DDC. For
breaking change release, imports to this library will likely become a additional details see the [announcement][ddc].
compile-time error.
[announcement]: https://github.com/dart-lang/sdk/issues/38994 * The `--kernel` option is now ignored and defaults to true. There is no
longer any way to invoke the legacy (analyzer based) version of DDC.
* Command line arguments that were only used for the legacy DDC have been
removed.
* The pre-compiled `dart_sdk.js` artifacts generated by legacy DDC have
been deleted from `dart-sdk/lib/dev_compiler` in favor of the versions
located at `dart-sdk/lib/dev_compiler/kernel`.
* **Breaking Change**: Functions passed to JavaScript using the recommended
`package:js` interop specification must now be wrapped with a call to
`allowInterop`. This behavior was always enforced by Dart2JS, but was not
enforced consistently by DDC. It is now enforced by both.
* **Breaking Change**: Constructors in `@JS()` classes must be marked with
`external`. Previously the `external` could be omitted in some cases with
DDC but doing so would cause incorrect behavior with Dart2JS.
* JS interop classes with an index operator are now static errors.
* All remaining support from the `dart:mirrors` library has been removed. Use
of this library on the web has been unsupported and prevented by the Dart
build systems since Dart v2.0.0. All known exception cases have been cleaned
up. This change makes DDC and Dart2JS now behave consistently.
The library can still be imported on web apps, but all APIs throw. In a
future breaking change release, imports to this library will likely become a
compile-time error.
[ddc]: https://github.com/dart-lang/sdk/issues/38994
#### Dart2JS #### Dart2JS
* JS interop classes with an index operator are now static errors instead of A new representation of runtime types is enabled by default.
causing invalid code in dart2js.
* **Breaking Change**: The subtyping rule for generic functions is now more
forgiving. Corresponding type parameter bounds now only need to be mutual
subtypes rather than structurally equal up to renaming of bound type variables
and equating all top types.
* **Breaking Change**: Types are now normalized. See [normalization] for the
full specification. Types will now be printed in their normal form, and
mutual subtypes with the same normal form will now be considered equal.
* **Breaking Change**: Constructors in `@JS()` classes must be marked with
`external`. Previously the external could be omitted for unused constructors.
Omitting `external` for a constructor which is used would cause incorrect
behavior at runtime, now omitting it on any constructor is a static error.
[normalization]: https://github.com/dart-lang/language/blob/master/resources/type-system/normalization.md
#### Linter
The Linter was updated to `0.1.113`, which includes:
* updated documentation links
* `one_member_abstracts` updated to not lint classes with mixins or implementing interfaces
* `unnecessary_getters_setters` fixed to ignore cases where a getter/setter is deprecated
* new lint: `leading_newlines_in_multiline_strings`
* improved highlight ranges for `avoid_private_typedef_functions` and `avoid_returning_null_for_future`
#### Analyzer
* Removed support for the deprecated analysis options file name `.analysis_options`.
#### Pub
* Added `pub outdated` command which lists outdated package dependencies, and
gives advice on how to upgrade.
* `pub get` and `pub upgrade` now fetches version information about hosted
dependencies in parallel, improving the time package resolution performance.
* `pub get` and `pub upgrade` no longer precompiles executables from
dependencies by default. Instead they are precompiled on first `pub run`.
Use `pub get --precompile` to get the previous behavior.
* Fixed missing retries of DNS failures during `pub get`.
* Importing packages not in `pubspec.yaml` now causes `pub publish` to reject
the package.
* `pub publish` no longer requires the presence of a `homepage` field, if the
`repository` field is provided.
* `pub publish` will now warn if non-pre-release packages depends on pre-release
packages or pre-release Dart SDKs.
* Relative paths in `pubspec.lock` are now using `/` also on Windows to make
the file sharable between machines.
* Fixed language version in [`.dart_tool/package_config.json`](https://github.com/dart-lang/language/blob/master/accepted/future-releases/language-versioning/package-config-file-v2.md)
for packages without an explicit sdk constraint.
Now writes an empty language-version while before the language version of the
current sdk would be used.
* `%LOCALAPPDATA%` is now preferred over `%APPDATA%` when creating a pub cache
directory on Windows. `%LOCALAPPDATA%` is not copied when users roam between
devices.
* `pub publish` warns if LICENSE and README.md files are not called those exact
names.
* `pub repair cache` downloads hosted packages in parallel.
#### dart2js
A new representation of runtime types was enabled by default.
This change is part of a long term goal of making runtime checks cheaper and This change is part of a long term goal of making runtime checks cheaper and
more flexible for upcoming changes in the language. The new representation more flexible for upcoming changes in the language. The new representation
disentangles how types and classes are represented and makes types first-class disentangles how types and classes are represented and makes types first-class
to the compiler. This makes it possible to do certain kind of optimizations on to the compiler. This makes it possible to do certain kind of optimizations on
type checks that were not possible before and will enable us to model type checks that were not possible before and will enable us to model
non-nullable types in the near future. non-nullable types in the near future.
This change should not affect the semantics of your application, but it has some This change should not affect the semantics of your application, but it has some
relatively small visible effects that we want to highlight: relatively small visible effects that we want to highlight:
* Types are now canonicalized, this fixes a long standing bug that Types could * Types are now canonicalized, this fixes a long standing bug that Types could
not be used in switch cases (issue [17207][]). not be used in switch cases (issue [17207][]).
* Code-size changes may be visible, but the difference is small overall. It is * Code-size changes may be visible, but the difference is small overall. It is
more visible on smaller apps because the new implementation includes more more visible on smaller apps because the new implementation includes more
helper methods. On large apps we have even seen an overall code-size helper methods. On large apps we have even seen an overall code-size
reduction. reduction.
* Certain checks are a lot faster. This is less noticeable if you are compiling * Certain checks are a lot faster. This is less noticeable if you are
apps with `-O3` where checks are omitted altogether. Even with `-O3`, the compiling apps with `-O3` where checks are omitted altogether. Even with
performance of some `is` checks used by your app may improve. `-O3`, the performance of some `is` checks used by your app may improve.
* When using `-O3` and `-O4` incorrect type annotations could surface as errors. * When using `-O3` and `-O4` incorrect type annotations could surface as
The old type representation was accidentally lenient on some invalid type errors. The old type representation was accidentally lenient on some invalid
annotations. We have only encountered this issue on programs that were not type annotations. We have only encountered this issue on programs that were
tested properly at the js-interop program boundary. not tested properly at the js-interop program boundary.
* `Type.toString` has a small change that is rarely visible. For a long time * `Type.toString()` has a small change that is rarely visible. For a long
dart2js has had support to erase unused type variables. Today, when dart2js is time, Dart2JS has had support to erase unused type variables. Today, when
given `--lax-runtime-type-to-string` (currently included in `-O2`, `-O3`, and Dart2JS is given `--lax-runtime-type-to-string` (currently included in
`-O4`) and it decides to erase the type variable of a class `Foo<T>`, then it `-O2`, `-O3`, and `-O4`) and it decides to erase the type variable of a
compiles expressions like `foo.runtimeType.toString()` to print `Foo`. With class `Foo<T>`, then it compiles expressions like
the new representation, this will show `Foo<erased>` instead. This change may `foo.runtimeType.toString()` to print `Foo`. With the new representation,
be visible in error messages produced by type checks involving erased types. this will show `Foo<erased>` instead. This change may be visible in error
messages produced by type checks involving erased types.
Because types and classes are represented separately, we will likely reevaluate Because types and classes are represented separately, we will likely reevaluate
restrictions of deferred libraries in the near future. For example, we could restrictions of deferred libraries in the near future. For example, we could
@ -333,23 +299,104 @@ classes are not.
In the unlikely case you run into any issues, please file a bug so we can In the unlikely case you run into any issues, please file a bug so we can
investigate. You can temporarily force the old type representation by passing investigate. You can temporarily force the old type representation by passing
`--use-old-rti` to dart2js if necessary, but our goal is to delete the old type `--use-old-rti` to Dart2JS if necessary, but our goal is to delete the old type
representation soon. representation soon.
In addition, we fixed some inconsistencies between Dart2JS and DDC:
* JS interop classes with an index operator are now static errors instead of
causing invalid code in Dart2JS.
* **Breaking Change**: The subtyping rule for generic functions is now more
forgiving. Corresponding type parameter bounds now only need to be mutual
subtypes rather than structurally equal up to renaming of bound type
variables and equating all top types.
* **Breaking Change**: Types are now normalized. See [normalization] for the
full specification. Types will now be printed in their normal form, and
mutual subtypes with the same normal form will now be considered equal.
* **Breaking Change**: Constructors in `@JS()` classes must be marked with
`external`. Previously, the external could be omitted for unused
constructors. Omitting `external` for a constructor which is used would
cause incorrect behavior at runtime, now omitting it on any constructor is a
static error.
[17207]: https://github.com/dart-lang/sdk/issues/17207 [17207]: https://github.com/dart-lang/sdk/issues/17207
[normalization]: https://github.com/dart-lang/language/blob/master/resources/type-system/normalization.md
#### Linter
Updated the Linter to `0.1.113`, which includes:
* Updated documentation links.
* Updated `one_member_abstracts` to not lint classes with mixins or
implementing interfaces.
* Fixed `unnecessary_getters_setters` to ignore cases where a getter/setter is
deprecated.
* Added `leading_newlines_in_multiline_strings`.
* Improved highlight ranges for `avoid_private_typedef_functions` and
`avoid_returning_null_for_future`.
#### Analyzer
* Removed support for the deprecated analysis options file name
`.analysis_options`.
#### Pub
* Added `pub outdated` command which lists outdated package dependencies, and
gives advice on how to upgrade.
* `pub get` and `pub upgrade` now fetch version information about hosted
dependencies in parallel, improving the time package resolution performance.
* `pub get` and `pub upgrade` no longer precompile executables from
dependencies by default. Instead they are precompiled on first `pub run`.
Use `pub get --precompile` to get the previous behavior.
* Fixed missing retries of DNS failures during `pub get`.
* If code contains imports for packages not listed in the package's
`pubspec.yaml` then `pub publish` will reject the package.
* `pub publish` no longer requires the presence of a `homepage` field, if the
`repository` field is provided.
* `pub publish` warns if non-pre-release packages depends on pre-release
packages or pre-release Dart SDKs.
* Relative paths in `pubspec.lock` now use `/` also on Windows to make the
file sharable between machines.
* Fixed language version in [`.dart_tool/package_config.json`][package config]
for packages without an explicit SDK constraint. Pub now writes an empty
language version where before the language version of the current SDK would
be used.
* `%LOCALAPPDATA%` is now preferred over `%APPDATA%` when creating a pub cache
directory on Windows. `%LOCALAPPDATA%` is not copied when users roam between
devices.
* `pub publish` warns if LICENSE and README.md files are not called those
exact names.
* `pub repair cache` downloads hosted packages in parallel.
[package config]: https://github.com/dart-lang/language/blob/master/accepted/future-releases/language-versioning/package-config-file-v2.md
## 2.7.2 - 2020-03-23 ## 2.7.2 - 2020-03-23
This is a patch release that addresses a vulnerability in `dart:html` This is a patch release that addresses a vulnerability in `dart:html`
[NodeValidator](https://api.dart.dev/stable/dart-html/NodeValidator-class.html) [NodeValidator][] related to DOM clobbering of `previousSibling`. See the
related to DOM clobbering of `previousSibling`. See the [vulnerability advisory][CVE-2020-8923] for more details. Thanks to **Vincenzo
[vulnerability advisory][CVE-2020-8923] for more details. Thanks to di Cicco** for finding and reporting this issue.
**Vincenzo di Cicco** for finding and reporting this issue.
This release also improves compatibility with ARMv8 processors This release also improves compatibility with ARMv8 processors (issue [40001][])
(issue [40001][]) and dart:io stability (issue [40589][]). and dart:io stability (issue [40589][]).
[NodeValidator]: https://api.dart.dev/stable/dart-html/NodeValidator-class.html
[CVE-2020-8923]: https://github.com/dart-lang/sdk/security/advisories/GHSA-hfq3-v9pv-p627 [CVE-2020-8923]: https://github.com/dart-lang/sdk/security/advisories/GHSA-hfq3-v9pv-p627
[40001]: https://github.com/dart-lang/sdk/issues/40001 [40001]: https://github.com/dart-lang/sdk/issues/40001
[40589]: https://github.com/dart-lang/sdk/issues/40589 [40589]: https://github.com/dart-lang/sdk/issues/40589