diff --git a/src/resources/breaking-changes.md b/src/resources/breaking-changes.md index 4430e70177..55264f9085 100644 --- a/src/resources/breaking-changes.md +++ b/src/resources/breaking-changes.md @@ -47,6 +47,45 @@ To be notified about future breaking changes, join the [Dart announce][] group. ## Not yet released to stable +### Libraries +{: .no_toc} + +#### `dart:nativewrappers` + +* [Marked classes belonging to `NativeWrapperClass` as `base`][51896] so that + none of their subtypes can be implemented. + +#### `dart:typed_data` + +* **Deprecated**: [Unmodifiable view classes for typed data][53218]. + + +[51896]: https://github.com/dart-lang/sdk/issues/51896 +[53218]: https://github.com/dart-lang/sdk/issues/53218 + +{% comment %} +Create new section from these headers for each release. +If no changes exist in a section (e.g. Language, `dart:async`, etc.), +don't include the section header. + +## Released in x.x.x + +### Language +{: .no_toc} + +### Libraries +{: .no_toc} + +#### (`dart:core`, `package:js`, etc) + +### Tools +{: .no_toc} + +#### (Dart VM, Pub, Linter, `dart2js`, etc) +{% endcomment %} + +## Released in 3.2.0 + ### Language {: .no_toc} @@ -57,6 +96,10 @@ To be notified about future breaking changes, join the [Dart announce][] group. ### Libraries {: .no_toc} +#### `dart:cli` + +* **Experimental** **Deprecated**: [The `waitFor` function.][52121] + #### `dart:convert` * [Changed return types of `utf8.encode()` and `Utf8Codec.encode()`][52801] @@ -66,52 +109,80 @@ To be notified about future breaking changes, join the [Dart announce][] group. * **Deprecated**: The `Service.getIsolateID` method. +#### `dart:ffi` + +* [Changed `NativeCallable.nativeFunction` so calls now throw an error if + the receiver is already closed][53311], instead of returning `nullptr`. + #### `dart:io` * [Eliminated trailing whitespace from HTTP headers][53005]. +* [Inserted a space at the fold point of folded header values][53227] + that `HttpClientResponse.headers` and `HttpRequest.headers` return. #### `dart:js_interop` * **Experimental** **Removed**: `JSNumber.toDart` in favor of `toDartDouble` and `toDartInt`. * **Experimental** **Removed**: `Object.toJS` in favor of `Object.toJSBox.` +* **Experimental**: Restricted external JS interop APIs using `dart:js_interop` + to a set of allowed types. +* **Experimental**: Prohibited use of `isNull` and `isUndefined` on dart2wasm. +* **Experimental**: Changed `typeofEquals` and `instanceof` APIs to both return + bool instead of `JSBoolean`. + Also, `typeofEquals` now takes `String` instead of `JSString`. +* **Experimental**: Changed `JSAny` and `JSObject` types to only implementable, + not extendable, by user `@staticInterop` types. +* **Experimental**: Changed `JSArray.withLength` to take `int` instead of `JSNumber`. ### Tools {: .no_toc} -#### Dart Dev Compiler (DDC) and Dart2js +#### Development JavaScript compiler (DDC) + +* [Added interceptors for JavaScript `Symbol` and `BigInt` types][53106]; + they should no longer be used with `package:js` classes. + +#### Production JavaScript compiler (dart2js) * [Added interceptors for JavaScript `Symbol` and `BigInt` types][53106]; they should no longer be used with `package:js` classes. +#### Analyzer + +* **Language versioned**: [Private final field promotion][2020] might cause the following + analyzer warnings to trigger on existing code that previously passed analysis: + + * [`unnecessary_non_null_assertion`](/tools/diagnostic-messages#unnecessary_non_null_assertion) + * [`invalid_null_aware_operator`](/tools/diagnostic-messages#invalid_null_aware_operator) + * [`unnecessary_cast`](/tools/diagnostic-messages#unnecessary_cast) + + ```dart + class C { + final num? _x = null; + + void test() { + if (_x != null) { + print(_x! * 2); // unnecessary_non_null_assertion + print(_x?.abs()); // invalid_null_aware_operator + } + if (_x is int) { + print((_x as int).bitLength); // unnecessary_cast + } + } + } + ``` [53167]: https://github.com/dart-lang/sdk/issues/53167 +[52121]: https://github.com/dart-lang/sdk/issues/52121 [52801]: https://github.com/dart-lang/sdk/issues/52801 +[53311]: https://github.com/dart-lang/sdk/issues/53311 [53005]: https://github.com/dart-lang/sdk/issues/53005 +[53227]: https://github.com/dart-lang/sdk/issues/53227 [53106]: https://github.com/dart-lang/sdk/issues/53106 +[2020]: https://github.com/dart-lang/language/issues/2020 -{% comment %} -Create new section from these headers for each release. -If no changes exist in a section (e.g. Language, `dart:async`, etc.), -don't include the section header. - -## Released in x.x.x - -### Language -{: .no_toc} - -### Libraries -{: .no_toc} - -#### (`dart:core`, `package:js`, etc) - -### Tools -{: .no_toc} - -#### (Dart VM, Pub, Linter, `dart2js`, etc) -{% endcomment %} - ## Released in 3.1.0 ### Libraries