OLD | NEW |
1 ## 1.24.0 | 1 ## 1.24.0 |
2 | 2 |
3 ### Language | 3 ### Language |
4 * During a dynamic type check, `void` is not required to be `null` anymore. | 4 * During a dynamic type check, `void` is not required to be `null` anymore. |
5 In practice, this makes overriding `void` functions with non-`void` functions | 5 In practice, this makes overriding `void` functions with non-`void` functions |
6 safer. | 6 safer. |
7 * During static analysis, a function or setter declared using `=>` with return | 7 * During static analysis, a function or setter declared using `=>` with return |
8 type `void` now allows the returned expression to have any type. For example, | 8 type `void` now allows the returned expression to have any type. For example, |
9 assuming the declaration `int x;`, it is now type correct to have | 9 assuming the declaration `int x;`, it is now type correct to have |
10 `void f() => ++x;`. | 10 `void f() => ++x;`. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 * `dart:async`, `dart:io`, `dart:core` | 69 * `dart:async`, `dart:io`, `dart:core` |
70 * Adding to a closed sink, including `IOSink`, is not allowed anymore. In | 70 * Adding to a closed sink, including `IOSink`, is not allowed anymore. In |
71 1.24, violations are only reported (on stdout or stderr), but a future | 71 1.24, violations are only reported (on stdout or stderr), but a future |
72 version of the Dart SDK will change this to throwing a `StateError`. | 72 version of the Dart SDK will change this to throwing a `StateError`. |
73 | 73 |
74 ### Dart VM | 74 ### Dart VM |
75 | 75 |
76 ### Tool Changes | 76 ### Tool Changes |
77 | 77 |
78 * Pub | 78 * Pub |
| 79 * Added support for the Dart Development Compiler in `build` and `serve`. |
| 80 |
| 81 Unlike dart2js, this new compiler is modular, which allows pub to do |
| 82 incremental re-builds for `pub serve`, and potentially `pub build` in the |
| 83 future. |
| 84 |
| 85 In practice what that means is you can edit your Dart files, refresh in |
| 86 Chrome (or other supported browsers), and see your edits almost |
| 87 immediately. This is because pub is only recompiling your package, not all |
| 88 packages that you depend on. |
| 89 |
| 90 There is one caveat with the new compiler, which is that your package and |
| 91 your dependencies must all be strong mode clean. If you are getting an |
| 92 error compiling one of your dependencies, you will need to file bugs or |
| 93 send pull requests to get them strong mode clean. |
| 94 |
| 95 There are two ways of opting into the new compiler: |
| 96 |
| 97 * Use the new `--web-compiler` flag, which supports `dartdevc`, |
| 98 `dart2js` or `none` as options. This is the easiest way to try things |
| 99 out without changing the default. |
| 100 |
| 101 * Add config to your pubspec. There is a new `web` key which supports a |
| 102 single key called `compiler`. This is a map from mode names to |
| 103 compiler to use. For example, to default to dartdevc in debug mode you |
| 104 can add the following to your pubspec: |
| 105 |
| 106 ```yaml |
| 107 web: |
| 108 compiler: |
| 109 debug: dartdevc |
| 110 ``` |
| 111 |
| 112 You can also use the new compiler to run your tests in Chrome much more |
| 113 quickly than you can with dart2js. In order to do that, run |
| 114 `pub serve test --web-compiler=dartdevc`, and then run |
| 115 `pub run test -p chrome --pub-serve=8080`. |
| 116 |
| 117 * The `--no-dart2js` flag has been deprecated in favor of |
| 118 `--web-compiler=none`. |
| 119 * Added support for the UNLICENSE file when validating licenses on |
| 120 `pub lish`. |
| 121 * Better handling for network errors when fetching packages. These are no |
| 122 longer unhandled errors and won't print a stack trace unless you are |
| 123 running in verbose mode. |
79 * `pub build` will use a failing exit code if there are errors in any | 124 * `pub build` will use a failing exit code if there are errors in any |
80 transformer. | 125 transformer. |
81 * Allow publishing packages that depend on the Flutter SDK. | 126 * Allow publishing packages that depend on the Flutter SDK. |
82 | 127 |
83 * dartfmt | 128 * dartfmt |
84 * Preserve type parameters in new generic function typedef syntax. | 129 * Preserve type parameters in new generic function typedef syntax. |
85 * Add self-test validation to ensure formatter bugs do not cause user code | 130 * Add self-test validation to ensure formatter bugs do not cause user code |
86 to be lost. | 131 to be lost. |
87 | 132 |
88 ### Infrastructure changes | 133 ### Infrastructure changes |
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 they will keep the Dart process alive until they time out. This fixes the | 1987 they will keep the Dart process alive until they time out. This fixes the |
1943 handling of persistent connections. Previously, the client would shut down | 1988 handling of persistent connections. Previously, the client would shut down |
1944 immediately after a request. | 1989 immediately after a request. |
1945 | 1990 |
1946 * **Breaking change:** `HttpServer` no longer compresses all traffic by | 1991 * **Breaking change:** `HttpServer` no longer compresses all traffic by |
1947 default. The new `autoCompress` property can be set to `true` to re-enable | 1992 default. The new `autoCompress` property can be set to `true` to re-enable |
1948 compression. | 1993 compression. |
1949 | 1994 |
1950 * `dart:isolate`: `Isolate.spawnUri` added the optional `packageRoot` argument, | 1995 * `dart:isolate`: `Isolate.spawnUri` added the optional `packageRoot` argument, |
1951 which controls how it resolves `package:` URIs. | 1996 which controls how it resolves `package:` URIs. |
OLD | NEW |