Skip to content

Commit d1198ae

Browse files
Merge branch 'rel/2.0.0-templates' into dev
2 parents a9ddf14 + 9528dd7 commit d1198ae

32 files changed

+102
-94
lines changed

‎templates/AngularSpa/ClientApp/boot.browser.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import{enableProdMode } from '@angular/core'
55
import{platformBrowserDynamic}from'@angular/platform-browser-dynamic';
66
import{AppModule}from'./app/app.module.browser';
77

8-
if(module['hot']){
9-
module['hot'].accept();
10-
module['hot'].dispose(()=>{
8+
if(module.hot){
9+
module.hot.accept();
10+
module.hot.dispose(()=>{
1111
// Before restarting the app, we create a new root element and dispose the old one
1212
constoldRootElem=document.querySelector('app');
1313
constnewRootElem=document.createElement('app');
14-
oldRootElem.parentNode.insertBefore(newRootElem,oldRootElem);
14+
oldRootElem!.parentNode!.insertBefore(newRootElem,oldRootElem);
1515
modulePromise.then(appModule=>appModule.destroy());
1616
});
1717
}else{

‎templates/AngularSpa/ClientApp/boot.server.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ export default createServerRenderer(params =>{
1717
];
1818

1919
returnplatformDynamicServer(providers).bootstrapModule(AppModule).then(moduleRef=>{
20-
constappRef=moduleRef.injector.get(ApplicationRef);
20+
constappRef: ApplicationRef=moduleRef.injector.get(ApplicationRef);
2121
conststate=moduleRef.injector.get(PlatformState);
2222
constzone=moduleRef.injector.get(NgZone);
2323

2424
returnnewPromise<RenderResult>((resolve,reject)=>{
25-
zone.onError.subscribe(errorInfo=>reject(errorInfo));
25+
zone.onError.subscribe((errorInfo: any)=>reject(errorInfo));
2626
appRef.isStable.first(isStable=>isStable).subscribe(()=>{
2727
// Because 'onStable' fires before 'onError', we have to delay slightly before
2828
// completing the request in case there's an error to report

‎templates/AngularSpa/npm-shrinkwrap.json‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎templates/AngularSpa/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@angular/platform-server": "4.2.5",
1919
"@angular/router": "4.2.5",
2020
"@ngtools/webpack": "1.5.0",
21-
"@types/node": "8.0.8",
21+
"@types/webpack-env": "1.13.0",
2222
"angular2-template-loader": "0.6.2",
2323
"aspnet-prerendering": "^3.0.1",
2424
"aspnet-webpack": "^2.0.1",

‎templates/AngularSpa/tsconfig.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
22
"compilerOptions":{
3+
"module": "es2015",
34
"moduleResolution": "node",
45
"target": "es5",
56
"sourceMap": true,
67
"experimentalDecorators": true,
78
"emitDecoratorMetadata": true,
89
"skipDefaultLibCheck": true,
10+
"skipLibCheck": true, // Workaround for https://github.com/angular/angular/issues/17863. Remove this if you upgrade to a fixed version of Angular.
11+
"strict": true,
912
"lib": [ "es6", "dom" ],
10-
"types": [ "node" ]
13+
"types": [ "webpack-env" ]
1114
},
1215
"exclude": [ "bin", "node_modules" ],
1316
"atom":{"rewriteTsconfig": false }

‎templates/AureliaSpa/npm-shrinkwrap.json‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎templates/AureliaSpa/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"jquery": "^3.2.1"
1515
},
1616
"devDependencies":{
17-
"@types/node": "^7.0.12",
17+
"@types/webpack-env": "^1.13.0",
1818
"aspnet-webpack": "^2.0.1",
1919
"aurelia-webpack-plugin": "^2.0.0-rc.2",
2020
"css-loader": "^0.28.0",

‎templates/AureliaSpa/tsconfig.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
22
"compilerOptions":{
3+
"module": "es2015",
34
"moduleResolution": "node",
45
"target": "es5",
56
"sourceMap": true,
67
"experimentalDecorators": true,
78
"emitDecoratorMetadata": true,
89
"skipDefaultLibCheck": true,
10+
"strict": true,
911
"lib": [ "es2015", "dom" ],
10-
"types": [ "node" ]
12+
"types": [ "webpack-env" ]
1113
},
1214
"exclude": [ "bin", "node_modules" ],
1315
"atom":{"rewriteTsconfig": false }

‎templates/KnockoutSpa/ClientApp/boot.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
import'./css/site.css';
22
import'bootstrap';
33
import*askofrom'knockout';
4+
import{createBrowserHistory}from'history';
45
import'./webpack-component-loader';
56
importAppRootComponentfrom'./components/app-root/app-root';
6-
constcreateHistory=require('history').createBrowserHistory;
7-
constbaseUrl=document.getElementsByTagName('base')[0].getAttribute('href');
7+
constbaseUrl=document.getElementsByTagName('base')[0].getAttribute('href')!;
88
constbasename=baseUrl.substring(0,baseUrl.length-1);// History component needs no trailing slash
99

1010
// Load and register the <app-root> component
1111
ko.components.register('app-root',AppRootComponent);
1212

1313
// Tell Knockout to start up an instance of your application
14-
ko.applyBindings({history: createHistory({ basename }), basename });
14+
ko.applyBindings({history: createBrowserHistory({ basename }), basename });
1515

1616
// Basic hot reloading support. Automatically reloads and restarts the Knockout app each time
1717
// you modify source files. This will not preserve any application state other than the URL.
18-
declarevarmodule: any;
1918
if(module.hot){
2019
module.hot.accept();
2120
module.hot.dispose(()=>ko.cleanNode(document.body));

‎templates/KnockoutSpa/ClientApp/router.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import*askofrom'knockout';
22
import*as$from'jquery';
33
import*asHistoryfrom'history';
4-
importcrossroads= require('crossroads');
4+
import*ascrossroadsfrom'crossroads';
55

66
// This module configures crossroads.js, a routing library. If you prefer, you
77
// can use any other routing library (or none at all) as Knockout is designed to
@@ -20,9 +20,9 @@ export class Router{
2020
// Reset and configure Crossroads so it matches routes and updates this.currentRoute
2121
crossroads.removeAllRoutes();
2222
crossroads.resetState();
23-
crossroads.normalizeFn=crossroads.NORM_AS_OBJECT;
23+
(crossroadsasany).normalizeFn=crossroads.NORM_AS_OBJECT;
2424
routes.forEach(route=>{
25-
crossroads.addRoute(route.url,(requestParams)=>{
25+
crossroads.addRoute(route.url,(requestParams: any)=>{
2626
this.currentRoute(ko.utils.extend(requestParams,route.params));
2727
});
2828
});

0 commit comments

Comments
(0)