days
-1
-6
hours
-1
-6
minutes
0
-9
seconds
-2
-9
search
Still going strong

AngularDart 3.0 goes all in, flaunts smaller generated code

Gabriela Motroc
© Shutterstock / nazarovsergey

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.
    • Removed NgZoneImpl, all the code exists in NgZone now.

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.

AngularDart 3.0 announcement: Stability improvements

Performance

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).

AngularDart 3.0 announcement: Performance improvements

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.

AngularDart 3.0 announcement — Generated code size

SEE ALSO: To the future & beyond: AngularDart 2.0

Other changes that promise to make developers’ lives easier

Simplified API

    • Simpler onPush change detection using ComponentState and setState.
    • Only one load method (instead of loadAsRoot, loadAsRootIntoNode).
    • Got rid of TitleService, use idomatic document.title instead.
    • Removed viewBindings (use viewProviders).
    • ngSwitchCase replaces the soft deprecated ngSwitchWhen.
    • XHR is deprecated.
    • EventEmitter is deprecated: use the idiomatic Stream and StreamController instead.
    • Removed IterableDifferFactory.
    • A name parameter is now required for all @Pipe(...) definitions: @Pipe(name: 'uppercase') is replaced by @Pipe('uppercase').
    • null is no longer propagated as an initial change value. Fields must start with a non-null value.
    • Removed NgPlural; use the much more dart-y package:intlinstead.

Catching bugs earlier

    • selector is now a @required property.
    • ngIf throws if the bound value changes during change detection.
    • In generated .template.dart change detected primitives are typed.

Testing

    • package:angular_test with improved NgTestBed.

Dev mode tweaks

    • New isDebugMode function.
    • Warning when Dartium is run without checked mode.
    • By default, the ExceptionHandler is a 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.

asap

Author
Gabriela Motroc
Gabriela Motroc is editor of JAXenter.com and JAX Magazine. Before working at Software & Support Media Group, she studied International Communication Management at the Hague University of Applied Sciences.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of