From 689f1061816b7ec00b35c0105a4db6e17b6fb1ed Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 23 Feb 2017 10:07:03 +0000 Subject: [PATCH] Update templates to TypeScript 2.2.1 and fix whatwg-fetch related errors. Fixes #705 --- .../npm/domain-task/package.json | 5 ++--- .../npm/domain-task/src/fetch.ts | 2 +- templates/Angular2Spa/package.json | 2 +- .../ClientApp/app/components/fetchdata/fetchdata.ts | 4 ---- templates/AureliaSpa/package.json | 3 +-- templates/AureliaSpa/tsconfig.json | 2 +- templates/KnockoutSpa/package.json | 3 +-- templates/KnockoutSpa/tsconfig.json | 2 +- templates/ReactReduxSpa/package.json | 5 ++--- templates/ReactReduxSpa/tsconfig.json | 2 +- templates/ReactSpa/package.json | 3 +-- 11 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/package.json b/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/package.json index 8014dfd..349bc98 100644 --- a/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/package.json +++ b/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/package.json @@ -1,6 +1,6 @@ { "name": "domain-task", - "version": "2.0.3", + "version": "3.0.0", "description": "Tracks outstanding operations for a logical thread of execution", "main": "index.js", "scripts": { @@ -22,8 +22,7 @@ }, "devDependencies": { "@types/node": "^6.0.42", - "@types/whatwg-fetch": "0.0.31", "rimraf": "^2.5.4", - "typescript": "^2.0.0" + "typescript": "^2.2.1" } } diff --git a/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/src/fetch.ts b/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/src/fetch.ts index 88b4b17..acca594 100644 --- a/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/src/fetch.ts +++ b/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/src/fetch.ts @@ -10,7 +10,7 @@ function issueRequest(baseUrl: string, req: string | Request, init?: RequestInit if (baseUrl) { if (req instanceof Request) { const reqAsRequest = req as Request; - reqAsRequest.url = url.resolve(baseUrl, reqAsRequest.url); + (reqAsRequest as any).url = url.resolve(baseUrl, reqAsRequest.url); } else { req = url.resolve(baseUrl, req as string); } diff --git a/templates/Angular2Spa/package.json b/templates/Angular2Spa/package.json index 63d695c..ea5c26b 100644 --- a/templates/Angular2Spa/package.json +++ b/templates/Angular2Spa/package.json @@ -40,7 +40,7 @@ "rxjs": "^5.0.1", "style-loader": "^0.13.1", "to-string-loader": "^1.1.5", - "typescript": "^2.0.3", + "typescript": "^2.2.1", "url-loader": "^0.5.7", "webpack": "^2.2.0", "webpack-hot-middleware": "^2.12.2", diff --git a/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.ts b/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.ts index 66cb447..ff86025 100644 --- a/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.ts +++ b/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.ts @@ -1,7 +1,3 @@ -// The following line is a workaround for aurelia-fetch-client requiring the type UrlSearchParams -// to exist in global scope, but that type not being declared in any public @types/* package. -/// - import { HttpClient } from 'aurelia-fetch-client'; import { inject } from 'aurelia-framework'; diff --git a/templates/AureliaSpa/package.json b/templates/AureliaSpa/package.json index 7b64027..912b7a3 100644 --- a/templates/AureliaSpa/package.json +++ b/templates/AureliaSpa/package.json @@ -22,7 +22,6 @@ }, "devDependencies": { "@types/node": "^6.0.45", - "@types/whatwg-fetch": "0.0.32", "aspnet-webpack": "^1.0.11", "aurelia-webpack-plugin": "^1.1.0", "copy-webpack-plugin": "^3.0.1", @@ -38,7 +37,7 @@ "style-loader": "^0.13.1", "to-string-loader": "^1.1.5", "ts-loader": "^0.8.2", - "typescript": "^2.0.0", + "typescript": "^2.2.1", "url-loader": "^0.5.7", "webpack": "2.1.0-beta.25", "webpack-hot-middleware": "^2.10.0" diff --git a/templates/AureliaSpa/tsconfig.json b/templates/AureliaSpa/tsconfig.json index 71d738e..94b22fc 100644 --- a/templates/AureliaSpa/tsconfig.json +++ b/templates/AureliaSpa/tsconfig.json @@ -7,7 +7,7 @@ "emitDecoratorMetadata": true, "skipDefaultLibCheck": true, "lib": [ "es6", "dom" ], - "types": [ "node", "whatwg-fetch" ] + "types": [ "node" ] }, "exclude": [ "bin", "node_modules" ], "atom": { "rewriteTsconfig": false } diff --git a/templates/KnockoutSpa/package.json b/templates/KnockoutSpa/package.json index 8b5ead8..714b423 100644 --- a/templates/KnockoutSpa/package.json +++ b/templates/KnockoutSpa/package.json @@ -11,7 +11,6 @@ "@types/react-router": "^2.0.37", "@types/requirejs": "^2.1.26", "@types/signals": "0.0.16", - "@types/whatwg-fetch": "0.0.30", "aspnet-webpack": "^1.0.27", "awesome-typescript-loader": "3.0.0-beta.13 || ^3.0.0", "bootstrap": "^3.3.6", @@ -28,7 +27,7 @@ "knockout": "^3.4.0", "raw-loader": "^0.5.1", "style-loader": "^0.13.1", - "typescript": "^2.0.3", + "typescript": "^2.2.1", "url-loader": "^0.5.7", "webpack": "^2.2.0", "webpack-hot-middleware": "^2.12.2" diff --git a/templates/KnockoutSpa/tsconfig.json b/templates/KnockoutSpa/tsconfig.json index d94f03b..7022bac 100644 --- a/templates/KnockoutSpa/tsconfig.json +++ b/templates/KnockoutSpa/tsconfig.json @@ -4,7 +4,7 @@ "target": "es5", "sourceMap": true, "skipDefaultLibCheck": true, - "types": ["es6-promise", "history", "requirejs", "whatwg-fetch"] + "types": ["es6-promise", "history", "requirejs"] }, "exclude": [ "bin", diff --git a/templates/ReactReduxSpa/package.json b/templates/ReactReduxSpa/package.json index 8ac1a1a..f96a27f 100644 --- a/templates/ReactReduxSpa/package.json +++ b/templates/ReactReduxSpa/package.json @@ -11,7 +11,6 @@ "@types/redux": "3.5.27", "@types/webpack": "^2.2.0", "@types/webpack-env": "^1.13.0", - "@types/whatwg-fetch": "0.0.28", "aspnet-prerendering": "^2.0.0", "aspnet-webpack": "^1.0.27", "aspnet-webpack-react": "^1.0.4", @@ -22,7 +21,7 @@ "babel-preset-react": "^6.5.0", "bootstrap": "^3.3.6", "css-loader": "^0.23.1", - "domain-task": "^2.0.1", + "domain-task": "^3.0.0", "event-source-polyfill": "^0.0.7", "extract-text-webpack-plugin": "^2.0.0-rc", "file-loader": "^0.8.5", @@ -37,7 +36,7 @@ "redux": "^3.6.0", "redux-thunk": "^2.2.0", "style-loader": "^0.13.0", - "typescript": "^2.0.3", + "typescript": "^2.2.1", "url-loader": "^0.5.7", "webpack": "^2.2.0", "webpack-hot-middleware": "^2.12.2", diff --git a/templates/ReactReduxSpa/tsconfig.json b/templates/ReactReduxSpa/tsconfig.json index 423bd16..5d357ae 100644 --- a/templates/ReactReduxSpa/tsconfig.json +++ b/templates/ReactReduxSpa/tsconfig.json @@ -8,7 +8,7 @@ "sourceMap": true, "skipDefaultLibCheck": true, "lib": ["es6", "dom"], - "types": [ "webpack-env", "whatwg-fetch" ], + "types": [ "webpack-env" ], "paths": { // Fix "Duplicate identifier" errors caused by multiple dependencies fetching their own copies of type definitions. // We tell TypeScript which type definitions module to treat as the canonical one (instead of combining all of them). diff --git a/templates/ReactSpa/package.json b/templates/ReactSpa/package.json index ba8611f..a261303 100644 --- a/templates/ReactSpa/package.json +++ b/templates/ReactSpa/package.json @@ -3,7 +3,6 @@ "version": "0.0.0", "devDependencies": { "@types/history": "^2.0.39", - "@types/isomorphic-fetch": "0.0.31", "@types/react": "^0.14.38", "@types/react-dom": "^0.14.17", "@types/react-router": "^2.0.38", @@ -26,7 +25,7 @@ "react-dom": "^15.3.2", "react-router": "^2.8.1", "style-loader": "^0.13.1", - "typescript": "^2.0.3", + "typescript": "^2.2.1", "url-loader": "^0.5.7", "webpack": "^2.2.0", "webpack-hot-middleware": "^2.12.2"