AngularDart 3.0 goes all in, flaunts smaller generated code
AngularDart 2.0 was unveiled in October 2016 so it’s time for the next release. What does AngularDart 3.0 have to offer? Better performance, smaller generated code and the promise to make you more productive.
AngularDart 3.0’s progress might not be immediately visible but that doesn’t mean it’s not there. According to the blog post announcing the new release, AngularDart 3.0 “is a smooth upgrade due to minimal public API adjustments. Most of the progress is under the hood—in code quality, stability, generated code size, performance, and developer experience.”
AngularDart 3.0: The change is in the details
As far as code quality is concerned, there are 2731 instances of making the framework code more type safe (using sound Dart) and the framework code size is down by 12 percent. Furthermore, there are plenty of additional style updates to the codebase:
- Changed to use idiomatic
<T>for generic methods.
NgZoneImpl, all the code exists in
If we talk about stability, you should know that there are a lot of CSS encapsulation fixes due to update with csslib package, as well as fixed bugs with IE11.
Time-to-interactive (currently 3812 ms on a simulated 3G connection, measured via Lighthouse) is now 30 percent faster for the Mail sample app while render times of very deep view hierarchies (65ms versus 128ms in October) appear to be 2x faster, according to their large app benchmark.
For AngularDart Components, massive improvements can be noticed in performance. For example, the
<material-button> component gets initialized 1.5x faster (0.5ms versus 0.7ms in October).
Generated code size
The list of improvements continues with the generated code size.For a small app (GWT Mail sample app), there’s been a three percent reduction since October (when 2.0 was released) and a 24 percent reduction since August (when AngularDart went all Dart).
For large apps, there’s been a 13 percent reduction since October and a 29 percent reduction since August.
SEE ALSO: To the future & beyond: AngularDart 2.0
Other changes that promise to make developers’ lives easier
onPushchange detection using
- Only one
loadmethod (instead of
- Got rid of
TitleService, use idomatic
ngSwitchCasereplaces the soft deprecated
EventEmitteris deprecated: use the idiomatic
- A name parameter is now required for all
@Pipe(name: 'uppercase')is replaced by
nullis no longer propagated as an initial change value. Fields must start with a non-null value.
NgPlural; use the much more dart-y
Catching bugs earlier
- selector is now a
ngIfthrows if the bound value changes during change detection.
- In generated
.template.dartchange detected primitives are typed.
Dev mode tweaks
- Warning when Dartium is run without checked mode.
- By default, the
BrowserExceptionHandlerwhich prints to console. You can override it if you don’t want this behavior (for example, when releasing to production).
Read more about AngularDart 3.0 in the changelog.