| 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 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 class A<T> { | 50 class A<T> { |
| 51 // 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 |
| 52 // `void`. | 52 // `void`. |
| 53 void forEach(void Function(T) callback); | 53 void forEach(void Function(T) callback); |
| 54 } | 54 } |
| 55 | 55 |
| 56 // The new function type supports generic arguments. | 56 // The new function type supports generic arguments. |
| 57 typedef Invoker = T Function<T>(T Function() callback); | 57 typedef Invoker = T Function<T>(T Function() callback); |
| 58 ``` | 58 ``` |
| 59 | 59 |
| 60 #### Strong Mode | |
| 61 | |
| 62 * Removed ad hoc `Future.then` inference in favor of using `FutureOr`. Prior to | |
| 63 adding `FutureOr` to the language, the analyzer implented an ad hoc type | |
| 64 inference for `Future.then` (and overrides) treating it as if the onValue | |
| 65 callback was typed to return `FutureOr` for the purposes of inference. | |
| 66 This ad hoc inference has been removed now that `FutureOr` has been added. | |
| 67 | |
| 68 Packages that implement `Future` must either type the `onValue` parameter to | |
| 69 `.then` as returning `FutureOr<T>`, or else must leave the type of the paramet
er | |
| 70 entirely to allow inference to fill in the type. | |
| 71 | |
| 72 * During static analysis, a function or setter declared using `=>` with return | |
| 73 type `void` now allows the returned expression to have any type. | |
| 74 | |
| 75 ### Core library changes | 60 ### Core library changes |
| 76 | 61 |
| 77 * `dart:async`, `dart:core`, `dart:io` | 62 * `dart:async`, `dart:core`, `dart:io` |
| 78 * Adding to a closed sink, including `IOSink`, is no longer not allowed. In | 63 * 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 | 64 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`. | 65 version of the Dart SDK will change this to throwing a `StateError`. |
| 81 | 66 |
| 82 * `dart:convert` | 67 * `dart:convert` |
| 83 * **BREAKING** Removed the deprecated `ChunkedConverter` class. | 68 * **BREAKING** Removed the deprecated `ChunkedConverter` class. |
| 84 * JSON maps are now typed as `Map<String, dynamic>` instead of | 69 * JSON maps are now typed as `Map<String, dynamic>` instead of |
| 85 `Map<dynamic, dynamic>`. A JSON-map is not a `HashMap` or `LinkedHashMap` | 70 `Map<dynamic, dynamic>`. A JSON-map is not a `HashMap` or `LinkedHashMap` |
| 86 anymore (but just a `Map`). | 71 anymore (but just a `Map`). |
| 87 | 72 |
| 88 * `dart:io` | 73 * `dart:io` |
| 89 * Added `Platform.localeName`, needed for accessing the locale on platforms | 74 * Added `Platform.localeName`, needed for accessing the locale on platforms |
| 90 that don't store it in an environment variable. | 75 that don't store it in an environment variable. |
| 91 * Added `ProcessInfo.currentRss` and `ProcessInfo.maxRss` for inspecting | 76 * Added `ProcessInfo.currentRss` and `ProcessInfo.maxRss` for inspecting |
| 92 the Dart VM process current and peak resident set size. | 77 the Dart VM process current and peak resident set size. |
| 93 * Added `RawSynchronousSocket`, a basic synchronous socket implementation. | 78 * Added `RawSynchronousSocket`, a basic synchronous socket implementation. |
| 94 | 79 |
| 80 * `dart:` web APIs have been updated to align with Chrome v50. |
| 81 This change includes **a large number of changes**, many of which are |
| 82 breaking. In some cases, new class names may conflict with names that exist |
| 83 in existing code. |
| 84 |
| 85 * `dart:html` |
| 86 |
| 87 * **REMOVED** classes: `Bluetooth`, `BluetoothDevice`, |
| 88 `BluetoothGattCharacteristic`, `BluetoothGattRemoteServer`, |
| 89 `BluetoothGattService`, `BluetoothUuid`, `CrossOriginConnectEvent`, |
| 90 `DefaultSessionStartEvent`, `DomSettableTokenList`, `MediaKeyError`, |
| 91 `PeriodicSyncEvent`, `PluginPlaceholderElement`, `ReadableStream`, |
| 92 `StashedMessagePort`, `SyncRegistration` |
| 93 |
| 94 * **REMOVED** members: |
| 95 * `texImage2DCanvas` was removed from `RenderingContext`. |
| 96 * `endClip` and `startClip` were removed from `Animation`. |
| 97 * `after` and `before` were removed from `CharacterData`, `ChildNode` and |
| 98 `Element`. |
| 99 * `keyLocation` was removed from `KeyboardEvent`. Use `location` instead. |
| 100 * `generateKeyRequest`, `keyAddedEvent`, `keyErrorEvent`, `keyMessageEvent`, |
| 101 `mediaGroup`, `needKeyEvent`, `onKeyAdded`, `onKeyError`, `onKeyMessage`, |
| 102 and `onNeedKey` were removed from `MediaElement`. |
| 103 * `getStorageUpdates` was removed from `Navigator` |
| 104 * `status` was removed from `PermissionStatus` |
| 105 * `getAvailability` was removed from `PreElement` |
| 106 |
| 107 * Other behavior changes: |
| 108 * URLs returned in CSS or html are formatted with quoted string. |
| 109 Like `url("http://google.com")` instead of `url(http://google.com)`. |
| 110 * Event timestamp property type changed from `int` to `num`. |
| 111 * Chrome introduced slight layout changes of UI objects. |
| 112 In addition many height/width dimensions are returned in subpixel values |
| 113 (`num` instead of whole numbers). |
| 114 * `setRangeText` with a `selectionMode` value of 'invalid' is no longer |
| 115 valid. Only "select", "start", "end", "preserve" are allowed. |
| 116 |
| 117 * `dart:svg` |
| 118 |
| 119 * A large number of additions and removals. Review your use of `dart:svg` |
| 120 carefully. |
| 121 |
| 122 * `dart:web_audio` |
| 123 |
| 124 * new method on `AudioContext` – `createIirFilter` returns a new class |
| 125 `IirFilterNode`. |
| 126 |
| 127 * `dart:web_gl` |
| 128 |
| 129 * new classes: `CompressedTextureAstc`, `ExtColorBufferFloat`, |
| 130 `ExtDisjointTimerQuery`, and `TimerQueryExt`. |
| 131 |
| 132 * `ExtFragDepth` added: `readPixels2` and `texImage2D2`. |
| 133 |
| 134 #### Strong Mode |
| 135 |
| 136 * Removed ad hoc `Future.then` inference in favor of using `FutureOr`. Prior to |
| 137 adding `FutureOr` to the language, the analyzer implented an ad hoc type |
| 138 inference for `Future.then` (and overrides) treating it as if the onValue |
| 139 callback was typed to return `FutureOr` for the purposes of inference. |
| 140 This ad hoc inference has been removed now that `FutureOr` has been added. |
| 141 |
| 142 Packages that implement `Future` must either type the `onValue` parameter to |
| 143 `.then` as returning `FutureOr<T>`, or else must leave the type of the paramet
er |
| 144 entirely to allow inference to fill in the type. |
| 145 |
| 146 * During static analysis, a function or setter declared using `=>` with return |
| 147 type `void` now allows the returned expression to have any type. |
| 95 | 148 |
| 96 ### Tool Changes | 149 ### Tool Changes |
| 97 | 150 |
| 151 * Dartium |
| 152 |
| 153 Dartium is now based on Chrome v50. See *Core library changes* above for |
| 154 details on the changed APIs. |
| 155 |
| 98 * Pub | 156 * Pub |
| 99 * Added support for the Dart Development Compiler in `build` and `serve`. | 157 * Added support for the Dart Development Compiler in `build` and `serve`. |
| 100 | 158 |
| 101 Unlike dart2js, this new compiler is modular, which allows pub to do | 159 Unlike dart2js, this new compiler is modular, which allows pub to do |
| 102 incremental re-builds for `pub serve`, and potentially `pub build` in the | 160 incremental re-builds for `pub serve`, and potentially `pub build` in the |
| 103 future. | 161 future. |
| 104 | 162 |
| 105 In practice what that means is you can edit your Dart files, refresh in | 163 In practice what that means is you can edit your Dart files, refresh in |
| 106 Chrome (or other supported browsers), and see your edits almost | 164 Chrome (or other supported browsers), and see your edits almost |
| 107 immediately. This is because pub is only recompiling your package, not all | 165 immediately. This is because pub is only recompiling your package, not all |
| (...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2007 they will keep the Dart process alive until they time out. This fixes the | 2065 they will keep the Dart process alive until they time out. This fixes the |
| 2008 handling of persistent connections. Previously, the client would shut down | 2066 handling of persistent connections. Previously, the client would shut down |
| 2009 immediately after a request. | 2067 immediately after a request. |
| 2010 | 2068 |
| 2011 * **Breaking change:** `HttpServer` no longer compresses all traffic by | 2069 * **Breaking change:** `HttpServer` no longer compresses all traffic by |
| 2012 default. The new `autoCompress` property can be set to `true` to re-enable | 2070 default. The new `autoCompress` property can be set to `true` to re-enable |
| 2013 compression. | 2071 compression. |
| 2014 | 2072 |
| 2015 * `dart:isolate`: `Isolate.spawnUri` added the optional `packageRoot` argument, | 2073 * `dart:isolate`: `Isolate.spawnUri` added the optional `packageRoot` argument, |
| 2016 which controls how it resolves `package:` URIs. | 2074 which controls how it resolves `package:` URIs. |
| OLD | NEW |