OLD | NEW |
1 ## 1.25.0 | 1 ## 1.25.0 |
2 | 2 |
3 ### Language | 3 ### Language |
4 | 4 |
5 #### Strong Mode | 5 #### Strong Mode |
6 | 6 |
7 ### Core library changes | 7 ### Core library changes |
8 | 8 |
9 * `dart:io` | 9 * `dart:io` |
10 * Unified backends for `SecureSocket`, `SecurityContext`, and | 10 * Unified backends for `SecureSocket`, `SecurityContext`, and |
11 `X509Certificate` to be consistent across all platforms. All | 11 `X509Certificate` to be consistent across all platforms. All |
12 `SecureSocket`, `SecurityContext`, and `X509Certificate` properties and | 12 `SecureSocket`, `SecurityContext`, and `X509Certificate` properties and |
13 methods are now supported on iOS and OSX. | 13 methods are now supported on iOS and OSX. |
14 * Removed `SecurityContext.alpnSupported` as ALPN is now supported on all | 14 * Removed `SecurityContext.alpnSupported` as ALPN is now supported on all |
15 platforms. | 15 platforms. |
16 | 16 |
17 ### Dart VM | 17 ### Dart VM |
18 | 18 |
19 ### Tool Changes | 19 ### Tool Changes |
20 | 20 |
21 ## 1.24.0 | 21 ## 1.24.0 |
22 | 22 |
23 ### Language | 23 ### Language |
24 * During a dynamic type check, `void` is not required to be `null` anymore. | 24 * During a dynamic type check, `void` is not required to be `null` anymore. |
25 In practice, this makes overriding `void` functions with non-`void` functions | 25 In practice, this makes overriding `void` functions with non-`void` functions |
26 safer. | 26 safer. |
| 27 |
27 * During static analysis, a function or setter declared using `=>` with return | 28 * During static analysis, a function or setter declared using `=>` with return |
28 type `void` now allows the returned expression to have any type. For example, | 29 type `void` now allows the returned expression to have any type. For example, |
29 assuming the declaration `int x;`, it is now type correct to have | 30 assuming the declaration `int x;`, it is now type correct to have |
30 `void f() => ++x;`. | 31 `void f() => ++x;`. |
| 32 |
31 * A new function-type syntax has been added to the language. | 33 * A new function-type syntax has been added to the language. |
32 Intuitively, the type of a function can be constructed by textually replacing | 34 Intuitively, the type of a function can be constructed by textually replacing |
33 the function's name with `Function` in its declaration. For instance, the | 35 the function's name with `Function` in its declaration. For instance, the |
34 type of `void foo() {}` would be `void Function()`. The new syntax may be used | 36 type of `void foo() {}` would be `void Function()`. The new syntax may be used |
35 wherever a type can be written. It is thus now possible to declare fields | 37 wherever a type can be written. It is thus now possible to declare fields |
36 containing functions without needing to write typedefs: `void Function() x;`. | 38 containing functions without needing to write typedefs: `void Function() x;`. |
37 The new function type has one restriction: it may not contain the old-style | 39 The new function type has one restriction: it may not contain the old-style |
38 function-type syntax for its parameters. The following is thus | 40 function-type syntax for its parameters. The following is thus illegal: |
39 illegal: `void Function(int f())`. | 41 `void Function(int f())`. |
40 `typedefs` have been updated to support this new syntax. | 42 `typedefs` have been updated to support this new syntax. |
| 43 |
41 Examples: | 44 Examples: |
42 ``` | 45 |
| 46 ```dart |
43 typedef F = void Function(); // F is the name for a `void` callback. | 47 typedef F = void Function(); // F is the name for a `void` callback. |
44 int Function(int) f; // A field `f` that contains an int->int function. | 48 int Function(int) f; // A field `f` that contains an int->int function. |
45 | 49 |
46 class A<T> { | 50 class A<T> { |
47 // The parameter `callback` is a function that takes a `T` and returns | 51 // The parameter `callback` is a function that takes a `T` and returns |
48 // `void`. | 52 // `void`. |
49 void forEach(void Function(T) callback); | 53 void forEach(void Function(T) callback); |
50 } | 54 } |
51 | 55 |
52 // The new function type supports generic arguments. | 56 // The new function type supports generic arguments. |
53 typedef Invoker = T Function<T>(T Function() callback); | 57 typedef Invoker = T Function<T>(T Function() callback); |
54 ``` | 58 ``` |
55 | 59 |
56 #### Strong Mode | 60 #### Strong Mode |
57 | 61 |
58 * Removed ad hoc Future.then inference in favor of using FutureOr. Prior to | 62 * Removed ad hoc `Future.then` inference in favor of using `FutureOr`. Prior to |
59 adding FutureOr to the language, the analyzer implented an ad hoc type inference | 63 adding `FutureOr` to the language, the analyzer implented an ad hoc type |
60 for Future.then (and overrides) treating it as if the onValue callback was typed | 64 inference for `Future.then` (and overrides) treating it as if the onValue |
61 to return FutureOr for the purposes of inference. This ad hoc inference has | 65 callback was typed to return `FutureOr` for the purposes of inference. |
62 been removed now that FutureOr has been added. | 66 This ad hoc inference has been removed now that `FutureOr` has been added. |
63 | 67 |
64 Packages that implement `Future` must either type the `onValue` parameter to | 68 Packages that implement `Future` must either type the `onValue` parameter to |
65 `.then` as returning `FutureOr<T>`, or else must leave the type of the parameter | 69 `.then` as returning `FutureOr<T>`, or else must leave the type of the paramet
er |
66 entirely to allow inference to fill in the type. | 70 entirely to allow inference to fill in the type. |
67 | 71 |
68 * The following is also a change in strong mode: During static analysis, a | 72 * During static analysis, a function or setter declared using `=>` with return |
69 function or setter declared using `=>` with return type `void` now allows the | 73 type `void` now allows the returned expression to have any type. |
70 returned expression to have any type. | |
71 * The new function-type syntax is also supported by strong mode. | |
72 | 74 |
73 ### Core library changes | 75 ### Core library changes |
74 | 76 |
| 77 * `dart:async`, `dart:core`, `dart:io` |
| 78 * Adding to a closed sink, including `IOSink`, is no longer not allowed. In |
| 79 1.24, violations are only reported (on stdout or stderr), but a future |
| 80 version of the Dart SDK will change this to throwing a `StateError`. |
| 81 |
| 82 * `dart:convert` |
| 83 * **BREAKING** Removed the deprecated `ChunkedConverter` class. |
| 84 * JSON maps are now typed as `Map<String, dynamic>` instead of |
| 85 `Map<dynamic, dynamic>`. A JSON-map is not a `HashMap` or `LinkedHashMap` |
| 86 anymore (but just a `Map`). |
| 87 |
75 * `dart:io` | 88 * `dart:io` |
76 * Added `Platform.localeName`, needed for accessing the locale on platforms | 89 * Added `Platform.localeName`, needed for accessing the locale on platforms |
77 that don't store it in an environment variable. | 90 that don't store it in an environment variable. |
78 * Added `ProcessInfo.currentRss` and `ProcessInfo.maxRss` for inspecting | 91 * Added `ProcessInfo.currentRss` and `ProcessInfo.maxRss` for inspecting |
79 the Dart VM process current and peak resident set size. | 92 the Dart VM process current and peak resident set size. |
80 * Added 'RawSynchronousSocket', a basic synchronous socket implementation. | 93 * Added `RawSynchronousSocket`, a basic synchronous socket implementation. |
81 * `dart:convert` | |
82 * Removed deprecated `ChunkedConverter` class. | |
83 * JSON maps are now typed as `Map<String, dynamic>` instead of | |
84 `Map<dynamic, dynamic>`. A JSON-map is not a `HashMap` or `LinkedHashMap` | |
85 anymore (but just a `Map`). | |
86 * `dart:async`, `dart:io`, `dart:core` | |
87 * Adding to a closed sink, including `IOSink`, is not allowed anymore. In | |
88 1.24, violations are only reported (on stdout or stderr), but a future | |
89 version of the Dart SDK will change this to throwing a `StateError`. | |
90 | 94 |
91 ### Dart VM | |
92 | 95 |
93 ### Tool Changes | 96 ### Tool Changes |
94 | 97 |
95 * Pub | 98 * Pub |
96 * Added support for the Dart Development Compiler in `build` and `serve`. | 99 * Added support for the Dart Development Compiler in `build` and `serve`. |
97 | 100 |
98 Unlike dart2js, this new compiler is modular, which allows pub to do | 101 Unlike dart2js, this new compiler is modular, which allows pub to do |
99 incremental re-builds for `pub serve`, and potentially `pub build` in the | 102 incremental re-builds for `pub serve`, and potentially `pub build` in the |
100 future. | 103 future. |
101 | 104 |
(...skipping 1902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2004 they will keep the Dart process alive until they time out. This fixes the | 2007 they will keep the Dart process alive until they time out. This fixes the |
2005 handling of persistent connections. Previously, the client would shut down | 2008 handling of persistent connections. Previously, the client would shut down |
2006 immediately after a request. | 2009 immediately after a request. |
2007 | 2010 |
2008 * **Breaking change:** `HttpServer` no longer compresses all traffic by | 2011 * **Breaking change:** `HttpServer` no longer compresses all traffic by |
2009 default. The new `autoCompress` property can be set to `true` to re-enable | 2012 default. The new `autoCompress` property can be set to `true` to re-enable |
2010 compression. | 2013 compression. |
2011 | 2014 |
2012 * `dart:isolate`: `Isolate.spawnUri` added the optional `packageRoot` argument, | 2015 * `dart:isolate`: `Isolate.spawnUri` added the optional `packageRoot` argument, |
2013 which controls how it resolves `package:` URIs. | 2016 which controls how it resolves `package:` URIs. |
OLD | NEW |