0.5.0 Changelog


Breaking Changes

0 Changes

Bugs

0 Bug Fixes

Released

Sep 15, 2016

Sketch template

Light Theme

Highlights

  • Upgrade Clarity Seed to Angular 2.0.0
    Upgrade Clarity to Angular 2.0.0

    Clarity 0.5.0 is in Angular 2.0.0 Final!

    Here are the recommended version numbers you could use in your package.json:

    
    "dependencies": {
        "@angular/common": "2.0.0",
        "@angular/compiler": "2.0.0",
        "@angular/core": "2.0.0",
        "@angular/forms": "2.0.0",
        "@angular/http": "2.0.0",
        "@angular/platform-browser": "2.0.0",
        "@angular/platform-browser-dynamic": "2.0.0",
        "@angular/router": "3.0.0",
        "@angular/upgrade": "2.0.0",
        ...
    }
    

    Declaring directives and pipes in components has been deprecated. That means you will no longer import Clarity directives in the components as you have done with previous versions like this:

    
    import {SOME_CLARITY_DIRECTIVE} from "clarity-angular";
    @Component({
        ...
        directives: [SOME_CLARITY_DIRECTIVE],
        ...
    });
    
    export class YourComponent {        }
    

    Instead, now an application that consumes Clarity should at least have one app-level module like below:

    
    import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    import { ClarityModule } from 'clarity-angular';
    import { AppComponent } from './app.component';
    
    @NgModule({
        imports: [
            BrowserModule,
            ClarityModule,
            ....(other modules from Angular or 3rd parties for your app)
        ],
        declarations: [ AppComponent ],
        bootstrap: [ AppComponent ]
    })
    
    export class AppModule {
    }
    

    Your dependencies (components, directives, pipes, services, etc) should be declared and exported through modules. Read more about NgModule.

    You can check out the latest version of Clarity seed to get a sample setup with the new module, routers, and testing setup. You can also check out this excellent seed that covers basic unit tests using TestBed.

    Please refer to Angular's CHANGELOG for a complete list of breaking changes that might impact your application.