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

4.0.0-beta

Compare
Choose a tag to compare
@alorenzen alorenzen released this 24 Aug 19:49
· 2670 commits to master since this release

angular

4.0.0-beta

AngularDart will start tracking the upcoming Dart 2.0 alpha SDK, and as such,
4.0.0 will be the last stable release that fully supports Dart 1.24.0. We may
release small patches if needed, but otherwise the plan is to release 4.0.0 and
then immediately start working on 5.0.0-alpha, which uses the new Dart SDK.

Breaking changes

  • @Pipe-annotated classes are no longer considered @Injectable, in that they
    aren't usable within a ReflectiveInjector. You can get this behavior back by
    adding the @Injectable() annotation to the @Pipe-annotated class. Similar
    changes are in progress for @Component and @Directive.

  • PLATFORM_{PIPES|DIRECTIVES|PROVIDERS}, which was only supported in an older
    version of the compiler, was removed. All of these must be manually included
    in lists in an @Directive or @Component annotation.

New features

  • Added support for functional directives: lightweight, stateless directives
    that apply a one-time transformation.

    • One is defined by annotating a public, top-level function with
      @Directive().

    • The function parameters specify its dependencies, similar to the constructor
      of a regular directive.

    • Only the selector and providers parameters of the @Directive()
      annotation are permitted, because the other parameters are stateful.

    • The function return type must be void.

@Directive(selector: '[autoId]')
void autoIdDirective(Element element, IdGenerator generator) {
  element.id = generator.next();
}
  • Added visibility property to Directive. Directives and components that
    don't need to be injected can set visibility: Visibility.none in their
    annotation. This prevents the compiler from generating code necessary to
    support injection, making the directive or component non-injectable and
    reducing the size of your application.
// This component can't be injected by other directives or components.
@Component(selector: 'my-component', visibility: Visibility.none)
class MyComponent { ... }

Bug fixes

  • Compiler now warns when annotations are added to private classes or functions.
  • Compiler now warns when injecting into a field that is non-existent.
  • Fixed a long-standing bug on ngSwitch behavior in Dartium.

Performance

  • Various small reductions to the size of generated code and the runtime.

angular_router

1.0.1

  • Minor internal changes to support angular 4.0.0-beta

angular_compiler

0.3.0

  • Always link to export "...template.dart" files in initReflector().
  • Catch missing field-formal (this.) fields and warn in the compiler.
  • Does not emit a registerDependencies function call for empty constructors.
  • initReflector() no longer treats @Pipe as an @Injectable service.