'Michael Thomsen' via Dart Announcements
2017-06-13 13:12:38 UTC
Check out the announcement
<http://news.dartlang.org/2017/06/dart-124-faster-edit-refresh-cycle-on.html> and
the changelog
<https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#1240>!
Kind regards, the Dart team
-----
1.24.0
<https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#language-1>
Language
-
During a dynamic type check, void is not required to be null anymore. In
practice, this makes overriding voidfunctions with non-void functions
safer.
-
During static analysis, a function or setter declared using => with
return type void now allows the returned expression to have any type.
For example, assuming the declaration int x;, it is now type correct to
have void f() => ++x;.
-
A new function-type syntax has been added to the language. Intuitively,
the type of a function can be constructed by textually replacing the
function's name with Function in its declaration. For instance, the type
of void foo() {} would be void Function(). The new syntax may be used
wherever a type can be written. It is thus now possible to declare fields
containing functions without needing to write typedefs: void Function()
x;. The new function type has one restriction: it may not contain the
old-style function-type syntax for its parameters. The following is thus
illegal: void Function(int f()). typedefs have been updated to support
this new syntax.
Examples:
typedef F = void Function(); // F is the name for a `void` callback.int Function(int) f; // A field `f` that contains an int->int function.
class A<T> {
// The parameter `callback` is a function that takes a `T` and returns
// `void`.
void forEach(void Function(T) callback);
}
// The new function type supports generic arguments.typedef Invoker = T Function<T>(T Function() callback);
<https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#core-library-changes-1>Core
library changes
-
dart:async, dart:core, dart:io
- Adding to a closed sink, including IOSink, is no longer not allowed.
In 1.24, violations are only reported (on stdout or stderr), but a future
version of the Dart SDK will change this to throwing a StateError.
-
dart:convert
- BREAKING Removed the deprecated ChunkedConverter class.
- JSON maps are now typed as Map<String, dynamic> instead of Map<dynamic,
dynamic>. A JSON-map is not a HashMap or LinkedHashMap anymore (but
just a Map).
-
dart:io
- Added Platform.localeName, needed for accessing the locale on
platforms that don't store it in an environment variable.
- Added ProcessInfo.currentRss and ProcessInfo.maxRss for inspecting
the Dart VM process current and peak resident set size.
- Added RawSynchronousSocket, a basic synchronous socket
implementation.
-
dart: web APIs have been updated to align with Chrome v50. This change
includes a large number of changes, many of which are breaking. In some
cases, new class names may conflict with names that exist in existing code.
-
dart:html
-
REMOVED classes: Bluetooth, BluetoothDevice,
BluetoothGattCharacteristic, BluetoothGattRemoteServer,
BluetoothGattService, BluetoothUuid, CrossOriginConnectEvent,
DefaultSessionStartEvent, DomSettableTokenList, MediaKeyError,
PeriodicSyncEvent, PluginPlaceholderElement, ReadableStream,
StashedMessagePort, SyncRegistration
-
REMOVED members:
- texImage2DCanvas was removed from RenderingContext.
- endClip and startClip were removed from Animation.
- after and before were removed from CharacterData, ChildNode and
Element.
- keyLocation was removed from KeyboardEvent. Use location instead.
- generateKeyRequest, keyAddedEvent, keyErrorEvent, keyMessageEvent
, mediaGroup, needKeyEvent, onKeyAdded, onKeyError, onKeyMessage,
and onNeedKey were removed from MediaElement.
- getStorageUpdates was removed from Navigator
- status was removed from PermissionStatus
- getAvailability was removed from PreElement
-
Other behavior changes:
- URLs returned in CSS or html are formatted with quoted string. Like
url("http://google.com") instead of url(http://google.com).
- Event timestamp property type changed from int to num.
- Chrome introduced slight layout changes of UI objects. In
addition many height/width dimensions are returned in subpixel values (
num instead of whole numbers).
- setRangeText with a selectionMode value of 'invalid' is no
longer valid. Only "select", "start", "end", "preserve" are allowed.
-
dart:svg
- A large number of additions and removals. Review your use of dart:svg
carefully.
-
dart:web_audio
- new method on AudioContext â createIirFilter returns a new class
IirFilterNode.
-
dart:web_gl
-
new classes: CompressedTextureAstc, ExtColorBufferFloat,
ExtDisjointTimerQuery, and TimerQueryExt.
-
ExtFragDepth added: readPixels2 and texImage2D2.
<https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#strong-mode-1>Strong
Mode
-
Removed ad hoc Future.then inference in favor of using FutureOr. Prior
to adding FutureOr to the language, the analyzer implented an ad hoc
type inference for Future.then (and overrides) treating it as if the
onValue callback was typed to return FutureOr for the purposes of
inference. This ad hoc inference has been removed now that FutureOr has
been added.
Packages that implement Future must either type the onValue parameter to
.then as returning FutureOr<T>, or else must leave the type of the
parameter entirely to allow inference to fill in the type.
-
During static analysis, a function or setter declared using => with
return type void now allows the returned expression to have any type.
<https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#tool-changes-1>Tool
Changes
-
Dartium
Dartium is now based on Chrome v50. See *Core library changes* above for
details on the changed APIs.
-
Pub
-
pub build and pub serve
-
Added support for the Dart Development Compiler.
Unlike dart2js, this new compiler is modular, which allows pub to
do incremental re-builds for pub serve, and potentially pub build in
the future.
In practice what that means is you can edit your Dart files,
refresh in Chrome (or other supported browsers), and see your edits almost
immediately. This is because pub is only recompiling your package, not all
packages that you depend on.
There is one caveat with the new compiler, which is that your
package and your dependencies must all be strong mode clean. If you are
getting an error compiling one of your dependencies, you will need to file
bugs or send pull requests to get them strong mode clean.
There are two ways of opting into the new compiler:
-
Use the new --web-compiler flag, which supports dartdevc,
dart2js or none as options. This is the easiest way to try
things out without changing the default.
-
Add config to your pubspec. There is a new web key which
supports a single key called compiler. This is a map from mode
names to compiler to use. For example, to default to dartdevc in debug mode
you can add the following to your pubspec:
web:
compiler:
debug: dartdevc
You can also use the new compiler to run your tests in Chrome
much more quickly than you can with dart2js. In order to do that, run pub
serve test --web-compiler=dartdevc, and then run pub run test -p
chrome --pub-serve=8080.
-
The --no-dart2js flag has been deprecated in favor of
--web-compiler=none.
-
pub build will use a failing exit code if there are errors in any
transformer.
-
pub publish
-
Added support for the UNLICENSE file.
-
Packages that depend on the Flutter SDK may be published.
-
pub get and pub upgrade
- Don't dump a stack trace when a network error occurs while fetching
packages.
-
dartfmt
- Preserve type parameters in new generic function typedef syntax.
- Add self-test validation to ensure formatter bugs do not cause user
code to be lost.
<https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#infrastructure-changes>Infrastructure
changes
- As of this release, we'll show a warning when using the MIPS
architecture. Unless we learn about any critical use of Dart on MIPS in the
meantime, we're planning to deprecate support for MIPS starting with the
next stable release.
--
For more news and information, visit https://plus.google.com/+dartlang
To join the conversation, visit https://groups.google.com/a/dartlang.org/
<http://news.dartlang.org/2017/06/dart-124-faster-edit-refresh-cycle-on.html> and
the changelog
<https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#1240>!
Kind regards, the Dart team
-----
1.24.0
<https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#language-1>
Language
-
During a dynamic type check, void is not required to be null anymore. In
practice, this makes overriding voidfunctions with non-void functions
safer.
-
During static analysis, a function or setter declared using => with
return type void now allows the returned expression to have any type.
For example, assuming the declaration int x;, it is now type correct to
have void f() => ++x;.
-
A new function-type syntax has been added to the language. Intuitively,
the type of a function can be constructed by textually replacing the
function's name with Function in its declaration. For instance, the type
of void foo() {} would be void Function(). The new syntax may be used
wherever a type can be written. It is thus now possible to declare fields
containing functions without needing to write typedefs: void Function()
x;. The new function type has one restriction: it may not contain the
old-style function-type syntax for its parameters. The following is thus
illegal: void Function(int f()). typedefs have been updated to support
this new syntax.
Examples:
typedef F = void Function(); // F is the name for a `void` callback.int Function(int) f; // A field `f` that contains an int->int function.
class A<T> {
// The parameter `callback` is a function that takes a `T` and returns
// `void`.
void forEach(void Function(T) callback);
}
// The new function type supports generic arguments.typedef Invoker = T Function<T>(T Function() callback);
<https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#core-library-changes-1>Core
library changes
-
dart:async, dart:core, dart:io
- Adding to a closed sink, including IOSink, is no longer not allowed.
In 1.24, violations are only reported (on stdout or stderr), but a future
version of the Dart SDK will change this to throwing a StateError.
-
dart:convert
- BREAKING Removed the deprecated ChunkedConverter class.
- JSON maps are now typed as Map<String, dynamic> instead of Map<dynamic,
dynamic>. A JSON-map is not a HashMap or LinkedHashMap anymore (but
just a Map).
-
dart:io
- Added Platform.localeName, needed for accessing the locale on
platforms that don't store it in an environment variable.
- Added ProcessInfo.currentRss and ProcessInfo.maxRss for inspecting
the Dart VM process current and peak resident set size.
- Added RawSynchronousSocket, a basic synchronous socket
implementation.
-
dart: web APIs have been updated to align with Chrome v50. This change
includes a large number of changes, many of which are breaking. In some
cases, new class names may conflict with names that exist in existing code.
-
dart:html
-
REMOVED classes: Bluetooth, BluetoothDevice,
BluetoothGattCharacteristic, BluetoothGattRemoteServer,
BluetoothGattService, BluetoothUuid, CrossOriginConnectEvent,
DefaultSessionStartEvent, DomSettableTokenList, MediaKeyError,
PeriodicSyncEvent, PluginPlaceholderElement, ReadableStream,
StashedMessagePort, SyncRegistration
-
REMOVED members:
- texImage2DCanvas was removed from RenderingContext.
- endClip and startClip were removed from Animation.
- after and before were removed from CharacterData, ChildNode and
Element.
- keyLocation was removed from KeyboardEvent. Use location instead.
- generateKeyRequest, keyAddedEvent, keyErrorEvent, keyMessageEvent
, mediaGroup, needKeyEvent, onKeyAdded, onKeyError, onKeyMessage,
and onNeedKey were removed from MediaElement.
- getStorageUpdates was removed from Navigator
- status was removed from PermissionStatus
- getAvailability was removed from PreElement
-
Other behavior changes:
- URLs returned in CSS or html are formatted with quoted string. Like
url("http://google.com") instead of url(http://google.com).
- Event timestamp property type changed from int to num.
- Chrome introduced slight layout changes of UI objects. In
addition many height/width dimensions are returned in subpixel values (
num instead of whole numbers).
- setRangeText with a selectionMode value of 'invalid' is no
longer valid. Only "select", "start", "end", "preserve" are allowed.
-
dart:svg
- A large number of additions and removals. Review your use of dart:svg
carefully.
-
dart:web_audio
- new method on AudioContext â createIirFilter returns a new class
IirFilterNode.
-
dart:web_gl
-
new classes: CompressedTextureAstc, ExtColorBufferFloat,
ExtDisjointTimerQuery, and TimerQueryExt.
-
ExtFragDepth added: readPixels2 and texImage2D2.
<https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#strong-mode-1>Strong
Mode
-
Removed ad hoc Future.then inference in favor of using FutureOr. Prior
to adding FutureOr to the language, the analyzer implented an ad hoc
type inference for Future.then (and overrides) treating it as if the
onValue callback was typed to return FutureOr for the purposes of
inference. This ad hoc inference has been removed now that FutureOr has
been added.
Packages that implement Future must either type the onValue parameter to
.then as returning FutureOr<T>, or else must leave the type of the
parameter entirely to allow inference to fill in the type.
-
During static analysis, a function or setter declared using => with
return type void now allows the returned expression to have any type.
<https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#tool-changes-1>Tool
Changes
-
Dartium
Dartium is now based on Chrome v50. See *Core library changes* above for
details on the changed APIs.
-
Pub
-
pub build and pub serve
-
Added support for the Dart Development Compiler.
Unlike dart2js, this new compiler is modular, which allows pub to
do incremental re-builds for pub serve, and potentially pub build in
the future.
In practice what that means is you can edit your Dart files,
refresh in Chrome (or other supported browsers), and see your edits almost
immediately. This is because pub is only recompiling your package, not all
packages that you depend on.
There is one caveat with the new compiler, which is that your
package and your dependencies must all be strong mode clean. If you are
getting an error compiling one of your dependencies, you will need to file
bugs or send pull requests to get them strong mode clean.
There are two ways of opting into the new compiler:
-
Use the new --web-compiler flag, which supports dartdevc,
dart2js or none as options. This is the easiest way to try
things out without changing the default.
-
Add config to your pubspec. There is a new web key which
supports a single key called compiler. This is a map from mode
names to compiler to use. For example, to default to dartdevc in debug mode
you can add the following to your pubspec:
web:
compiler:
debug: dartdevc
You can also use the new compiler to run your tests in Chrome
much more quickly than you can with dart2js. In order to do that, run pub
serve test --web-compiler=dartdevc, and then run pub run test -p
chrome --pub-serve=8080.
-
The --no-dart2js flag has been deprecated in favor of
--web-compiler=none.
-
pub build will use a failing exit code if there are errors in any
transformer.
-
pub publish
-
Added support for the UNLICENSE file.
-
Packages that depend on the Flutter SDK may be published.
-
pub get and pub upgrade
- Don't dump a stack trace when a network error occurs while fetching
packages.
-
dartfmt
- Preserve type parameters in new generic function typedef syntax.
- Add self-test validation to ensure formatter bugs do not cause user
code to be lost.
<https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#infrastructure-changes>Infrastructure
changes
- As of this release, we'll show a warning when using the MIPS
architecture. Unless we learn about any critical use of Dart on MIPS in the
meantime, we're planning to deprecate support for MIPS starting with the
next stable release.
--
For more news and information, visit https://plus.google.com/+dartlang
To join the conversation, visit https://groups.google.com/a/dartlang.org/
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.