From 304317e2de9930184261eebfe3c2e6d6bff7e346 Mon Sep 17 00:00:00 2001 From: dicky Date: Mon, 13 Sep 2021 21:56:21 -0700 Subject: [PATCH] Update SignalR client package (@aspnet/signalr -> @microsoft/signalr) --- DevApp.ViewModels/Docs/APIs/Connection.md | 2 +- .../Docs/FromScratchScriptTag.md | 2 +- DevApp.ViewModels/Docs/GetStarted.md | 2 +- .../Docs/Knockout/FromScratchScriptTag.md | 2 +- DevApp.ViewModels/Docs/Knockout/GetStarted.md | 2 +- .../Docs/Vue/FromScratchScriptTag.md | 2 +- DevApp.ViewModels/Docs/Vue/GetStarted.md | 2 +- DevApp/client/main.js | 2 +- DevApp/dist/package.json | 2 +- DevApp/package-lock.json | 122 ++++++++++-------- DevApp/package.json | 4 +- DevApp/src/dotnetify/_typings/index.ts | 2 +- DevApp/src/dotnetify/core/dotnetify-hub.ts | 114 ++++------------ DevApp/webpack.dist.config.js | 84 ++++++------ 14 files changed, 146 insertions(+), 198 deletions(-) diff --git a/DevApp.ViewModels/Docs/APIs/Connection.md b/DevApp.ViewModels/Docs/APIs/Connection.md index a61e47bd..7cbb11fc 100644 --- a/DevApp.ViewModels/Docs/APIs/Connection.md +++ b/DevApp.ViewModels/Docs/APIs/Connection.md @@ -75,7 +75,7 @@ Use **hubOptions.connectionBuilder** to gain access to the `HubConnectionBuilder For example, the following code will configure the client to use the MessagePack binary protocol: ```jsx -import { MessagePackHubProtocol } from '@aspnet/signalr-protocol-msgpack'; +import { MessagePackHubProtocol } from '@microsoft/signalr-protocol-msgpack'; const protocol = new MessagePackHubProtocol(); dotnetify.hubOptions.connectionBuilder = builder => builder.withHubProtocol(protocol); diff --git a/DevApp.ViewModels/Docs/FromScratchScriptTag.md b/DevApp.ViewModels/Docs/FromScratchScriptTag.md index 9c67d23d..a481adf4 100644 --- a/DevApp.ViewModels/Docs/FromScratchScriptTag.md +++ b/DevApp.ViewModels/Docs/FromScratchScriptTag.md @@ -78,7 +78,7 @@ Add a new file _wwwroot/index.html_ with the following content: - + diff --git a/DevApp.ViewModels/Docs/GetStarted.md b/DevApp.ViewModels/Docs/GetStarted.md index ba580d04..0c5f9703 100644 --- a/DevApp.ViewModels/Docs/GetStarted.md +++ b/DevApp.ViewModels/Docs/GetStarted.md @@ -68,7 +68,7 @@ If using script tags, include _React_, _signalR_, and _dotNetify_ from their res ```html - + ``` diff --git a/DevApp.ViewModels/Docs/Knockout/FromScratchScriptTag.md b/DevApp.ViewModels/Docs/Knockout/FromScratchScriptTag.md index 3de9fef0..41dc029a 100644 --- a/DevApp.ViewModels/Docs/Knockout/FromScratchScriptTag.md +++ b/DevApp.ViewModels/Docs/Knockout/FromScratchScriptTag.md @@ -81,7 +81,7 @@ Add a new file _wwwroot/index.html_ with the following content: - + diff --git a/DevApp.ViewModels/Docs/Knockout/GetStarted.md b/DevApp.ViewModels/Docs/Knockout/GetStarted.md index 10c677be..1bd5be8a 100644 --- a/DevApp.ViewModels/Docs/Knockout/GetStarted.md +++ b/DevApp.ViewModels/Docs/Knockout/GetStarted.md @@ -24,6 +24,6 @@ If using script tags, include _jQuery_, _knockout_, _signalR_, and _dotNetify_ f ```html - + ``` diff --git a/DevApp.ViewModels/Docs/Vue/FromScratchScriptTag.md b/DevApp.ViewModels/Docs/Vue/FromScratchScriptTag.md index 0a5c366a..05ba8c70 100644 --- a/DevApp.ViewModels/Docs/Vue/FromScratchScriptTag.md +++ b/DevApp.ViewModels/Docs/Vue/FromScratchScriptTag.md @@ -83,7 +83,7 @@ Add a new file _wwwroot/index.html_ with the following content: - + - + ``` diff --git a/DevApp/client/main.js b/DevApp/client/main.js index e3d8dfb4..73925418 100644 --- a/DevApp/client/main.js +++ b/DevApp/client/main.js @@ -13,7 +13,7 @@ dotnetify.debug = true; // Enable this to switch from JSON to MessagePack protocol /* -import { MessagePackHubProtocol } from '@aspnet/signalr-protocol-msgpack'; +import { MessagePackHubProtocol } from '@microsoft/signalr-protocol-msgpack'; const protocol = new MessagePackHubProtocol(); dotnetify.hubOptions.connectionBuilder = builder => builder.withHubProtocol(protocol); */ diff --git a/DevApp/dist/package.json b/DevApp/dist/package.json index 9db5d831..7fbede00 100644 --- a/DevApp/dist/package.json +++ b/DevApp/dist/package.json @@ -15,7 +15,7 @@ "LICENSE.*" ], "dependencies": { - "@aspnet/signalr": "~1.1.4", + "@microsoft/signalr": "~5.0.9", "jquery-deferred": "~0.3.1", "prop-types": "~15.6.1" }, diff --git a/DevApp/package-lock.json b/DevApp/package-lock.json index 9b85bd83..d522b105 100644 --- a/DevApp/package-lock.json +++ b/DevApp/package-lock.json @@ -4,24 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@aspnet/signalr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@aspnet/signalr/-/signalr-1.1.4.tgz", - "integrity": "sha512-Jp9nPc8hmmhbG9OKiHe2fOKskBHfg+3Y9foSKHxjgGtyI743hXjGFv3uFlUg503K9f8Ilu63gQt3fDkLICBRyg==", - "requires": { - "eventsource": "^1.0.7", - "request": "^2.88.0", - "ws": "^6.0.0" - } - }, - "@aspnet/signalr-protocol-msgpack": { - "version": "1.1.0", - "resolved": "http://repo.mitchell.com/api/npm/npm-dev/@aspnet/signalr-protocol-msgpack/-/signalr-protocol-msgpack-1.1.0.tgz", - "integrity": "sha1-FVA4FJ6ODu4fl/TRMZ+fMnH/Bvs=", - "requires": { - "msgpack5": "^4.0.2" - } - }, "@babel/code-frame": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", @@ -162,6 +144,27 @@ "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz", "integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==" }, + "@microsoft/signalr": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@microsoft/signalr/-/signalr-5.0.9.tgz", + "integrity": "sha512-pQufk3+mChfystnmYpglyRYQFp+036QmOxbZUFr2cFf2iiS8ekBX5uVBOG8OexKcsG4TcJNAU/ref90Y9+3ZiA==", + "requires": { + "abort-controller": "^3.0.0", + "eventsource": "^1.0.7", + "fetch-cookie": "^0.7.3", + "node-fetch": "^2.6.0", + "ws": "^6.0.0" + } + }, + "@microsoft/signalr-protocol-msgpack": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@microsoft/signalr-protocol-msgpack/-/signalr-protocol-msgpack-5.0.9.tgz", + "integrity": "sha512-doaDdat8wve5uehY7M7evsQNaFmDWk5drVR2UYQjQaqcCEXmaeeS3L1ctIOKpLRBbMy3v6dFXGJqT1jdjflYQw==", + "requires": { + "@microsoft/signalr": ">=5.0.9", + "msgpack5": "^4.5.0" + } + }, "@types/node": { "version": "14.0.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.1.tgz", @@ -675,6 +678,14 @@ "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", "integrity": "sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg==" }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, "acorn": { "version": "5.7.4", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", @@ -3427,6 +3438,11 @@ "next-tick": "1" } }, + "es6-denodeify": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-denodeify/-/es6-denodeify-0.1.5.tgz", + "integrity": "sha1-MdTV/pxVA+ElRgQ5MQ4WoqPznB8=" + }, "es6-iterator": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", @@ -3540,6 +3556,11 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, "eventemitter3": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz", @@ -3552,9 +3573,9 @@ "dev": true }, "eventsource": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.0.7.tgz", - "integrity": "sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.0.tgz", + "integrity": "sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==", "requires": { "original": "^1.0.0" } @@ -3737,6 +3758,15 @@ "integrity": "sha1-0eJkOzipTXWDtHkGDmxK/8lAcfg=", "dev": true }, + "fetch-cookie": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-0.7.3.tgz", + "integrity": "sha512-rZPkLnI8x5V+zYAiz8QonAHsTb4BY+iFowFBI1RFn0zrO343AVp9X7/yUj/9wL6Ef/8fLls8b/vGtzUvmyAUGA==", + "requires": { + "es6-denodeify": "^0.1.1", + "tough-cookie": "^2.3.3" + } + }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", @@ -5943,6 +5973,11 @@ "lower-case": "^1.1.1" } }, + "node-fetch": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==" + }, "node-libs-browser": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", @@ -7189,9 +7224,9 @@ "dev": true }, "querystringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", - "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" }, "quill": { "version": "1.3.7", @@ -7564,33 +7599,6 @@ "is-finite": "^1.0.0" } }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, "request-promise-core": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.3.tgz", @@ -8793,9 +8801,9 @@ } }, "url-parse": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz", - "integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz", + "integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==", "requires": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -9476,9 +9484,9 @@ "dev": true }, "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz", + "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==", "requires": { "async-limiter": "~1.0.0" } diff --git a/DevApp/package.json b/DevApp/package.json index 574879fa..6805a26c 100644 --- a/DevApp/package.json +++ b/DevApp/package.json @@ -28,8 +28,8 @@ "printWidth": 140 }, "dependencies": { - "@aspnet/signalr": "^1.1.4", - "@aspnet/signalr-protocol-msgpack": "^1.1.0", + "@microsoft/signalr": "^5.0.9", + "@microsoft/signalr-protocol-msgpack": "^5.0.9", "@types/node": "^14.0.1", "chartjs-plugin-streaming": "~1.7.1", "dotnetify-elements": "^1.4.0", diff --git a/DevApp/src/dotnetify/_typings/index.ts b/DevApp/src/dotnetify/_typings/index.ts index 2a430a20..d4ee6c04 100644 --- a/DevApp/src/dotnetify/_typings/index.ts +++ b/DevApp/src/dotnetify/_typings/index.ts @@ -1,4 +1,4 @@ -import { HubConnectionBuilder } from "@aspnet/signalr"; +import { HubConnectionBuilder } from "@microsoft/signalr"; import * as React from "react"; declare const dotnetify: IDotnetify; diff --git a/DevApp/src/dotnetify/core/dotnetify-hub.ts b/DevApp/src/dotnetify/core/dotnetify-hub.ts index 5a9ba78f..72f2c59e 100644 --- a/DevApp/src/dotnetify/core/dotnetify-hub.ts +++ b/DevApp/src/dotnetify/core/dotnetify-hub.ts @@ -15,7 +15,7 @@ limitations under the License. */ import { createEventEmitter } from "../libs/utils"; import * as jQueryShim from "../libs/jquery-shim"; -import * as signalRNetCore from "@aspnet/signalr"; +import * as signalRNetCore from "@microsoft/signalr"; import { IDotnetifyHub } from "../_typings"; let $ = jQueryShim; @@ -34,8 +34,7 @@ export class dotnetifyHubFactory { _init: false, // Hub server methods. - requestVM: (iVMId, iOptions) => - dotnetifyHub.server.request_VM(iVMId, iOptions), + requestVM: (iVMId, iOptions) => dotnetifyHub.server.request_VM(iVMId, iOptions), updateVM: (iVMId, iValue) => dotnetifyHub.server.update_VM(iVMId, iValue), disposeVM: iVMId => dotnetifyHub.server.dispose_VM(iVMId), @@ -63,9 +62,7 @@ export class dotnetifyHubFactory { if (this._startInfo === null || forceRestart) { try { - this._startInfo = this.start(hubOptions) - .done(_doneHandler) - .fail(_failHandler); + this._startInfo = this.start(hubOptions).done(_doneHandler).fail(_failHandler); } catch (err) { this._startInfo = null; } @@ -74,12 +71,7 @@ export class dotnetifyHubFactory { this._startInfo.done(_doneHandler); } catch (err) { this._startInfo = null; - return this.startHub( - hubOptions, - doneHandler, - failHandler, - forceRestart - ); + return this.startHub(hubOptions, doneHandler, failHandler, forceRestart); } } } @@ -98,10 +90,7 @@ export class dotnetifyHubFactory { Object.defineProperty(dotnetifyHub, "isConnected", { get: function () { - return ( - dotnetifyHub._connection && - dotnetifyHub._connection.connection.connectionState === 1 - ); + return dotnetifyHub._connection && dotnetifyHub._connection.connection.connectionState === signalR.HubConnectionState.Connected; } }); @@ -136,29 +125,19 @@ export class dotnetifyHubFactory { }, _startConnection: function (iHubOptions, iTransportArray) { - let url = dotnetifyHub.url - ? dotnetifyHub.url + dotnetifyHub.hubPath - : dotnetifyHub.hubPath; + let url = dotnetifyHub.url ? dotnetifyHub.url + dotnetifyHub.hubPath : dotnetifyHub.hubPath; let hubOptions: any = {}; Object.keys(iHubOptions).forEach(function (key) { hubOptions[key] = iHubOptions[key]; }); hubOptions.transport = iTransportArray.shift(); - let hubConnectionBuilder = new signalR.HubConnectionBuilder().withUrl( - url, - hubOptions - ); + let hubConnectionBuilder = new signalR.HubConnectionBuilder().withUrl(url, hubOptions); if (typeof hubOptions.connectionBuilder == "function") - hubConnectionBuilder = hubOptions.connectionBuilder( - hubConnectionBuilder - ); + hubConnectionBuilder = hubOptions.connectionBuilder(hubConnectionBuilder); dotnetifyHub._connection = hubConnectionBuilder.build(); - dotnetifyHub._connection.on( - "response_vm", - dotnetifyHub.client.response_VM - ); + dotnetifyHub._connection.on("response_vm", dotnetifyHub.client.response_VM); dotnetifyHub._connection.onclose(dotnetifyHub._onDisconnected); let promise = dotnetifyHub._connection @@ -168,15 +147,12 @@ export class dotnetifyHubFactory { }) .catch(function () { // If failed to start, fallback to the next transport. - if (iTransportArray.length > 0) - dotnetifyHub._startConnection(iHubOptions, iTransportArray); + if (iTransportArray.length > 0) dotnetifyHub._startConnection(iHubOptions, iTransportArray); else dotnetifyHub._onDisconnected(); }); if (typeof dotnetifyHub._startDoneHandler === "function") - promise - .then(dotnetifyHub._startDoneHandler) - .catch(dotnetifyHub._startFailHandler || function () {}); + promise.then(dotnetifyHub._startDoneHandler).catch(dotnetifyHub._startFailHandler || function () {}); return promise; }, @@ -214,30 +190,22 @@ export class dotnetifyHubFactory { }, disconnected: function (iHandler) { - if (typeof iHandler === "function") - dotnetifyHub._disconnectedHandler = iHandler; + if (typeof iHandler === "function") dotnetifyHub._disconnectedHandler = iHandler; }, stateChanged: function (iHandler) { - if (typeof iHandler === "function") - dotnetifyHub._stateChangedHandler = iHandler; + if (typeof iHandler === "function") dotnetifyHub._stateChangedHandler = iHandler; }, reconnect: function (iStartHubFunc) { if (typeof iStartHubFunc === "function") { // Only attempt reconnect if the specified retry hasn't been exceeded. - if ( - !dotnetifyHub.reconnectRetry || - dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry - ) { + if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) { // Determine reconnect delay from the specified configuration array. let delay = - dotnetifyHub._reconnectCount < - dotnetifyHub.reconnectDelay.length + dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount] - : dotnetifyHub.reconnectDelay[ - dotnetifyHub.reconnectDelay.length - 1 - ]; + : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1]; dotnetifyHub._reconnectCount++; @@ -277,9 +245,7 @@ export class dotnetifyHubFactory { "use strict"; if (typeof $.signalR !== "function") { - throw new Error( - "SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js." - ); + throw new Error("SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js."); } var signalR = $.signalR; @@ -321,11 +287,7 @@ export class dotnetifyHubFactory { continue; } - subscriptionMethod.call( - hub, - memberKey, - makeProxyCallback(hub, memberValue) - ); + subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue)); } } } @@ -350,24 +312,15 @@ export class dotnetifyHubFactory { proxies["dotNetifyHub"].client = {}; proxies["dotNetifyHub"].server = { dispose_VM: function (vmId) { - return proxies["dotNetifyHub"].invoke.apply( - proxies["dotNetifyHub"], - $.merge(["Dispose_VM"], $.makeArray(arguments)) - ); + return proxies["dotNetifyHub"].invoke.apply(proxies["dotNetifyHub"], $.merge(["Dispose_VM"], $.makeArray(arguments))); }, request_VM: function (vmId, vmArg) { - return proxies["dotNetifyHub"].invoke.apply( - proxies["dotNetifyHub"], - $.merge(["Request_VM"], $.makeArray(arguments)) - ); + return proxies["dotNetifyHub"].invoke.apply(proxies["dotNetifyHub"], $.merge(["Request_VM"], $.makeArray(arguments))); }, update_VM: function (vmId, vmData) { - return proxies["dotNetifyHub"].invoke.apply( - proxies["dotNetifyHub"], - $.merge(["Update_VM"], $.makeArray(arguments)) - ); + return proxies["dotNetifyHub"].invoke.apply(proxies["dotNetifyHub"], $.merge(["Update_VM"], $.makeArray(arguments))); } }; @@ -403,9 +356,7 @@ export class dotnetifyHubFactory { Object.defineProperty(dotnetifyHub, "isConnected", { get: function () { - return ( - $.connection.hub.state == $.signalR.connectionState.connected - ); + return $.connection.hub.state == $.signalR.connectionState.connected; } }); @@ -423,13 +374,8 @@ export class dotnetifyHubFactory { if (iHubOptions) deferred = $.connection.hub.start(iHubOptions); else deferred = $.connection.hub.start(); deferred.fail(function (error) { - if ( - error.source && - error.source.message === "Error parsing negotiate response." - ) - console.warn( - "This client may be attempting to connect to an incompatible SignalR .NET Core server." - ); + if (error.source && error.source.message === "Error parsing negotiate response.") + console.warn("This client may be attempting to connect to an incompatible SignalR .NET Core server."); }); return deferred; }, @@ -456,18 +402,12 @@ export class dotnetifyHubFactory { reconnect: function (iStartHubFunc) { if (typeof iStartHubFunc === "function") { // Only attempt reconnect if the specified retry hasn't been exceeded. - if ( - !dotnetifyHub.reconnectRetry || - dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry - ) { + if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) { // Determine reconnect delay from the specified configuration array. let delay = - dotnetifyHub._reconnectCount < - dotnetifyHub.reconnectDelay.length + dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount] - : dotnetifyHub.reconnectDelay[ - dotnetifyHub.reconnectDelay.length - 1 - ]; + : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1]; dotnetifyHub._reconnectCount++; diff --git a/DevApp/webpack.dist.config.js b/DevApp/webpack.dist.config.js index 92490e12..d73622e4 100644 --- a/DevApp/webpack.dist.config.js +++ b/DevApp/webpack.dist.config.js @@ -12,30 +12,30 @@ const baseExport = { { test: /\.css$/, use: [MiniCssExtractPlugin.loader, "css-loader?minimize"] }, { test: /\.svg$/, use: "svg-url-loader?noquotes=true" }, { test: /\.(png|jpg|jpeg|gif)$/, use: "url-loader?limit=25000" }, - { test: /\.(eot|ttf|woff(2)?)(\?v=\d+\.\d+\.\d+)?/, loader: "url-loader" }, - ], + { test: /\.(eot|ttf|woff(2)?)(\?v=\d+\.\d+\.\d+)?/, loader: "url-loader" } + ] }, resolve: { modules: ["src", "node_modules"], - extensions: [".js", ".jsx", ".ts", ".tsx"], + extensions: [".js", ".jsx", ".ts", ".tsx"] }, plugins: [ new MiniCssExtractPlugin(), new CopyWebpackPlugin([ { from: "./src/dotnetify/libs/signalR-netfx.js", to: "./" }, { from: "./src/dotnetify/libs/jquery-shim.js", to: "./" }, - { from: "./typings/_typings", to: "./typings" }, - ]), + { from: "./typings/_typings", to: "./typings" } + ]) ], optimization: { minimize: true, minimizer: [ new UglifyJsPlugin({ - include: /\.min\.js$/, - }), - ], + include: /\.min\.js$/ + }) + ] }, - devtool: "source-map", + devtool: "source-map" }; module.exports = [ @@ -45,33 +45,33 @@ module.exports = [ entry: { "dotnetify-react": "./src/dotnetify/react/index.ts", "dotnetify-react.min": "./src/dotnetify/react/index.ts", - dotnetify: "./src/dotnetify/react/dotnetify-react.ts", + dotnetify: "./src/dotnetify/react/dotnetify-react.ts" }, output: { path: __dirname + "/dist/dist", library: "dotnetify", - libraryTarget: "umd", + libraryTarget: "umd" }, externals: { react: { commonjs: "react", commonjs2: "react", amd: "react", - root: "React", + root: "React" }, "react-dom": { commonjs: "react-dom", commonjs2: "react-dom", amd: "react-dom", - root: "ReactDOM", + root: "ReactDOM" }, - "@aspnet/signalr": { - commonjs: "@aspnet/signalr", - commonjs2: "@aspnet/signalr", - amd: "@aspnet/signalr", - root: "signalR", - }, - }, + "@microsoft/signalr": { + commonjs: "@microsoft/signalr", + commonjs2: "@microsoft/signalr", + amd: "@microsoft/signalr", + root: "signalR" + } + } }, baseExport ), @@ -80,33 +80,33 @@ module.exports = [ mode: "production", entry: { "dotnetify-ko": "./src/dotnetify/knockout/index.js", - "dotnetify-ko.min": "./src/dotnetify/knockout/index.js", + "dotnetify-ko.min": "./src/dotnetify/knockout/index.js" }, output: { path: __dirname + "/dist/dist", library: "dotnetify", - libraryTarget: "umd", + libraryTarget: "umd" }, externals: { knockout: { commonjs: "knockout", commonjs2: "knockout", amd: "knockout", - root: "ko", + root: "ko" }, jquery: { commonjs: "jquery", commonjs2: "jquery", amd: "jquery", - root: "jQuery", + root: "jQuery" }, - "@aspnet/signalr": { - commonjs: "@aspnet/signalr", - commonjs2: "@aspnet/signalr", - amd: "@aspnet/signalr", - root: "signalR", - }, - }, + "@microsoft/signalr": { + commonjs: "@microsoft/signalr", + commonjs2: "@microsoft/signalr", + amd: "@microsoft/signalr", + root: "signalR" + } + } }, baseExport ), @@ -115,28 +115,28 @@ module.exports = [ mode: "production", entry: { "dotnetify-vue": "./src/dotnetify/vue/index.js", - "dotnetify-vue.min": "./src/dotnetify/vue/index.js", + "dotnetify-vue.min": "./src/dotnetify/vue/index.js" }, output: { path: __dirname + "/dist/dist", library: "dotnetify", - libraryTarget: "umd", + libraryTarget: "umd" }, externals: { vue: { commonjs: "vue", commonjs2: "vue", amd: "vue", - root: "Vue", + root: "Vue" }, - "@aspnet/signalr": { - commonjs: "@aspnet/signalr", - commonjs2: "@aspnet/signalr", - amd: "@aspnet/signalr", - root: "signalR", - }, - }, + "@microsoft/signalr": { + commonjs: "@microsoft/signalr", + commonjs2: "@microsoft/signalr", + amd: "@microsoft/signalr", + root: "signalR" + } + } }, baseExport - ), + ) ];