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

3.0.0: Update changelog for v3 gold

Compare
Choose a tag to compare
@kevmoo kevmoo released this 27 Apr 17:08
· 3085 commits to master since this release

New features

  • composeValidators and composeAsyncValidators now part of the public API.
  • angular2/testing.dart includes a test-only isDebugMode function.
  • (Forms) AbstractControl.markAsDirty now emits a status change event.

Breaking changes

  • Requires at least Dart SDK 1.23.0.

  • Injecting null is no longer supported.

  • Remove unused useProperty argument in DI Provider api.

  • ReflectionCapabilities.isReflectionEnabled renamed to reflectionEnabled.

  • Malformed CSS warnings are errors now.

  • Removed forms async validators. Alternative:

    control.valueChange((value) {
      rpc.validate(change).then((errors) {
        if (errors != null) control.setErrors(errors);
      });
    });
  • Removed TitleService. To update the title, use dart:html:

    document.title = 'My title';
  • DynamicComponentLoader now has a simplified API:

    loadAsRoot, loadAsRootIntoNode replaced by a single load method that
    always creates the component root node instead of hoisting into an existing
    node.

  • Removed viewBindings from Component. This has been interchangeable with
    viewProviders for a while now.

    BEFORE: dart @Component(viewBindings: const [])

    AFTER: dart @Component(viewProviders: const [])

  • Removed EventManager from the public API. Code generation is now closer to
    document.addEventListener and having this interception layer would not
    allow further optimizations.

  • Removed IterableDifferFactory and KeyValueDifferFactory from the public
    API. We have planned compiler optimizations that will no longer allow
    overriding our diffing implementations. Looking into alternatives before a
    final 3.0.0 release that are lower cost.

  • ASYNC_VALIDATORS can no longer return a Stream instance, only Future.

  • The experimental NgTestBed was removed. Use package:angular_test now.

  • By default, the ExceptionHandler is a BrowserExceptionHandler, which
    prints exceptions to the console. If you don't want this behavior (i.e.
    releasing to production), make sure to override it.

  • ElementRef.nativeElement is now final (no setter).

  • DOM adapter is now completely removed from the API and generated code

  • A name parameter is now required for all @Pipe(...) definitions:

    BEFORE: dart @Pipe(name: 'uppercase')

    AFTER: dart @Pipe('uppercase')

  • DomEventsPlugin now requires a strongly typed interface to dart:html.

  • Null is no longer propagated as an initial change value. Code should be
    updated to either deliver a different initial value or components with an
    @Input() should have an appropriate default value.

    BEFORE

    <my-component [value]="null"></my-component>
    ...
    String _value;
    
    set value(String value) {
      _value = value ?? 'Default name';
    }

    AFTER

    String _value = 'Default name';
    
    set value(String value) { _value = value; }
  • Removed the isFirstChange() method of SimpleChange.
    Instead, check whether previousValue is null.

  • Removed NgPlural, deprecated as of 2.1.0.

  • Removed ObservableListDiffFactory, deprecated as of 2.1.0.

  • Event handlers are bound at initialization time. Therefore, the following
    will no longer work, because clickHandler is null during initialization.

    @Component(
        selector: 'my-component',
        template: '<div (click)="clickHandler($event)"></div>')
    class MyComponent {
      Function clickHandler;
    }
  • Removed Component.moduleId, which was unused.

Deprecations

  • @View will be removed in 4.0, only use @Component instead.
  • EventEmitter is now @Deprecated: Use Stream and StreamController.
  • ngSwitchCase replaces ngSwitchWhen (soft deprecation).
  • XHR is deprecated, along with the runtime/reflective compiler.
  • IterableDiffers and KeyValueDiffers are deprecated. The cost of looking
    up to see if a custom differ is available is too high for almost no use.
    Before they're removed, we'll have other customization options.

Bug fixes

  • Updated various documentation to make cleaner and use Dart, not TS, samples.
  • Perf: Added performance improvements around generated code and type inference.
  • Fix: Key-value differ now detects removals when first key moves.
  • Fix: <ng-content select="..."> does not emit incorrect code (regression).
  • Perf: Optimized how reflective providers are resolved on application startup.
  • ngSwitchWhen now properly compares identity in Dartium.
  • Component/Directive#selector is now a @required property.
  • Angular warns in the console if using Dartium without checked mode.
  • Various performance improvements for both code size and runtime.
  • Various Dart idiomatic/style guide updates to the codebase.
  • ngIf now throws again if the bound value changes during change detection.
  • Fixed a bug where the router didn't work on a root path in IE11.
  • Fixed generated code that caused a strong-mode warning on AppView<...>.
  • Fixed a bug where DDC didn't work properly with "pure" Pipes.
  • Some simple types are now propagated to the generated .template.dart file.
  • When setting up a new NgControl, valueAccessor no longer can throw an NPE
  • Re-enabled strong-mode analysis within the project, and fixed some errors.

Refactoring

  • We now use the formal <T> generic type syntax for methods, not /*<T>*/.
  • Removed NgZoneImpl, all the code exists in NgZone now.
  • We now generate specific code for view and content children (faster).
  • Projectable nodes now use the visitor pattern in AppView.
  • In generated .template.dart change detected primitives are typed.
  • Moved renderType as a static class member in generated code.