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

5.0.0-alpha+12

Compare
Choose a tag to compare
@matanlurey matanlurey released this 17 May 20:35
· 1639 commits to master since this release

angular

5.0.0-alpha+12

Breaking changes

  • It is now a compile-time error to place a @HostBinding or @HostListener
    annotation on a class member that does not accept the respective annotation.
    For example, the following snippet will break at compile-time:

    class Comp {
      // Deceptively, this did not do *anything* before, but the user was never
      // told that the annotation was effectively a no-op. It will fail now!
      @HostListener('click')
      Function onClick;
    }

    ... as part of this refactor, error messages in general around use of
    these annotations have been greatly improved.

  • The semantics of @Component(preserveWhitespace: false) (the default flag)
    have changed somewhat in this release due to user feedback both internally
    and externally (see #804). The
    easiest way to explain the changes are with this example:

    Foo <strong>Bar</strong> Baz

    ... used to display "FooBarBaz" in the old semantics, and now displays
    "Foo Bar Baz" in the new semantics. There are some cases where
    generated code is slightly larger, and other cases where it is smaller (we
    have some smarter heuristics around safe places to collapse whitespace).

New features

  • Added <ng-container>, an element for logical grouping that has no effect
    on layout. This enables use of the *-syntax for structural directives,
    without requiring the cost an HTML element.

    Before

    <ul>
      <template ngFor let-user [ngForOf]="users">
        <li *ngIf="user.visible">{{user.name}}</li>
      </template>
    </ul>

    After

    <ul>
      <ng-container *ngFor="let user of users">
        <li *ngIf="user.visible">{{user.name}}</li>
      </ng-container>
    </ul>
  • .ng_placeholder files will be excluded from --output builds. .css and
    .html files will be excluded by default from the lib/ directory for
    release builds. Disable entirely with:

    targets:
      $default:
        angular|component_source_cleanup:
          options:
            enabled: false

    or exclude some sources by glob:

    targets:
      $default:
        angular|component_source_cleanup:
          options:
            exclude:
              - "lib/non_angular_style.css"
              - "lib/something/**"
  • @HostBinding() for static const or final fields are set at build
    time rather than being change-detected.

Bug fixes

  • Inheriting from a class that defines a @HostBinding() on a static member
    no longer causes the web compiler (Dartdevc or Dart2JS) to fail. We
    previously inherited these bindings and generated invalid Dart code. Given
    that static members are not inherited in the Dart language, it made sense
    to give a similar treatment to these annotations. Instance-level members are
    still inherited:

    class Base {
      @HostBinding('title')
      static const hostTitle = 'Hello';
    
      @HostBinding('class')
      final hostClass = 'fancy';
    }
    
    // Will have DOM of <fancy-button class="fancny"> but *not* title="Hello".
    @Component(
      selector: 'fancy-button',
      template: '...',
    )
    class FancyButton extends Base {}
  • Styles from an @import statement are now included before the styles
    declared within the file, instead of after. This allows a style declared
    within a file to override an imported one of equivalent specificity.

  • URLs from @import statements with the package scheme are no longer
    resolved to the packages/ directory. The package scheme is now preserved
    which the build ecosystem understands.

  • In ReflectiveInjector, .injectFromSelfOptional now checks if it is truly
    a instance cache misses before creating a new instance.

angular_ast

0.5.3

  • Exported ParsedAnnotationAst.

  • Added ContainerAst.

  • Annotations may now be assigned values.

  • Added support for annotations on ContainerAst.

  • The * micro-syntax now supports leading whitespace.

  • Whitespace between <ng-content> and </ng-content> will no longer yield a
    parsing error.

angular_compiler

0.4.0-alpha+12

  • Removes unused APIs of ComponentReader.
  • Added DirectiveVisitor, and removed $HostBinding and $HostListener.

angular_forms

2.0.0-alpha+4

New Features

  • Control.markAsPristine added. This will clear the dirty property.

Breaking Changes

  • NgControlName will no longer initialize with null if a value is
    specified by 'ngModel'.

  • The touched property of Controls is now propagated to parents /
    children.

Bug fixes

  • Add a not selector to ngForm for memorizedForm since memorized_form is now
    in angular_forms. This fixes the DIRECTIVE_EXPORTED_BY_AMBIGIOUS error when
    using: <form #form="ngForm" memorizedForm>

angular_test

2.0.0-alpha+10

  • Fixed a bug where _createDynamic does not preserve rootInjector.