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

4.0.0-alpha

Compare
Choose a tag to compare
@alorenzen alorenzen released this 11 Jul 19:48
· 2879 commits to master since this release

angular

4.0.0-alpha

We are now named package:angular instead of package:angular2. As such
you cannot pub upgrade from angular2 3.x -> angular2 4.x, and you need to
manually update your dependencies instead:

dependencies:
  angular: ^4.0.0-alpha

New features

  • Added exports: [ ... ] to @Component, which allows the limited use of
    top-level fields and static methods/fields in a template without making an
    alias getter in your class. Implements #374.
import 'dart:math' show max;

@Component(
  selector: 'comp',
  exports: const [
    max,
  ],
  // Should write '20'
  template: '{{max(20, 10)}}',
)
class Comp {}
  • Limitations:

    • Only top-level fields that are const (not final) can be exported.

    • As a note, exports are considered to always be pure functions (or
      symbols) and are not change detected the same way that instance methods or
      fields on the component class are.

  • Added @deferred as the first "compile-time" directive (it has no specific
    runtime code nor is it listed in a directives: [ ... ] list. Implements
    #406.

import 'package:angular2/angular2.dart';
import 'expensive_comp.dart' show ExpensiveComp;

@Component(
  selector: 'my-comp',
  directives: const [ExpensiveComp],
  template: r'''
    <expensive-comp @deferred></expensive-comp>
  ''',
)
class MyComp {}
  • Added preliminary support for component inheritance. Components now inherit
    inputs, outputs, host bindings, host listeners, queries, and view queries
    transitively from their immediate supertype if it's a component or directive.

  • We use a new open sourcing tool called "CopyBara" that greatly simplifies
    both releasing and taking open source contributions. We are able to release
    to github more often, and accept PRs much more easily. You can view our
    bleeding github-sync branch for what has yet to be merged
    into master.

  • We no longer emit ng_*.json files as part of the compile process #276.

  • Attribute selectors (<ng-content select="custom-action[group='1']">) is now supported #237.

  • Lifecycle interfaces no longer need to be "re-implemented" on classes in order
    for the compiler to pick them up - we now respect the dependency chain #19.

  • Provider(useValue: ...) now accepts "complex const data structures", with
    the caveat that your data structure must not be invoking a private constructor
    #10.

Breaking changes

  • Removed the runtime (dart:mirrors-based) interpreter. It is now required to
    always use the AngularDart transformer to pre-compile the code, even during
    development time in Dartium. package:angular2/reflection.dart was also
    removed.

  • The bootstrap function now always throws a runtime exception, and both it
    and bootstrapStatic are accessible via angular.dart instead of
    platform/browser.dart and platform/browser_static.dart #357.

  • Returning false from an event handler will no longer cancel the event. See
    #387 for details.

  • Removed Query and ViewQuery. Please use ContentChild/ContentChildren
    and ViewChild/ViewChildren in their place instead.

  • Removed the use_analyzer flag for the transformer. This is always true.
    #404.

  • Removed all other unused or unsupported flags from the transformer. There is
    now a single CompilerFlags class that is universally supported for all build
    systems.

  • Removed a number of classes that were never intended to be public.

Deprecations

  • Support for shadow piercing combinators /deep/ and >>> to prevent style
    encapsulation is now deprecated. /deep/ is already deprecated and will be
    removed in Chrome 60. Its alias >>> is limited to the
    static profile of selectors, meaning it's not supported
    in style sheets. Continued use of these combinators puts Angular at risk of
    incompatibility with common CSS tooling. ::ng-deep is a drop-in replacement,
    intended to provide the same functionality as /deep/ and >>>, without the
    need to use deprecated or unsupported CSS syntax #454.

Bug fixes

  • Properly annotate methods in generated .template.dart code with @override.

  • Updated the documentation for OnInit and OnDestroy to mention more
    specifics about the contract and document "crash detection" cases where they
    may be called more than once.

  • *ngIf now properly checks that inputs do not change during change detection #453.

  • Properly typed TrackByFn as an int not a num #431.

  • Import aliases are supported by the compiler #245.

Performance

  • Remove redundant calls to dbg(...) in dev-mode. This reduces the amount of
    work done and speeds up developer runtimes, such as those using the
    DartDevCompiler (DDC).

  • Some change detection code that was duplicated across all generated templates
    were moved internally to a new AppView#detectHostChanges method.

  • Introduced a new AppViewData structure in the generated code that decreases
    code size ~2% or more in some applications due to better code re-use and emit
    in dart2js.

  • We no longer change detect literals and simple final property reads.

  • Some of the enums used to manage change detection state have been simplified
    to int in order to reduce the cost in the generated code.

angular_test

1.0.0-beta+4

Now supports package:angular instead of package:angular2.

angular_compiler

0.1.0

  • Initial commit of angular_compiler.