5.2.0
angular
5.2.0
Breaking changes
-
The template parser no longer supports styles defined inside the template
itself.Previously, the following two snippets would have been parsed and shimmed in
the same way.<style> .my-class {padding: 10px;} </style>
@Component( styles: ['.other-class {padding: 10px;}'], ) class ExampleComponent{}
Now, only the latter will be parsed and shimmed. The former will be ignored.
-
The template parser no longer supports loading stylesheets defined in an
<link>
tag in the template itself.Previously, the following two snippets would have loaded the exact same
stylesheet.<link href="my-styles.css" rel="stylesheet" />
@Component( styleUrls: ['my-styles.css'], ) class ExampleComponent {}
Now, only the latter will actually be loaded. The former will be ignored.
-
The deprecated field,
ComponentRef.componentType
, which always threw, has
now been completely removed. This was a legacy field for older clients of
AngularDart.
New features
-
Better error messages in the compiler by failing fast on all analyzer errors
in element annotations (@component, etc) and passing the analyzer error
messages to the user. -
Added
runAfterChangesObserved
toNgZone
. This API is intended to be a
more precise way to execute code after AngularDart would have run change
detection (instead of relying onscheduleMicrotask
orTimer.run
). -
Added new type-safe ways to use the
Injector
API without dynamic calls:void example(Injector injector) { // Injecting "SomeType". // Before: var someType1 = injector.get(SomeType) as SomeType; // After: var someType2 = injector.provide<SomeType>(); // Injecting "OpaqueToken<SomeType>(...)". // Before: var someToken1 = injector.get(someToken) as SomeType; // After: var someToken2 = injector.provideToken(someToken); }
-
The code in generated
AppView
no longer performs null safety?.
checks
when calling child views.destroy()
or.destroyNestedViews()
. This means
that misbehaving code could have slightly more confusing stack traces
(new null errors), at the benefit of reduced code-size across the board. -
It's now a build error for
@Component()
to include an entry in
directiveTypes
that types a directive not present indirectives
.
Bug fixes
-
#1653:
AppView.lastRootNode
now correctly returns the last root node
when multipleViewContainer
s are directly nested. -
When using the
@deferred
annotation in a template file, ensure that the
constructed component class uses the deferred import. For example, we now
emitdeflib1.ComponentName(...)
instead oflib1.ComponentName(...)
. This
should ensure Dart2JS properly defer loads the entire component. -
Typing a generic directive with a private type argument is now a build
error. Directive type arguments must be public so that they can be
referenced by the generated library that instantiates the directive.
Previously, this would build successfully but emit code that instantiated
the directive withdynamic
in place of the private type. -
#1665:
@Optional()
dependencies of pipes are now correctly treated as
optional. Previously the annotation was ignored, and attempting to
instantiate the pipe with a missing optional dependency would throw an error
for the missing dependency. -
#1666: Properly emit calls from event bindings in templates where the
tear-off function has one or more named arguments. Previously we would
consider named arguments in the same vane as positional, and it would
generate invalid code causing Dart2JS or DDC to fail compilation. -
The
@deferred
annotation now also defers the annotated component's
defining library, rather than just its generated template's library.
angular_test
2.2.0
Breaking Changes
-
Changed
NgTestStabilizer
initialization from originating from a
List<NgTestStabilizerFactory>
to a singleNgTestStabilizerFactory
. The
new top-level functioncomposeStabilizers
may be used to create a
composite factory from multiple factories:composeStabilizers([ (_) => stabilizer1, (_) => stabilizer2, ])
This helps disambiguate the order of stabilizers running, which in turn will
allow additional new stabilizers and features to be added in a non-breaking
fashion. This change does not impact users that were not augmenting or
creating their own stabilizers (i.e. most users/most tests). -
Removed
NgTestStabilizer.all
. SeecomposeStabilizers
instead. -
Removed
NgZoneStabilizer
. The new class isRealTimeNgZoneStabilizer
,
though most users should not be impactedNgTestBed
now uses the new
stabilizer by default.
New Features
- Added a new
NgTestStabilizer.alwaysStable
, which does what it sounds like
and always reports stability. This handles making composition easier as the
root stabilizer can effectively be a no-op.
Bug Fixes
- When using
RealTimeNgZoneStabilizer
, do not try to stabilize timers that
run outside of Angular zone.
angular_forms
2.1.1
- Maintenance release to support Angular 5.2.
angular_router
2.0.0-alpha+21
- Maintenance release to support Angular 5.2.
angular_compiler
0.4.2
-
Updates the
messages.unresolvedSource
API to support different error
messages for eachSourceSpan
affected. -
Update failure message to include an asset id when collecting type
parameters. -
TypedReader
now throws a build error when reading a private type argument.
angular_ast
0.5.8
- Fixed a type error that occurred when recovering from a missing closing
banana ')]'.