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

5.0.0-alpha+10

Choose a tag to compare

@matanlurey matanlurey released this 10 Apr 19:41
· 1797 commits to master since this release

angular

5.0.0-alpha+10

Breaking changes

  • The minimum SDK version is now sdk: ">=2.0.0-dev.46.0 <2.0.0".

  • The process for starting your AngularDart application changed significantly:

    • For most applications, we recommend now strongly recommend using the new
      runApp function. Instead of starting your application by passing the
      Type of an @Component-annotated class, you now pass a
      ComponentFactory, the generated code for a component:

      import 'package:angular/angular.dart';
      
      // ignore: uri_has_not_been_generated
      import 'main.template.dart' as ng;
      
      void main() {
        runApp(ng.RootComponentNgFactory);
      }
      
      @Component(
        selector: 'root',
        template: 'Hello World',
      )
      class RootComponent {}

      To provide top-level services, use the createInjector parameter, and
      pass a generated InjectorFactory for a top-level annotated with
      @GenerateInjector:

      import 'package:angular/angular.dart';
      
      // ignore: uri_has_not_been_generated
      import 'main.template.dart' as ng;
      
      void main() {
        runApp(ng.RootComponentNgFactory, createInjector: rootInjector);
      }
      
      class HelloService {
        void sayHello() => print('Hello!');
      }
      
      @GenerateInjector(const [
        const ClassProvider(HelloService),
      ])
      final InjectorFactory rootInjector = ng.rootInjector$Injector;

      A major difference between runApp and previous bootstrapping code is
      the lack of the initReflector() method or call, which is no longer
      needed. That means using runApp disables the use of
      SlowComponentLoader and ReflectiveInjector, two APIs that require
      this extra runtime metadata.

      To enable use of these classes for migration purposes, use
      runAppLegacy:

      import 'package:angular/angular.dart';
      
      // ignore: uri_has_not_been_generated
      import 'main.template.dart' as ng;
      
      void main() {
        runAppLegacy(
          RootComponent,
          createInjectorFromProviders: [
            const ClassProvider(HelloService),
          ],
          initReflector: ng.initReflector,
        );
      }

      NOTE: initReflector and runAppLegacy disables tree-shaking on
      any class annotated with @Component or @Injectable. We strongly
      recommend migrating to the runApp pattern.

    • The APP_INITIALIZERS token was removed. The closest functionality
      (running a function that returns a Future before creating the root
      component) is using runAppAsync or runAppLegacyAsync functions with
      a befofreComponentCreated callback:

      import 'dart:async';
      
      import 'package:angular/angular.dart';
      
      // ignore: uri_has_not_been_generated
      import 'main.template.dart' as ng;
      
      Future<String> fetchSomeText() => ...
      
      void main() {
        runApp(
          ng.RootComponentNgFactory,
          beforeComponentCreated: (injector) {
            final prefetch = injector.get(Prefetch) as Prefetch;
            return prefetch.prefetchSomeData();
          },
          // @GenerateInjector could be used instead. This is a simple example.
          createInjector: (parent) {
            return new Injector.map({
              Prefetch: new Prefetch();
            }, parent);
          },
        );
      }
      
      @Component(
        selector: 'root',
        template: 'Hello World',
      )
      class RootComponent {}
      
      class Prefetch {
        Future<void> prefetchSomeData() => ...
      }
    • The top-level function bootstrap was deleted. This function always
      threw a runtime exception since 5.0.0-alpha+5, and was a relic of when
      a code transformer rewrote it automatically as bootstrapStatic.

    • The top-level function bootstrapStatic is now deprecated. The
      closest equivalent is the new runAppLegacy _or runAppLegacyAsync
      functions.

  • The interface PlatformRef (and PlatformRefImpl) were removed. They were
    not used, and added an unnecessary code-size overhead to every application.

  • Removed the deprecated QueryList class, List is used instead, only.

  • Removed ApplicationRef.registerBootstrapListener, which was unused.

New features

  • The compiler now warns when a @Component.styles seems to reference a file
    on disk, such as styles: const ['a.css'] (this is usually an accident). We
    already warned for template: 'a.html'.

  • Running within an angular zone will no longer cause addtional turns to occur
    within it's parent's zone. ngZone's run() will now run inside the parent
    zone's run() function as opposed to the other way around.

Internal cleanup

  • Add explicit error for when angular codegen is not invoked, the previous
    error was "Could not find a factory for X" but this is not the real issue
    since none of the factories had been loaded due to lack of angular codegen.

angular_ast

0.5.1

  • The minimum SDK version is now sdk: ">=2.0.0-dev.46.0 <2.0.0".

  • The * micro-syntax now supports binding to the primary input when followed
    by additional input or let bindings. Previously the micro-syntax supported
    binding to the primary input only in isolation.

    Example usage enabled by this change.

    Before:

    <template [foo]="expr1" [fooContext]="expr2">
      <div></div>
    </template>

    After:

    <div *foo="expr1; context: expr2"></div>

angular_compiler

0.4.0-alpha+10

  • Maintenance release.
  • The minimum SDK version is now sdk: ">=2.0.0-dev.46.0 <2.0.0".

angular_forms

2.0.0-alpha+2

Breaking Changes

  • The minimum SDK version is now sdk: ">=2.0.0-dev.46.0 <2.0.0".

  • Add ControlValueAccessor.onDisabledChanged() method. All implementations
    of ControlValueAccessor need to add this method.

  • Remove include and exclude methods from ControlGroup. These can be
    replaced with calls to markAsEnabled and markAsDisabled instead.

    Before: controlGroup.include('foo');

    After: controlGroup.controls['foo'].markAsEnabled();

  • CheckboxControlValueAccessor now implements ControlValueAccessor<bool>
    and RadioControlValueAccessor now implements
    ControlValueAccessor<RadioButtonState>. Previously, they were both
    ControlValueAccessor<dynamic>.

angular_router

2.0.0-alpha+10

Breaking changes

  • The minimum SDK version is now sdk: ">=2.0.0-dev.46.0 <2.0.0".

Bug fixes

  • Router navigation requests are now queued to ensure they'll run sequentially
    in the order they were requested. Previously no attempt was made to
    synchronise navigation requests, and if multiple were made simultaneously
    they could run concurrently, interfere with each other, and potentially
    complete out of order.

angular_test

2.0.0-alpha+8

  • The minimum SDK version is now sdk: ">=2.0.0-dev.46.0 <2.0.0".

  • DEPRECATED: throwsInAngular is now a no-op, and can be removed.