Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

(chore) upgrade to rc5 #115

Merged
merged 2 commits into from
Aug 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@
"webpack-merge": "^0.8.4"
},
"dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "3.0.0-beta.2",
"@angular/common": "2.0.0-rc.5",
"@angular/compiler": "2.0.0-rc.5",
"@angular/core": "2.0.0-rc.5",
"@angular/http": "2.0.0-rc.5",
"@angular/compiler-cli": "0.5.0",
"@angular/platform-server": "2.0.0-rc.5",
"@angular/forms": "0.3.0",
"@angular/platform-browser": "2.0.0-rc.5",
"typescript": "^1.9.0-dev",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a mandatory change to update to RC5? If not please revert.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here I need your guidance, the things that are new here apart from the rc5 update are :

  • the inclusion of the forms module ( consider that when this seed was initially created the same functionality was included in common... I'd argue it needs to be in any seed
  • the inclusion of the compiler-cli module - to allow AoT compilation and it's dependent on typscript which is also included
  • the inclusion of platform-server for use of AoT compiler via node

so please guide me whether to omit some or all of these, the rc5 ver change obviously needs to to be kept..,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep forms if we are using them. Let's not go into AoT in this PR. Let's focus on a minimal set of changes to get RC5 compatibility. Baby steps :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. Ok another commit will be done.. will you want me to force push a rebased version to have only one commit ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"@angular/platform-browser-dynamic": "2.0.0-rc.5",
"@angular/router": "3.0.0-rc.1",
"core-js": "^2.2.0",
"ie-shim": "^0.1.0",
"rxjs": "5.0.0-beta.6",
Expand Down
3 changes: 0 additions & 3 deletions src/app/about/about.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import {Component} from '@angular/core';

@Component({
selector: 'about',
pipes: [],
providers: [],
directives: [],
styleUrls: ['./about.css'],
templateUrl: './about.html'
})
Expand Down
24 changes: 24 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {NgModule} from '@angular/core'
import {RouterModule} from "@angular/router";
import {rootRouterConfig} from "./app.routes";
import {AppComponent} from "./app";
import {Github} from "./github/shared/github";
import {FormsModule} from "@angular/forms";
import {BrowserModule} from "@angular/platform-browser";
import {HttpModule} from "@angular/http";
import {About} from './about/about';
import {Home} from './home/home';
import {RepoBrowser} from './github/repo-browser/repo-browser';
import {RepoList} from './github/repo-list/repo-list';
import {RepoDetail} from './github/repo-detail/repo-detail';
import {LocationStrategy, HashLocationStrategy} from '@angular/common';

@NgModule({
declarations: [AppComponent, About, RepoBrowser, RepoList, RepoDetail, Home],
imports : [BrowserModule, FormsModule, HttpModule, RouterModule.forRoot(rootRouterConfig)],
providers : [Github, {provide: LocationStrategy, useClass: HashLocationStrategy}],
bootstrap : [AppComponent]
})
export class AppModule {

}
31 changes: 15 additions & 16 deletions src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import { provideRouter, RouterConfig } from '@angular/router';

import {Routes} from '@angular/router';
import {About} from './about/about';
import {Home} from './home/home';
import {RepoBrowser} from './github/repo-browser/repo-browser';
import {RepoList} from './github/repo-list/repo-list';
import {RepoDetail} from './github/repo-detail/repo-detail';

const routes: RouterConfig = [
{ path: '', redirectTo: 'home', terminal: true },
{ path: 'home', component: Home },
{ path: 'about', component: About },
{ path: 'github', component: RepoBrowser, children: [
{ path: ':org', component: RepoList, children: [
{ path: ':repo', component: RepoDetail },
{ path: '', component: RepoDetail }
]},
{ path: '', component: RepoList}
]}
export const rootRouterConfig: Routes = [
{path: '', redirectTo: 'home', terminal: true},
{path: 'home', component: Home},
{path: 'about', component: About},
{path: 'github', component: RepoBrowser,
children: [
{path: '', component: RepoList},
{path: ':org', component: RepoList,
children: [
{path: '', component: RepoDetail},
{path: ':repo', component: RepoDetail}
]
}]
}
];

export const APP_ROUTER_PROVIDERS = [
provideRouter(routes)
];
12 changes: 3 additions & 9 deletions src/app/app.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import { Component } from '@angular/core';
import { ROUTER_DIRECTIVES } from '@angular/router';
import {Component} from '@angular/core';

@Component({
selector: 'app',
pipes: [],
providers: [],
directives: [ ROUTER_DIRECTIVES ],
selector : 'app',
templateUrl: './app.html',
})
export class App {
constructor() {}

export class AppComponent {
}
8 changes: 3 additions & 5 deletions src/app/github/repo-browser/repo-browser.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { Component } from '@angular/core';
import { Router, ROUTER_DIRECTIVES } from '@angular/router';
import { Router } from '@angular/router';
import { Github } from '../shared/github';

@Component({
selector: 'repo-browser',
pipes: [],
providers: [ Github ],
directives: [ ROUTER_DIRECTIVES ],
templateUrl: './repo-browser.html',
styleUrls: ['./repo-browser.css']
})
export class RepoBrowser {

constructor(private router: Router, private github: Github) {}
constructor(private router: Router, private github: Github) {
}

searchForOrg(orgName: string) {
this.github.getOrg(orgName)
Expand Down
5 changes: 1 addition & 4 deletions src/app/github/repo-detail/repo-detail.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import {Component, OnInit} from '@angular/core';
import {ROUTER_DIRECTIVES, ActivatedRoute, Router} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router';
import {Github} from '../shared/github';

@Component({
selector: 'repo-detail',
pipes: [],
providers: [],
directives: [ROUTER_DIRECTIVES],
styleUrls: ['./repo-detail.css'],
templateUrl: './repo-detail.html'
})
Expand Down
5 changes: 1 addition & 4 deletions src/app/github/repo-list/repo-list.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import {Component, OnInit} from '@angular/core';
import {Github} from '../shared/github';
import {Observable} from 'rxjs/Observable';
import {ROUTER_DIRECTIVES, ActivatedRoute} from '@angular/router';
import {ActivatedRoute} from '@angular/router';

@Component({
selector: 'repo-list',
pipes: [],
providers: [],
directives: [ ROUTER_DIRECTIVES ],
styleUrls: ['./repo-list.css'],
templateUrl: './repo-list.html',
})
Expand Down
3 changes: 0 additions & 3 deletions src/app/home/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import {Component} from '@angular/core';

@Component({
selector: 'home',
pipes: [],
providers: [],
directives: [],
styleUrls: ['./home.css'],
templateUrl: './home.html'
})
Expand Down
19 changes: 4 additions & 15 deletions src/main.browser.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
import {LocationStrategy, HashLocationStrategy} from '@angular/common';
import {bootstrap} from '@angular/platform-browser-dynamic';
import {HTTP_PROVIDERS} from '@angular/http';
// import {enableProdMode} from '@angular/core';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {AppModule} from './app/app.module';

import {APP_ROUTER_PROVIDERS} from './app/app.routes';
import {App} from './app/app';

// enableProdMode()

bootstrap(App, [
HTTP_PROVIDERS,
APP_ROUTER_PROVIDERS,
{ provide: LocationStrategy, useClass: HashLocationStrategy }
])
.catch(err => console.error(err));
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));