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

Commit 9f71d2a

Browse files
committed
add manual @angular/upgrade install
1 parent f0d1641 commit 9f71d2a

15 files changed

+79
-16
lines changed

public/docs/_examples/_boilerplate/systemjs.config.js

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
2323
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
2424
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
25-
'@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js',
26-
'@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js',
2725

2826
// other libraries
2927
'rxjs': 'npm:rxjs',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/*.js
2+
aot/**/*
3+
!aot/bs-config.json
4+
!aot/index.html
5+
!copy-dist-files.js
6+
!rollup-config.js
7+
!systemjs.config.1.js

public/docs/_examples/upgrade-module/ts/index-1-2-hybrid-bootstrap.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1616
<script src="node_modules/systemjs/dist/system.src.js"></script>
1717

18-
<script src="systemjs.config.js"></script>
18+
<script src="systemjs.config.1.js"></script>
1919
<script>
2020
System.import('app/1-2-hybrid-bootstrap/app.module')
2121
.then(null, console.error.bind(console));

public/docs/_examples/upgrade-module/ts/index-1-to-2-projection.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1616
<script src="node_modules/systemjs/dist/system.src.js"></script>
1717

18-
<script src="systemjs.config.js"></script>
18+
<script src="systemjs.config.1.js"></script>
1919
<script>
2020
System.import('app/1-to-2-projection/app.module')
2121
.then(null, console.error.bind(console));

public/docs/_examples/upgrade-module/ts/index-1-to-2-providers.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1616
<script src="node_modules/systemjs/dist/system.src.js"></script>
1717

18-
<script src="systemjs.config.js"></script>
18+
<script src="systemjs.config.1.js"></script>
1919
<script>
2020
System.import('app/1-to-2-providers/app.module')
2121
.then(null, console.error.bind(console));

public/docs/_examples/upgrade-module/ts/index-2-to-1-providers.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1616
<script src="node_modules/systemjs/dist/system.src.js"></script>
1717

18-
<script src="systemjs.config.js"></script>
18+
<script src="systemjs.config.1.js"></script>
1919
<script>
2020
System.import('app/2-to-1-providers/app.module')
2121
.then(null, console.error.bind(console));

public/docs/_examples/upgrade-module/ts/index-2-to-1-transclusion.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1616
<script src="node_modules/systemjs/dist/system.src.js"></script>
1717

18-
<script src="systemjs.config.js"></script>
18+
<script src="systemjs.config.1.js"></script>
1919
<script>
2020
System.import('app/2-to-1-transclusion/app.module')
2121
.then(null, console.error.bind(console));

public/docs/_examples/upgrade-module/ts/index-divide-routes.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1717
<script src="node_modules/systemjs/dist/system.src.js"></script>
1818

19-
<script src="systemjs.config.js"></script>
19+
<script src="systemjs.config.1.js"></script>
2020
<script>
2121
System.import('app/divide-routes/main')
2222
.then(null, console.error.bind(console));

public/docs/_examples/upgrade-module/ts/index-downgrade-io.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1616
<script src="node_modules/systemjs/dist/system.src.js"></script>
1717

18-
<script src="systemjs.config.js"></script>
18+
<script src="systemjs.config.1.js"></script>
1919
<script>
2020
System.import('app/downgrade-io/app.module')
2121
.then(null, console.error.bind(console));

public/docs/_examples/upgrade-module/ts/index-downgrade-static.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1616
<script src="node_modules/systemjs/dist/system.src.js"></script>
1717

18-
<script src="systemjs.config.js"></script>
18+
<script src="systemjs.config.1.js"></script>
1919
<script>
2020
System.import('app/downgrade-static/app.module')
2121
.then(null, console.error.bind(console));

public/docs/_examples/upgrade-module/ts/index-upgrade-io.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1616
<script src="node_modules/systemjs/dist/system.src.js"></script>
1717

18-
<script src="systemjs.config.js"></script>
18+
<script src="systemjs.config.1.js"></script>
1919
<script>
2020
System.import('app/upgrade-io/app.module')
2121
.then(null, console.error.bind(console));

public/docs/_examples/upgrade-module/ts/index-upgrade-static.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1616
<script src="node_modules/systemjs/dist/system.src.js"></script>
1717

18-
<script src="systemjs.config.js"></script>
18+
<script src="systemjs.config.1.js"></script>
1919
<script>
2020
System.import('app/upgrade-static/app.module')
2121
.then(null, console.error.bind(console));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* System configuration for Angular samples
3+
* Adjust as necessary for your application needs.
4+
*/
5+
(function (global) {
6+
System.config({
7+
paths: {
8+
// paths serve as alias
9+
'npm:': 'node_modules/'
10+
},
11+
// map tells the System loader where to look for things
12+
map: {
13+
// our app is within the app folder
14+
app: 'app',
15+
// angular bundles
16+
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
17+
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
18+
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
19+
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
20+
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
21+
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
22+
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
23+
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
24+
// #docregion upgrade-static-umd
25+
'@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js',
26+
// #enddocregion upgrade-static-umd
27+
28+
// other libraries
29+
'rxjs': 'npm:rxjs',
30+
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'
31+
},
32+
// packages tells the System loader how to load when no filename and/or no extension
33+
packages: {
34+
app: {
35+
main: './main.js',
36+
defaultExtension: 'js'
37+
},
38+
rxjs: {
39+
defaultExtension: 'js'
40+
}
41+
}
42+
});
43+
})(this);

public/docs/_examples/upgrade-phonecat-2-hybrid/ts/systemjs.config.1.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
2222
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
2323
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
24-
'@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js',
24+
// #docregion paths
2525
'@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js',
26+
// #enddocregion paths
2627

2728
// other libraries
2829
'rxjs': 'npm:rxjs',

public/docs/ts/latest/guide/upgrade.jade

+17-3
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,12 @@ figure.image-display
456456

457457
+makeExample('upgrade-module/ts/app/1-2-hybrid-bootstrap/app.module.ts', 'bootstrap')
458458

459+
:marked
460+
We also need to install the `@angular/upgrade` package via `npm install @angular/upgrade --save`
461+
and add a mapping for the `@angular/upgrade/static` package:
462+
463+
+makeExample('upgrade-module/ts/systemjs.config.1.js', 'upgrade-static-umd', 'systemjs.config.js (map)')
464+
459465
:marked
460466
Congratulations! You're running a hybrid Angular 1+2 application! The
461467
existing Angular 1 code works as before _and_ you're ready to run Angular 2 code.
@@ -1122,8 +1128,12 @@ code-example(format="").
11221128

11231129
:marked
11241130
In the `systemjs.config.js` file we got from the Quickstart we also need to make a couple
1125-
of adjustments because of our project structure. We want to point the browser to the project
1126-
root when loading things through SystemJS, instead of using the `<base>` URL:
1131+
of adjustments because of our project structure.
1132+
We want to point the browser to the project root when loading things through SystemJS,
1133+
instead of using the `<base>` URL.
1134+
1135+
We also need to install the `upgrade` package via `npm install @angular/upgrade --save`
1136+
and add a mapping for the `@angular/upgrade/static` package.
11271137

11281138
+makeExample('upgrade-phonecat-2-hybrid/ts/systemjs.config.1.js', 'paths', 'systemjs.config.js')
11291139

@@ -1601,11 +1611,15 @@ code-example(format="").
16011611
* `app/core/phone/phone.module.ts`
16021612
* `app/phone-detail/phone-detail.module.ts`
16031613
* `app/phone-list/phone-list.module.ts`
1604-
1614+
16051615
The external typings for Angular 1 may be uninstalled as well. The only ones
16061616
we still need are for Jasmine and Angular 2 polyfills.
16071617

1618+
The `@angular/upgrade` package and it's mapping in `systemjs.config.js` can also go,
1619+
we don't need them anymore.
1620+
16081621
code-example(format="").
1622+
npm uninstall @angular/upgrade --save
16091623
npm uninstall @types/angular @types/angular-animate @types/angular-cookies @types/angular-mocks @types/angular-resource @types/angular-route @types/angular-sanitize --save-dev
16101624

16111625
:marked

0 commit comments

Comments
 (0)