Skip to content

Commit cee4edf

Browse files
parloughantfitch
andauthored
[Dart 3.10] Add latest breaking changes from Dart 3.10 and 3.11 (#6979)
Co-authored-by: Amanda Fitch <18406675+antfitch@users.noreply.github.com>
1 parent df3e398 commit cee4edf

File tree

1 file changed

+89
-6
lines changed

1 file changed

+89
-6
lines changed

src/content/resources/breaking-changes.md

Lines changed: 89 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,43 +77,126 @@ don't include the section header.
7777
#### (Dart VM, Pub, Linter, `dart2js`, etc)
7878
{% endcomment %}
7979

80+
## 3.11.0
81+
82+
:::note Tentative
83+
The following changes are expected to be included in the 3.11 stable release,
84+
but the final list might change before then.
85+
To reduce the potential impact of these changes, consider
86+
accounting for them before the 3.11 release.
87+
:::
88+
89+
### Tools
90+
91+
#### Wasm compilation (`dart compile wasm`)
92+
93+
- {{removed}}
94+
Code that imports `dart:js_util` or `package:js` now
95+
[results in a compilation error][61550] when compiling to WebAssembly.
96+
97+
Invoking any API from these libraries will result in a runtime error.
98+
Usages should be migrated to `dart:js_interop` and `dart:js_interop_unsafe`.
99+
100+
[61550]: {{site.repo.dart.sdk}}/issues/61550
101+
80102
## 3.10.0
81103

82-
**Tentative**<br>
104+
:::note Tentative
83105
The following changes are expected to be included in the 3.10 stable release,
84106
but the final list might change before then.
85107
To reduce the potential impact of these changes, consider
86108
accounting for them before the 3.10 release.
109+
:::
110+
111+
### Language
112+
113+
- `sync*` and `async*` generator functions without a specified return now
114+
correctly infer return types as non-nullable when no `null` value is yielded.
115+
This might trigger new diagnostics related to unnecessary code elements,
116+
such as an unnecessary null-aware access operator (`?.`).
87117

88118
### Libraries
89119

120+
#### `dart:core`
121+
122+
- The `Uri.parseIPv4Address` and `Uri.parseIPv6Address` functions
123+
[no longer incorrectly allow][61392] leading zeros in IPv4 addresses.
124+
125+
- {{deprecated}}
126+
The ability to implement `RegExp` and `RegExpMatch` is deprecated
127+
and will be removed in a future release.
128+
129+
[61392]: {{site.repo.dart.sdk}}/issues/61392
130+
90131
#### `dart:io`
91132

92133
- `IOOverrides` can [no longer be implemented][56468],
93134
but can still be extended.
94135

95136
[56468]: {{site.repo.dart.sdk}}/issues/56468
96137

97-
### SDK
138+
#### `dart:js_interop`
98139

99-
- The `dart` CLI and Dart VM are now separate executables,
100-
with the pure Dart VM executable and process called `dartvm`.
101-
Dart programs should still be run with [`dart run`][].
140+
- The `Uint16ListToJSInt16Array` extension has been
141+
renamed to `Uint16ListToJSUint16Array`.
102142

103-
[`dart run`]: /tools/dart-run
143+
- The `JSUint16ArrayToInt16List` extension has been
144+
renamed to `JSUint16ArrayToUint16List`.
145+
146+
- The `Function.toJSCaptureThis` function now results in addditional
147+
compile-time checks to match `Function.toJS`.
148+
If the function doesn't have a statically known type,
149+
has unsupported types in its signature, includes type parameters,
150+
or has any named parameters, the call will result in a compile-time error.
104151

105152
### Tools
106153

154+
#### SDK
155+
156+
- The `dart` CLI and Dart VM are now separate executables,
157+
with the pure Dart VM executable and process called `dartvm`.
158+
Dart programs should still be run with [`dart run`][].
159+
107160
- Subcommands of the `dart` tool, such as `dart format` and `dart compile`
108161
now run AOT-compiled snapshots of the underlying tools.
109162
There should be no functional difference outside of performance improvements,
110163
but if you come across incompatibilities, please [report them][sdk report].
164+
111165
- {{removed}}
112166
The `dart` tool is no longer available for IA32 platforms
113167
as the Dart SDK no longer supports IA32.
114168

169+
[`dart run`]: /tools/dart-run
115170
[sdk report]: {{site.repo.dart.sdk}}/issues/new/choose
116171

172+
#### Analyzer
173+
174+
- Using members marked as `@experimental` outside
175+
the package they are declared in
176+
now results in a warning.
177+
178+
- Lint rules enabled in included analysis options files
179+
now result in incompatible lint diagnostics when appropriate.
180+
181+
- {{removed}}
182+
The deprecated `@required` annotation from
183+
`package:meta` is no longer supported.
184+
To mark a parameter as required, instead use the `required` keyword.
185+
186+
#### Wasm compilation (`dart compile wasm`)
187+
188+
- `dart:js_util` and `package:js` are [no longer supported][61550] when
189+
compiling to WebAssembly.
190+
Invoking any API from these libraries will result in a runtime error.
191+
Usages should be migrated to `dart:js_interop` and `dart:js_interop_unsafe`.
192+
193+
- To match the JS compilers, `dartify` when compiled to Wasm,
194+
[now converts][54573] JS `Promise` objects to Dart `Future` objects
195+
instead of Dart `JSValue` objects.
196+
197+
[61550]: {{site.repo.dart.sdk}}/issues/61550
198+
[54573]: {{site.repo.dart.sdk}}/issues/54573
199+
117200
## 3.9.0
118201

119202
### Language

0 commit comments

Comments
 (0)