Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

docs(upgrade): Use NgUpgrade static #2781

Merged
merged 38 commits into from
Nov 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2b235fb
re-enable upgrade-adapter and upgrade-phonecat-1 tests
filipesilva Nov 8, 2016
cb3d3b3
re-enable upgrade-phonecat-2 tests
filipesilva Nov 8, 2016
6e5b8a4
add hybrid toggle switch to helpers
filipesilva Nov 9, 2016
e9469e5
use 2.2.0-rc.0
filipesilva Nov 9, 2016
b0ca4f5
revert change to browser.ignoreSynchronization
filipesilva Nov 9, 2016
e990594
convert 1-2-hybrid-bootstrap to upgrade/static
filipesilva Nov 9, 2016
89a9529
remove shared adapter example
filipesilva Nov 9, 2016
455f2f6
add systemjs config extras to all indexes
filipesilva Nov 9, 2016
f958661
update upgrade-static
filipesilva Nov 9, 2016
2117d40
update upgrade-io example
filipesilva Nov 10, 2016
e4bb6ce
update downgrade-static
filipesilva Nov 10, 2016
71cd604
update downgrade-io
filipesilva Nov 10, 2016
476ccf0
update 1-to-2-projection
filipesilva Nov 10, 2016
f63649a
update 2-to-1-transclusion
filipesilva Nov 10, 2016
2bd3a6e
update 1-to-2-providers
filipesilva Nov 10, 2016
03d877d
update 2-to-1-providers
filipesilva Nov 10, 2016
c3b9cb3
cleanup upgrade-adapter e2e test
filipesilva Nov 10, 2016
c7487be
re-enable upgrade-adapter tests
filipesilva Nov 10, 2016
16c1837
change HeroDetailComponent to HeroDetailDirective
filipesilva Nov 10, 2016
e710481
fix missing systemjs.config.extras
filipesilva Nov 10, 2016
b342d24
add typing to UpgradeModule DI
filipesilva Nov 12, 2016
1af3570
update upgrade-phonecat-2-hybrid
filipesilva Nov 12, 2016
37b57fa
update upgrade-adapter's prose
filipesilva Nov 12, 2016
8e27ff9
rename upgrade-adapter example to upgrade-module
filipesilva Nov 12, 2016
4ac5e60
improve angular1 type declaration in hybrid apps
filipesilva Nov 12, 2016
1d81dad
remove unused imports in protractor-helpers
filipesilva Nov 12, 2016
654f6cf
update phonecat-hybrid bootstrap prose
filipesilva Nov 12, 2016
8f23969
update phonecat-hybrid service and components
filipesilva Nov 12, 2016
0985055
update phonecat-final prose
filipesilva Nov 12, 2016
59c9a6f
update e2e prose
filipesilva Nov 12, 2016
0d74c93
update systemjs.config.js to have @angular/upgrade/static by default
filipesilva Nov 12, 2016
b0c4422
add aot (WIP)
filipesilva Nov 14, 2016
04b88d5
remove wip aot changes from test run
filipesilva Nov 14, 2016
84ca050
change let to const in bootstrap
filipesilva Nov 14, 2016
b87a0ea
elaborate upgraded component alert
filipesilva Nov 14, 2016
5fa0b69
use 2.2.0 versions instead of rc0
filipesilva Nov 14, 2016
eb60bfe
Squashed commit of the following:
filipesilva Nov 15, 2016
2b286b3
deactivate bugged tests
filipesilva Nov 15, 2016
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public/docs/xref-*.*
_zip-output
www*
npm-debug*.log*
**/debug.log
*.plnkr.html
plnkr.html
*.eplnkr.html
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
- DBUS_SESSION_BUS_ADDRESS=/dev/null
- DISPLAY=:99.0
- CHROME_BIN=chromium-browser
- LATEST_RELEASE=2.1.1
- LATEST_RELEASE=2.2.0
- TASK_FLAGS="--dgeni-log=warn"
matrix:
- TASK=lint
Expand Down
13 changes: 7 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,16 @@ function findAndRunE2eTests(filter, outputFile) {
e2eSpecPaths.forEach(function(specPath) {
// get all of the examples under each dir where a pcFilename is found
localExamplePaths = getExamplePaths(specPath, true);
// Filter by language
localExamplePaths = localExamplePaths.filter(function (fn) {
return fn.match('/'+lang+'$') != null;
});
// Filter by example name
if (filter) {
localExamplePaths = localExamplePaths.filter(function (fn) {
return fn.match(filter) != null;
})
}
// Filter by language, also supports variations like js-es6
localExamplePaths = localExamplePaths.filter(function (fn) {
return fn.match('/'+lang+'(?:-[^/]*)?$') != null;
});
localExamplePaths.forEach(function(examplePath) {
examplePaths.push(examplePath);
})
Expand Down Expand Up @@ -754,7 +755,7 @@ gulp.task('check-deploy', ['firebase-use-proj-check', 'build-docs'], () => {
}).then(function(shouldDeploy) {
if (shouldDeploy) {
gutil.log('deploying...');
return execPromise(`firebase deploy -p ${WWW}`);
return execPromise('firebase deploy');
} else {
return ['Not deploying'];
}
Expand Down Expand Up @@ -1270,7 +1271,7 @@ function apiExamplesWatch(postShredAction) {
}

function devGuideExamplesWatch(shredOptions, postShredAction, focus) {
var watchPattern = focus ? '**/{' + focus + ',cb-' + focus+ '}/**/*.*' : '**/*.*';
var watchPattern = focus ? '{' + focus + ',cb-' + focus+ '}/**/*.*' : '**/*.*';
var includePattern = path.join(shredOptions.examplesDir, watchPattern);
// removed this version because gulp.watch has the same glob issue that dgeni has.
// var excludePattern = '!' + path.join(shredOptions.examplesDir, '**/node_modules/**/*.*');
Expand Down
6 changes: 3 additions & 3 deletions harp.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"picture": "/resources/images/bios/naomi.jpg",
"twitter": "naomitraveller",
"website": "http://google.com/+NaomiBlack",
"bio": "Naomi is Angular's TPM generalist and jack-of-all-trades. She leads Angular Material and AngularDart, and acts as webmaster for angular.io. She's been at Google since 2006, as a technical program manager on projects ranging from Accessibility to Google Transit. She fights daleks in her spare time.",
"bio": "Naomi is Angular's TPM generalist and jack-of-all-trades. She leads Angular's global programs (including localization), supports Angular's internal Google users, and acts as webmaster for angular.io and angular.cn. She's been at Google since 2006, as a technical program manager on projects ranging from Accessibility to Google Transit. She fights daleks in her spare time.",
"type": "Lead"
},

Expand All @@ -38,7 +38,7 @@
"picture": "/resources/images/bios/brad-green.jpg",
"twitter": "bradlygreen",
"website": "https://plus.google.com/+BradGreen",
"bio": "Brad Green works at Google as an engineering director. Brad manages the Google Sales Platform suite of projects as well as the AngularJS framework. Prior to Google, Brad worked on the early mobile web at AvantGo, founded and sold startups, and spent a few hard years toiling as a caterer. Brad's first job out of school was as lackey to Steve Jobs at NeXT Computer writing demo software and designing his slide presentations. Brad lives in Mountain View, CA with his wife and two children.",
"bio": "Brad Green works at Google as an engineering director. Brad manages the Google Sales Platform suite of projects as well as the AngularJS framework. Prior to Google, Brad worked on the early mobile web at AvantGo, founded and sold startups, and spent a few hard years toiling as a caterer. Brad's first job out of school was as lackey to Steve Jobs at NeXT Computer writing demo software and designing his slide presentations. Brad enjoys throwing dinner parties with his wife Heather and putting on plays with his children.",
"type": "Lead"
},

Expand All @@ -47,7 +47,7 @@
"picture": "/resources/images/bios/juleskremer.jpg",
"twitter": "jules_kremer",
"website": "https://plus.google.com/+JulesKremer",
"bio": "Jules is a TPM on the Angular team. When not working with developers, Jules is often bending into pretzel-like shapes, climbing mountains or drinking really awesome beer.",
"bio": "Jules is Head of Angular Developer Relations at Google. When not working with developers, Jules is often bending into pretzel-like shapes, climbing mountains or drinking really awesome beer.",
"type": "Lead"
},

Expand Down
2 changes: 1 addition & 1 deletion public/_includes/_footer.jade
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ div(class="main-footer" data-swiftype-index="false")
// TODO: (ericjim) make a libraries page to showcase all angular libraries
//li <a href="/libraries.html">Libraries</a>
li <a href="/about/">About</a>
li <a href="/resources/">Books & Training</a>
li <a href="/resources/#Education">Books & Training</a>
li <a href="/resources/">Tools & Libraries</a>
li <a href="/resources/">Community</a>
li <a href="/presskit.html">Press Kit</a>
Expand Down
2 changes: 2 additions & 0 deletions public/docs/_examples/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ wallaby.js

_test-output
**/ts/**/*.js
**/js-es6*/**/*.js
**/ts-snippets/**/*.js
*.d.ts

!**/*e2e-spec.js
!systemjs.config.1.js
!**/systemjs.config.extras.js
!_boilerplate/*
_boilerplate/a2docs.css
1 change: 1 addition & 0 deletions public/docs/_examples/_boilerplate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"build:webpack": "rimraf dist && webpack --config config/webpack.prod.js --bail",
"build:cli": "ng build",
"build:aot": "ngc -p tsconfig-aot.json && rollup -c rollup-config.js",
"build:babel": "babel app -d app --extensions \".es6\" --source-maps",
"copy-dist-files": "node ./copy-dist-files.js",
"i18n": "ng-xi18n"
},
Expand Down
1 change: 1 addition & 0 deletions public/docs/_examples/_boilerplate/systemjs.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
'@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js',
'@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js',

// other libraries
'rxjs': 'npm:rxjs',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
'@angular/router': 'ng:router-builds/master/bundles/router.umd.js',
'@angular/forms': 'ng:forms-builds/master/bundles/forms.umd.js',
'@angular/upgrade': 'ng:upgrade-builds/master/bundles/upgrade.umd.js',
'@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js',

// angular testing umd bundles (overwrite the shim mappings)
'@angular/core/testing': 'ng:core-builds/master/bundles/core-testing.umd.js',
Expand Down
1 change: 1 addition & 0 deletions public/docs/_examples/_boilerplate/systemjs.config.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
'@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js',
'@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js',

// other libraries
'rxjs': 'npm:rxjs',
Expand Down
18 changes: 9 additions & 9 deletions public/docs/_examples/cb-ts-to-js/e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'; // necessary for es6 output in node
'use strict'; // necessary for es6 output in node

import { browser, element, by } from 'protractor';

Expand All @@ -9,7 +9,7 @@ describe('TypeScript to Javascript tests', function () {
});

it('should display the basic component example', function () {
testTag('hero-view', 'Hero: Windstorm');
testTag('hero-view', 'Hero Detail: Windstorm');
});

it('should display the component example with lifecycle methods', function () {
Expand All @@ -36,7 +36,7 @@ describe('TypeScript to Javascript tests', function () {

it('should support component with inputs and outputs', function () {
let app = element(by.css('hero-io'));
let confirmComponent = app.element(by.css('my-confirm'));
let confirmComponent = app.element(by.css('app-confirm'));

confirmComponent.element(by.buttonText('OK')).click();
expect(app.element(by.cssContainingText('span', 'OK clicked')).isPresent()).toBe(true);
Expand All @@ -46,11 +46,11 @@ describe('TypeScript to Javascript tests', function () {
});

it('should support host bindings and host listeners', function() {
let app = element(by.css('heroes-bindings'));
let app = element(by.css('hero-host'));
let h1 = app.element(by.css('h1'));

expect(app.getAttribute('class')).toBe('heading');
expect(app.getAttribute('title')).toBe('Tooltip content');
expect(app.getAttribute('title')).toContain('Tooltip');

h1.click();
expect(h1.getAttribute('class')).toBe('active');
Expand All @@ -61,12 +61,12 @@ describe('TypeScript to Javascript tests', function () {
});

it('should support content and view queries', function() {
let app = element(by.css('heroes-queries'));
let windstorm = app.element(by.css('a-hero:first-child'));
let app = element(by.css('hero-queries'));
let windstorm = app.element(by.css('view-child:first-child'));

app.element(by.buttonText('Activate')).click();
app.element(by.css('button')).click();
expect(windstorm.element(by.css('h2')).getAttribute('class')).toBe('active');
expect(windstorm.element(by.css('active-label')).getText()).toBe('Active');
expect(windstorm.element(by.css('content-child')).getText()).toBe('Active');
});

function testTag(selector: string, expectedText: string) {
Expand Down
6 changes: 6 additions & 0 deletions public/docs/_examples/cb-ts-to-js/js-es6-decorators/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"es2015",
"angular2"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component } from '@angular/core';

@Component({
moduleId: module.id,
selector: 'my-app',
templateUrl: 'app.component.html',
styles: [
// See hero-di-inject-additional.component
'hero-host, hero-host-meta { border: 1px dashed black; display: block; padding: 4px;}',
'.heading {font-style: italic}'
]
})
export class AppComponent {
title = 'ES6 JavaScript with Decorators';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<a id="toc"></a>
<h1>{{title}}</h1>
<a href="#class-metadata">Classes and Class Metadata</a><br>
<a href="#io-metadata">Input and Output Decorators</a><br>
<a href="#dependency-injection">Dependency Injection</a><br>
<a href="#host-metadata">Host Metadata</a><br>
<a href="#view-child-metadata">View and Child Metadata</a><br>

<hr>
<h4 id="class-metadata">Classes and Class Metadata</h4>
<hero-view></hero-view>
<hero-lifecycle></hero-lifecycle>

<hr>
<h4 id="io-metadata">Input and Output Metadata</h4>
<hero-io></hero-io>

<hr>
<h4 id="dependency-injection">Dependency Injection</h4>
<hero-di></hero-di>
<hero-di-inject></hero-di-inject>
<hero-di-inject-additional></hero-di-inject-additional>

<hr>
<h4 id="host-metadata">Host Metadata</h4>
<hero-host></hero-host>
<hero-host-meta></hero-host-meta>

<hr>
<h4 id="view-child-metadata">View and Child Metadata</h4>
<hero-queries></hero-queries>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppComponent } from './app.component';
import { ConfirmComponent } from './confirm.component';
// #docregion appimport
import { HeroComponent } from './hero.component';
// #enddocregion appimport
import { HeroComponent as HeroDIComponent } from './hero-di.component';
import { HeroComponent as HeroDIInjectComponent } from './hero-di-inject.component';
import { HeroComponent as HeroDIInjectAdditionalComponent } from './hero-di-inject-additional.component';
import { HeroHostComponent } from './hero-host.component';
import { HeroHostMetaComponent } from './hero-host-meta.component';
import { HeroIOComponent } from './hero-io.component';
import { HeroComponent as HeroLifecycleComponent } from './hero-lifecycle.component';
import { HeroQueriesComponent, ViewChildComponent, ContentChildComponent } from './hero-queries.component';
import { HeroTitleComponent } from './hero-title.component';

import { DataService } from './data.service';

@NgModule({
imports: [
BrowserModule
],
declarations: [
AppComponent,
ConfirmComponent,
HeroComponent,
HeroDIComponent,
HeroDIInjectComponent,
HeroDIInjectAdditionalComponent,
HeroHostComponent, HeroHostMetaComponent,
HeroIOComponent,
HeroLifecycleComponent,
HeroQueriesComponent, ViewChildComponent, ContentChildComponent,
HeroTitleComponent
],
providers: [
DataService,
{ provide: 'heroName', useValue: 'Windstorm' }
],
bootstrap: [ AppComponent ],

// schemas: [ NO_ERRORS_SCHEMA ] // helpful for debugging
})
export class AppModule { }

/* tslint:disable no-unused-variable */
// #docregion ng2import
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import {
LocationStrategy,
HashLocationStrategy
} from '@angular/common';
// #enddocregion ng2import
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';

// #docregion
@Component({
moduleId: module.id,
selector: 'app-confirm',
templateUrl: 'confirm.component.html'
})
export class ConfirmComponent {
@Input() okMsg = '';
@Input('cancelMsg') notOkMsg = '';
@Output() ok = new EventEmitter();
@Output('cancel') notOk = new EventEmitter();

onOkClick() {
this.ok.emit(true);
}
onNotOkClick() {
this.notOk.emit(true);
}
}
// #enddocregion
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<button (click)="onOkClick()">
{{okMsg}}
</button>
<button (click)="onNotOkClick()">
{{notOkMsg}}
</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Injectable } from '@angular/core';

@Injectable()
export class DataService {
constructor() { }

getHeroName() {
return 'Windstorm';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Component } from '@angular/core';

@Component({
selector: 'hero-di-inject-additional',
template: `<hero-title title="Tour of Heroes"></hero-title>`
})
export class HeroComponent { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Component, Inject } from '@angular/core';

// #docregion
@Component({
selector: 'hero-di-inject',
template: `<h1>Hero: {{name}}</h1>`
})
export class HeroComponent {
constructor(@Inject('heroName') name) {
this.name = name;
}
}
// #enddocregion
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component } from '@angular/core';
import { DataService } from './data.service';

// #docregion
@Component({
selector: 'hero-di',
template: `<h1>Hero: {{name}}</h1>`
})
export class HeroComponent {
name = '';
constructor(dataService: DataService) {
this.name = dataService.getHeroName();
}
}
// #enddocregion
Loading