Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

Commit 8252243

Browse files
committed
chore(Core): Document that optional new/const is supported.
PiperOrigin-RevId: 200724064
1 parent 6e7118b commit 8252243

File tree

1 file changed

+39
-9
lines changed

1 file changed

+39
-9
lines changed

angular/CHANGELOG.md

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,36 @@
1111
* The `from` attribute added to `<style>` tags created for component styles
1212
now refers to the component URL, rather than its template URL.
1313

14+
* AngularDart now has official support of the
15+
[optional new/const](https://github.com/dart-lang/sdk/issues/30921) feature
16+
of Dart2. The most significant impact to the framework will be increased
17+
terse-ness of the various metadata annotations. Please file issues if you
18+
see any unexpected behavior. Here is one example:
19+
20+
```dart
21+
// Before
22+
@Component(
23+
selector: 'comp',
24+
directives: const [
25+
FooComponent,
26+
],
27+
providers: const [
28+
const ClassProvider(SomeService),
29+
],
30+
)
31+
32+
// After
33+
@Component(
34+
selector: 'comp',
35+
directives: [
36+
FooComponent,
37+
],
38+
providers: [
39+
ClassProvider(SomeService),
40+
],
41+
)
42+
```
43+
1444
### Bug fixes
1545
1646
* Prevented a crash in `NgTemplateOutlet` caused by a specific sequence of
@@ -20,17 +50,17 @@
2050
this started failing in Dart2JS with `--preview-dart-2`, potentially where
2151
synthetic events were being passed instead of the real DOM event:
2252
23-
```html
24-
<some-comp (focus)="handleFocus($event)"></some-comp>
25-
```
53+
```html
54+
<some-comp (focus)="handleFocus($event)"></some-comp>
55+
```
2656
27-
```dart
28-
import 'dart:html';
57+
```dart
58+
import 'dart:html';
2959
30-
void handleFocus(FocusEvent e) {
31-
// Failed when 'e' was a CustomEvent or not strictly a FocusEvent.
32-
}
33-
```
60+
void handleFocus(FocusEvent e) {
61+
// Failed when 'e' was a CustomEvent or not strictly a FocusEvent.
62+
}
63+
```
3464
3565
* Fixed a bug where a recursive type signature on a component or directive
3666
would cause a stack overflow. We don't support generic type arguments yet

0 commit comments

Comments
 (0)