TypeScript improvements and tslib dep (#2692)
This commit is contained in:
parent
cef7dfcdbb
commit
c1aa708a8b
|
|
@ -15,7 +15,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Target Name="RestoreNpm" Condition="'$(PreflightRestore)' != 'True'">
|
<Target Name="RestoreNpm" Condition="'$(PreflightRestore)' != 'True'">
|
||||||
<Message Text="Restoring NPM modules" Importance="high" />
|
<Message Text="Restoring NPM modules" Importance="high" />
|
||||||
<Exec Command="npm install --no-optional" WorkingDirectory="$(RepositoryRoot)clients/ts" />
|
<Exec Command="npm install --no-optional" WorkingDirectory="$(RepositoryRoot)clients/ts/common" />
|
||||||
<Exec Command="npm install --no-optional" WorkingDirectory="$(RepositoryRoot)clients/ts/FunctionalTests" />
|
<Exec Command="npm install --no-optional" WorkingDirectory="$(RepositoryRoot)clients/ts/FunctionalTests" />
|
||||||
<Exec Command="npm install --no-optional" WorkingDirectory="$(RepositoryRoot)clients/ts/signalr" />
|
<Exec Command="npm install --no-optional" WorkingDirectory="$(RepositoryRoot)clients/ts/signalr" />
|
||||||
<Exec Command="npm install --no-optional" WorkingDirectory="$(RepositoryRoot)clients/ts/signalr-protocol-msgpack" />
|
<Exec Command="npm install --no-optional" WorkingDirectory="$(RepositoryRoot)clients/ts/signalr-protocol-msgpack" />
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@
|
||||||
"es6-promise": {
|
"es6-promise": {
|
||||||
"version": "4.2.2",
|
"version": "4.2.2",
|
||||||
"bundled": true
|
"bundled": true
|
||||||
|
},
|
||||||
|
"tslib": {
|
||||||
|
"version": "1.9.3",
|
||||||
|
"bundled": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -111,6 +115,10 @@
|
||||||
"safe-buffer": "~5.1.0"
|
"safe-buffer": "~5.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"tslib": {
|
||||||
|
"version": "1.9.3",
|
||||||
|
"bundled": true
|
||||||
|
},
|
||||||
"util-deprecate": {
|
"util-deprecate": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true
|
"bundled": true
|
||||||
|
|
@ -791,9 +799,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"circular-json": {
|
"circular-json": {
|
||||||
"version": "0.5.4",
|
"version": "0.5.5",
|
||||||
"resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.5.tgz",
|
||||||
"integrity": "sha512-vnJA8KS0BfOihugYEUkLRcnmq21FbuivbxgzDLXNs3zIk4KllV4Mx4UuTzBXht9F00C7QfD1YqMXg1zP6EXpig==",
|
"integrity": "sha512-13YaR6kiz0kBNmIVM87Io8Hp7bWOo4r61vkEANy8iH9R9bc6avud/1FT0SBpqR1RpIQADOh/Q+yHZDA1iL6ysA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"class-utils": {
|
"class-utils": {
|
||||||
|
|
@ -875,9 +883,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"commander": {
|
"commander": {
|
||||||
"version": "2.15.1",
|
"version": "2.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-2.16.0.tgz",
|
||||||
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
|
"integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
|
@ -1259,9 +1267,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"escodegen": {
|
"escodegen": {
|
||||||
"version": "1.10.0",
|
"version": "1.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz",
|
||||||
"integrity": "sha512-fjUOf8johsv23WuIKdNQU4P9t9jhQ4Qzx6pC2uW890OloK3Zs1ZAoCNpg/2larNF501jLl3UNy0kIRcF6VI22g==",
|
"integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
|
@ -3004,9 +3012,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"log4js": {
|
"log4js": {
|
||||||
"version": "2.10.0",
|
"version": "2.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/log4js/-/log4js-2.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/log4js/-/log4js-2.11.0.tgz",
|
||||||
"integrity": "sha512-NnhN9PjFF9zhxinAjlmDYvkqqrIW+yA3LLJAoTJ3fs6d1zru86OqQHfsxiUcc1kRq3z+faGR4DeyXUfiNbVxKQ==",
|
"integrity": "sha512-z1XdwyGFg8/WGkOyF6DPJjivCWNLKrklGdViywdYnSKOvgtEBo2UyEMZS5sD2mZrQlU3TvO8wDWLc8mzE1ncBQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"amqplib": "^0.5.2",
|
"amqplib": "^0.5.2",
|
||||||
|
|
@ -3688,6 +3696,19 @@
|
||||||
"pac-resolver": "^3.0.0",
|
"pac-resolver": "^3.0.0",
|
||||||
"raw-body": "^2.2.0",
|
"raw-body": "^2.2.0",
|
||||||
"socks-proxy-agent": "^3.0.0"
|
"socks-proxy-agent": "^3.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"socks-proxy-agent": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-ZwEDymm204mTzvdqyUqOdovVr2YRd2NYskrYrF2LXyZ9qDiMAoFESGK8CRphiO7rtbo2Y757k2Nia3x2hGtalA==",
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"requires": {
|
||||||
|
"agent-base": "^4.1.0",
|
||||||
|
"socks": "^1.1.10"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pac-resolver": {
|
"pac-resolver": {
|
||||||
|
|
@ -3822,9 +3843,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"proxy-agent": {
|
"proxy-agent": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-3.0.1.tgz",
|
||||||
"integrity": "sha512-g6n6vnk8fRf705ShN+FEXFG/SDJaW++lSs0d9KaJh4uBWW/wi7en4Cpo5VYQW3SZzAE121lhB/KLQrbURoubZw==",
|
"integrity": "sha512-mAZexaz9ZxQhYPWfAjzlrloEjW+JHiBFryE4AJXFDTnaXfmH/FKqC1swTRKuEPbHWz02flQNXFOyDUF7zfEG6A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
|
@ -3835,7 +3856,7 @@
|
||||||
"lru-cache": "^4.1.2",
|
"lru-cache": "^4.1.2",
|
||||||
"pac-proxy-agent": "^2.0.1",
|
"pac-proxy-agent": "^2.0.1",
|
||||||
"proxy-from-env": "^1.0.0",
|
"proxy-from-env": "^1.0.0",
|
||||||
"socks-proxy-agent": "^3.0.0"
|
"socks-proxy-agent": "^4.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"proxy-from-env": {
|
"proxy-from-env": {
|
||||||
|
|
@ -4140,7 +4161,8 @@
|
||||||
"version": "1.1.15",
|
"version": "1.1.15",
|
||||||
"resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-1.1.15.tgz",
|
"resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-1.1.15.tgz",
|
||||||
"integrity": "sha1-fxFLW2X6s+KjWqd1uxLw0cZJvxY=",
|
"integrity": "sha1-fxFLW2X6s+KjWqd1uxLw0cZJvxY=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"smtp-connection": {
|
"smtp-connection": {
|
||||||
"version": "2.12.0",
|
"version": "2.12.0",
|
||||||
|
|
@ -4371,19 +4393,41 @@
|
||||||
"resolved": "https://registry.npmjs.org/socks/-/socks-1.1.10.tgz",
|
"resolved": "https://registry.npmjs.org/socks/-/socks-1.1.10.tgz",
|
||||||
"integrity": "sha1-W4t/x8jzQcU+0FbpKbe/Tei6e1o=",
|
"integrity": "sha1-W4t/x8jzQcU+0FbpKbe/Tei6e1o=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ip": "^1.1.4",
|
"ip": "^1.1.4",
|
||||||
"smart-buffer": "^1.0.13"
|
"smart-buffer": "^1.0.13"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"socks-proxy-agent": {
|
"socks-proxy-agent": {
|
||||||
"version": "3.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz",
|
||||||
"integrity": "sha512-ZwEDymm204mTzvdqyUqOdovVr2YRd2NYskrYrF2LXyZ9qDiMAoFESGK8CRphiO7rtbo2Y757k2Nia3x2hGtalA==",
|
"integrity": "sha512-Kezx6/VBguXOsEe5oU3lXYyKMi4+gva72TwJ7pQY5JfqUx2nMk7NXA6z/mpNqIlfQjWYVfeuNvQjexiTaTn6Nw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"agent-base": "^4.1.0",
|
"agent-base": "~4.2.0",
|
||||||
"socks": "^1.1.10"
|
"socks": "~2.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"smart-buffer": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-RFqinRVJVcCAL9Uh1oVqE6FZkqsyLiVOYEZ20TqIOjuX7iFVJ+zsbs4RIghnw/pTs7mZvt8ZHhvm1ZUrR4fykg==",
|
||||||
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"socks": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/socks/-/socks-2.2.1.tgz",
|
||||||
|
"integrity": "sha512-0GabKw7n9mI46vcNrVfs0o6XzWzjVa3h6GaSo2UPxtWAROXUWavfJWh1M4PR5tnE0dcnQXZIDFP4yrAysLze/w==",
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"requires": {
|
||||||
|
"ip": "^1.1.5",
|
||||||
|
"smart-buffer": "^4.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"source-map": {
|
"source-map": {
|
||||||
|
|
@ -4728,6 +4772,12 @@
|
||||||
"mime-types": "~2.1.18"
|
"mime-types": "~2.1.18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"typescript": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-zQIMOmC+372pC/CCVLqnQ0zSBiY7HHodU7mpQdjiZddek4GMj31I3dUJ7gAs9o65X7mnRma6OokOkc6f9jjfBg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"ultron": {
|
"ultron": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,14 @@
|
||||||
"karma-sauce-launcher": "^1.2.0",
|
"karma-sauce-launcher": "^1.2.0",
|
||||||
"karma-sourcemap-loader": "^0.3.7",
|
"karma-sourcemap-loader": "^0.3.7",
|
||||||
"karma-summary-reporter": "^1.5.0",
|
"karma-summary-reporter": "^1.5.0",
|
||||||
"ts-node": "^4.1.0"
|
"ts-node": "^4.1.0",
|
||||||
|
"typescript": "^3.0.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "node ../node_modules/rimraf/bin.js ./wwwroot/dist ./obj/js",
|
"clean": "node ../common/node_modules/rimraf/bin.js ./wwwroot/dist ./obj/js",
|
||||||
"build": "npm run clean && npm run build:lint && npm run build:webpack",
|
"build": "npm run clean && npm run build:lint && npm run build:webpack",
|
||||||
"build:lint": "node ../node_modules/tslint/bin/tslint -c ../tslint.json -p ./tsconfig.json",
|
"build:lint": "node ../common/node_modules/tslint/bin/tslint -c ../tslint.json -p ./tsconfig.json",
|
||||||
"build:webpack": "node ../node_modules/webpack-cli/bin/cli.js",
|
"build:webpack": "node ../common/node_modules/webpack-cli/bin/cli.js",
|
||||||
"build:parent": "cd .. && npm run build",
|
"build:parent": "cd .. && npm run build",
|
||||||
"pretest": "npm run build:parent && npm run build && dotnet build",
|
"pretest": "npm run build:parent && npm run build && dotnet build",
|
||||||
"test": "npm run test:local --",
|
"test": "npm run test:local --",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
// This code uses a lot of `.then` instead of `await` and TSLint doesn't like it.
|
||||||
|
// tslint:disable:no-floating-promises
|
||||||
|
|
||||||
import { HttpTransportType, IHttpConnectionOptions, TransferFormat } from "@aspnet/signalr";
|
import { HttpTransportType, IHttpConnectionOptions, TransferFormat } from "@aspnet/signalr";
|
||||||
import { eachTransport, ECHOENDPOINT_URL } from "./Common";
|
import { eachTransport, ECHOENDPOINT_URL } from "./Common";
|
||||||
import { TestLogger } from "./TestLogger";
|
import { TestLogger } from "./TestLogger";
|
||||||
|
|
@ -23,13 +26,13 @@ describe("connection", () => {
|
||||||
...commonOptions,
|
...commonOptions,
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onreceive = (data) => {
|
connection.onreceive = async (data: any) => {
|
||||||
if (data === message) {
|
if (data === message) {
|
||||||
connection.stop();
|
connection.stop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
connection.onclose = (error) => {
|
connection.onclose = (error: any) => {
|
||||||
expect(error).toBeUndefined();
|
expect(error).toBeUndefined();
|
||||||
done();
|
done();
|
||||||
};
|
};
|
||||||
|
|
@ -53,20 +56,20 @@ describe("connection", () => {
|
||||||
transport: transportType,
|
transport: transportType,
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onreceive = (data) => {
|
connection.onreceive = (data: any) => {
|
||||||
if (data === message) {
|
if (data === message) {
|
||||||
connection.stop();
|
connection.stop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
connection.onclose = (error) => {
|
connection.onclose = (error: any) => {
|
||||||
expect(error).toBeUndefined();
|
expect(error).toBeUndefined();
|
||||||
done();
|
done();
|
||||||
};
|
};
|
||||||
|
|
||||||
connection.start(TransferFormat.Text).then(() => {
|
connection.start(TransferFormat.Text).then(() => {
|
||||||
connection.send(message);
|
connection.send(message);
|
||||||
}).catch((e) => {
|
}).catch((e: any) => {
|
||||||
fail(e);
|
fail(e);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
@ -82,15 +85,17 @@ describe("connection", () => {
|
||||||
transport: transportType,
|
transport: transportType,
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onreceive = (data) => {
|
connection.onreceive = (data: any) => {
|
||||||
if (data === message) {
|
if (data === message) {
|
||||||
connection.stop();
|
connection.stop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-ignore: We don't use the error parameter intentionally.
|
||||||
connection.onclose = (error) => {
|
connection.onclose = (error) => {
|
||||||
// Search the logs for the message content
|
// Search the logs for the message content
|
||||||
expect(TestLogger.instance.currentLog.messages.length).toBeGreaterThan(0);
|
expect(TestLogger.instance.currentLog.messages.length).toBeGreaterThan(0);
|
||||||
|
// @ts-ignore: We don't use the _ or __ parameters intentionally.
|
||||||
for (const [_, __, logMessage] of TestLogger.instance.currentLog.messages) {
|
for (const [_, __, logMessage] of TestLogger.instance.currentLog.messages) {
|
||||||
expect(logMessage).not.toContain(message);
|
expect(logMessage).not.toContain(message);
|
||||||
}
|
}
|
||||||
|
|
@ -116,16 +121,18 @@ describe("connection", () => {
|
||||||
transport: transportType,
|
transport: transportType,
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onreceive = (data) => {
|
connection.onreceive = (data: any) => {
|
||||||
if (data === message) {
|
if (data === message) {
|
||||||
connection.stop();
|
connection.stop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-ignore: We don't use the error parameter intentionally.
|
||||||
connection.onclose = (error) => {
|
connection.onclose = (error) => {
|
||||||
// Search the logs for the message content
|
// Search the logs for the message content
|
||||||
let matches = 0;
|
let matches = 0;
|
||||||
expect(TestLogger.instance.currentLog.messages.length).toBeGreaterThan(0);
|
expect(TestLogger.instance.currentLog.messages.length).toBeGreaterThan(0);
|
||||||
|
// @ts-ignore: We don't use the _ or __ parameters intentionally.
|
||||||
for (const [_, __, logMessage] of TestLogger.instance.currentLog.messages) {
|
for (const [_, __, logMessage] of TestLogger.instance.currentLog.messages) {
|
||||||
if (logMessage.indexOf(message) !== -1) {
|
if (logMessage.indexOf(message) !== -1) {
|
||||||
matches += 1;
|
matches += 1;
|
||||||
|
|
@ -139,7 +146,7 @@ describe("connection", () => {
|
||||||
|
|
||||||
connection.start(TransferFormat.Text).then(() => {
|
connection.start(TransferFormat.Text).then(() => {
|
||||||
connection.send(message);
|
connection.send(message);
|
||||||
}).catch((e) => {
|
}).catch((e: any) => {
|
||||||
fail(e);
|
fail(e);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
// This code uses a lot of `.then` instead of `await` and TSLint doesn't like it.
|
||||||
|
// tslint:disable:no-floating-promises
|
||||||
|
|
||||||
import { AbortError, DefaultHttpClient, HttpClient, HttpRequest, HttpResponse, HttpTransportType, HubConnectionBuilder, IHttpConnectionOptions, JsonHubProtocol } from "@aspnet/signalr";
|
import { AbortError, DefaultHttpClient, HttpClient, HttpRequest, HttpResponse, HttpTransportType, HubConnectionBuilder, IHttpConnectionOptions, JsonHubProtocol } from "@aspnet/signalr";
|
||||||
import { MessagePackHubProtocol } from "@aspnet/signalr-protocol-msgpack";
|
import { MessagePackHubProtocol } from "@aspnet/signalr-protocol-msgpack";
|
||||||
|
|
||||||
|
|
@ -221,7 +224,7 @@ describe("hubConnection", () => {
|
||||||
hubConnection.stop();
|
hubConnection.stop();
|
||||||
done();
|
done();
|
||||||
},
|
},
|
||||||
next(item) {
|
next() {
|
||||||
hubConnection.stop();
|
hubConnection.stop();
|
||||||
fail();
|
fail();
|
||||||
},
|
},
|
||||||
|
|
@ -248,7 +251,7 @@ describe("hubConnection", () => {
|
||||||
hubConnection.stop();
|
hubConnection.stop();
|
||||||
done();
|
done();
|
||||||
},
|
},
|
||||||
next(item) {
|
next() {
|
||||||
hubConnection.stop();
|
hubConnection.stop();
|
||||||
fail();
|
fail();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
export class LogBannerReporter implements jasmine.CustomReporter {
|
export class LogBannerReporter implements jasmine.CustomReporter {
|
||||||
public jasmineStarted(suiteInfo: jasmine.SuiteInfo): void {
|
public jasmineStarted(): void {
|
||||||
console.log("*** JASMINE SUITE STARTED ***");
|
console.log("*** JASMINE SUITE STARTED ***");
|
||||||
}
|
}
|
||||||
|
|
||||||
public jasmineDone(runDetails: jasmine.RunDetails): void {
|
public jasmineDone(): void {
|
||||||
console.log("*** JASMINE SUITE FINISHED ***");
|
console.log("*** JASMINE SUITE FINISHED ***");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const webpack = require("webpack");
|
const webpack = require("../common/node_modules/webpack");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: path.resolve(__dirname, "ts", "index.ts"),
|
entry: path.resolve(__dirname, "ts", "index.ts"),
|
||||||
|
|
@ -24,6 +24,10 @@ module.exports = {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
resolveLoader: {
|
||||||
|
// Special resolution rules for loaders (which are in the 'common' directory)
|
||||||
|
modules: [ path.resolve(__dirname, "..", "common", "node_modules") ],
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".ts", ".js"]
|
extensions: [".ts", ".js"]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"name": "common",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Common dependencies used during dev time. DO NOT PUBLISH",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/jest": "^22.2.3",
|
||||||
|
"@types/node": "^8.5.2",
|
||||||
|
"@types/webpack": "^4.4.0",
|
||||||
|
"jest": "^22.4.3",
|
||||||
|
"rimraf": "^2.6.2",
|
||||||
|
"ts-jest": "^22.4.6",
|
||||||
|
"ts-loader": "^4.4.1",
|
||||||
|
"tslint": "^5.9.1",
|
||||||
|
"typescript": "^2.7.1",
|
||||||
|
"uglify-js": "^3.3.5",
|
||||||
|
"webpack": "^4.12.0",
|
||||||
|
"webpack-cli": "^3.0.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,30 +1,16 @@
|
||||||
{
|
{
|
||||||
"name": "client-ts",
|
"name": "client-ts",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"description": "Common dev-time dependencies for SignalR NPM packages. NOT FOR PUBLISHING",
|
"description": "Provides a root to run npm scripts from. DO NOT PUBLISH",
|
||||||
"main": "index.js",
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "cd ./signalr && npm run build && cd ../signalr-protocol-msgpack && npm run build",
|
"build": "cd ./signalr && npm run build && cd ../signalr-protocol-msgpack && npm run build",
|
||||||
"pretest": "tslint -c ./tslint.json -p ./signalr/tests/tsconfig.json && tslint -c ./tslint.json -p ./signalr-protocol-msgpack/tests/tsconfig.json",
|
"pretest": "node ./common/node_modules/tslint/bin/tslint -c ./tslint.json -p ./signalr/tests/tsconfig.json && node ./common/node_modules/tslint/bin/tslint -c ./tslint.json -p ./signalr-protocol-msgpack/tests/tsconfig.json",
|
||||||
"test": "jest",
|
"test": "node ./common/node_modules/jest/bin/jest.js",
|
||||||
"coverage": "jest --coverage"
|
"coverage": "node ./common/node_modules/jest/bin/jest.js --coverage"
|
||||||
},
|
},
|
||||||
"author": "Microsoft",
|
"author": "Microsoft",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"devDependencies": {
|
|
||||||
"@types/jest": "^22.2.3",
|
|
||||||
"@types/node": "^8.5.2",
|
|
||||||
"@types/webpack": "^4.4.0",
|
|
||||||
"jest": "^22.4.3",
|
|
||||||
"rimraf": "^2.6.2",
|
|
||||||
"ts-jest": "^22.4.6",
|
|
||||||
"ts-loader": "^4.4.1",
|
|
||||||
"tslint": "^5.9.1",
|
|
||||||
"typescript": "^2.7.1",
|
|
||||||
"uglify-js": "^3.3.5",
|
|
||||||
"webpack": "^4.12.0",
|
|
||||||
"webpack-cli": "^3.0.3"
|
|
||||||
},
|
|
||||||
"jest": {
|
"jest": {
|
||||||
"globals": {
|
"globals": {
|
||||||
"ts-jest": {
|
"ts-jest": {
|
||||||
|
|
@ -34,12 +20,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"transform": {
|
"transform": {
|
||||||
"^.+\\.tsx?$": "ts-jest"
|
"^.+\\.tsx?$": "./common/node_modules/ts-jest"
|
||||||
},
|
},
|
||||||
"testEnvironment": "node",
|
"testEnvironment": "node",
|
||||||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
||||||
"moduleNameMapper": {
|
"moduleNameMapper": {
|
||||||
"^@aspnet/signalr$": "<rootDir>/signalr/src/index.ts"
|
"^ts-jest$": "<rootDir>/common/node_modules/ts-jest",
|
||||||
|
"^@aspnet/signalr$": "<rootDir>/signalr/dist/cjs/index.js"
|
||||||
},
|
},
|
||||||
"moduleFileExtensions": [
|
"moduleFileExtensions": [
|
||||||
"ts",
|
"ts",
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
||||||
|
|
||||||
import path from 'path';
|
|
||||||
|
|
||||||
import resolve from 'rollup-plugin-node-resolve'
|
|
||||||
import sourceMaps from 'rollup-plugin-sourcemaps'
|
|
||||||
import commonjs from 'rollup-plugin-commonjs'
|
|
||||||
|
|
||||||
let polyfills = [ 'es6-promise', 'buffer', 'base64-js', 'ieee754' ];
|
|
||||||
let allowed_externals = [ ];
|
|
||||||
|
|
||||||
export default function(rootDir, moduleGlobals) {
|
|
||||||
let pkg = require(path.join(rootDir, "package.json"));
|
|
||||||
return {
|
|
||||||
input: path.join(rootDir, "dist", "cjs", "browser-index.js"),
|
|
||||||
output: {
|
|
||||||
file: pkg.umd,
|
|
||||||
format: "umd",
|
|
||||||
name: pkg.umd_name,
|
|
||||||
sourcemap: true,
|
|
||||||
banner: "/** \r\n" +
|
|
||||||
" * @overview ASP.NET Core SignalR JavaScript Client.\r\n" +
|
|
||||||
" * @version 0.0.0-DEV_BUILD.\r\n" +
|
|
||||||
" * @license\r\n" +
|
|
||||||
" * Copyright (c) .NET Foundation. All rights reserved.\r\n" +
|
|
||||||
" * Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n" +
|
|
||||||
" */",
|
|
||||||
globals: moduleGlobals,
|
|
||||||
},
|
|
||||||
|
|
||||||
// Mark everything in the dependencies list as external
|
|
||||||
external: Object.keys(pkg.dependencies || {}),
|
|
||||||
|
|
||||||
plugins: [
|
|
||||||
commonjs(),
|
|
||||||
resolve({
|
|
||||||
preferBuiltins: false
|
|
||||||
}),
|
|
||||||
sourceMaps()
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -11,13 +11,13 @@
|
||||||
"test": "spec"
|
"test": "spec"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "node ../node_modules/rimraf/bin.js ./dist",
|
"clean": "node ../common/node_modules/rimraf/bin.js ./dist",
|
||||||
"build": "npm run clean && npm run build:lint && npm run build:esm && npm run build:cjs && npm run build:browser && npm run build:uglify",
|
"build": "npm run clean && npm run build:lint && npm run build:esm && npm run build:cjs && npm run build:browser && npm run build:uglify",
|
||||||
"build:lint": "node ../node_modules/tslint/bin/tslint -c ../tslint.json -p ./tsconfig.json",
|
"build:lint": "node ../common/node_modules/tslint/bin/tslint -c ../tslint.json -p ./tsconfig.json",
|
||||||
"build:esm": "node ../node_modules/typescript/bin/tsc --project ./tsconfig.json --module es2015 --outDir ./dist/esm -d",
|
"build:esm": "node ../common/node_modules/typescript/bin/tsc --project ./tsconfig.json --module es2015 --outDir ./dist/esm -d",
|
||||||
"build:cjs": "node ../node_modules/typescript/bin/tsc --project ./tsconfig.json --module commonjs --outDir ./dist/cjs",
|
"build:cjs": "node ../common/node_modules/typescript/bin/tsc --project ./tsconfig.json --module commonjs --outDir ./dist/cjs",
|
||||||
"build:browser": "node ../node_modules/webpack-cli/bin/cli.js",
|
"build:browser": "node ../common/node_modules/webpack-cli/bin/cli.js",
|
||||||
"build:uglify": "node ../node_modules/uglify-js/bin/uglifyjs --source-map \"url='signalr-protocol-msgpack.min.js.map',content='./dist/browser/signalr-protocol-msgpack.js.map'\" --comments -o ./dist/browser/signalr-protocol-msgpack.min.js ./dist/browser/signalr-protocol-msgpack.js",
|
"build:uglify": "node ../common/node_modules/uglify-js/bin/uglifyjs --source-map \"url='signalr-protocol-msgpack.min.js.map',content='./dist/browser/signalr-protocol-msgpack.js.map'\" --comments -o ./dist/browser/signalr-protocol-msgpack.min.js ./dist/browser/signalr-protocol-msgpack.js",
|
||||||
"prepack": "node ../build/embed-version.js",
|
"prepack": "node ../build/embed-version.js",
|
||||||
"test": "echo \"Run 'npm test' in the 'clients\\ts' folder to test this package\" && exit 1"
|
"test": "echo \"Run 'npm test' in the 'clients\\ts' folder to test this package\" && exit 1"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const baseConfig = require("../webpack.config.base");
|
const baseConfig = require("../webpack.config.base");
|
||||||
|
|
||||||
module.exports = baseConfig(__dirname, "signalr-protocol-msgpack", {
|
module.exports = baseConfig(__dirname, "signalr-protocol-msgpack", {
|
||||||
externals: {
|
externals: {
|
||||||
msgpack5: "msgpack5",
|
msgpack5: "msgpack5",
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,13 @@
|
||||||
"test": "spec"
|
"test": "spec"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "node ../node_modules/rimraf/bin.js ./dist",
|
"clean": "node ../common/node_modules/rimraf/bin.js ./dist",
|
||||||
"build": "npm run clean && npm run build:lint && npm run build:esm && npm run build:cjs && npm run build:browser && npm run build:uglify",
|
"build": "npm run clean && npm run build:lint && npm run build:esm && npm run build:cjs && npm run build:browser && npm run build:uglify",
|
||||||
"build:lint": "node ../node_modules/tslint/bin/tslint -c ../tslint.json -p ./tsconfig.json",
|
"build:lint": "node ../common/node_modules/tslint/bin/tslint -c ../tslint.json -p ./tsconfig.json",
|
||||||
"build:esm": "node ../node_modules/typescript/bin/tsc --project ./tsconfig.json --module es2015 --outDir ./dist/esm -d && node ./build/process-dts.js",
|
"build:esm": "node ../common/node_modules/typescript/bin/tsc --project ./tsconfig.json --module es2015 --outDir ./dist/esm -d && node ./build/process-dts.js",
|
||||||
"build:cjs": "node ../node_modules/typescript/bin/tsc --project ./tsconfig.json --module commonjs --outDir ./dist/cjs",
|
"build:cjs": "node ../common/node_modules/typescript/bin/tsc --project ./tsconfig.json --module commonjs --outDir ./dist/cjs",
|
||||||
"build:browser": "node ../node_modules/webpack-cli/bin/cli.js",
|
"build:browser": "node ../common/node_modules/webpack-cli/bin/cli.js",
|
||||||
"build:uglify": "node ../node_modules/uglify-js/bin/uglifyjs --source-map \"url='signalr.min.js.map',content='./dist/browser/signalr.js.map'\" --comments -o ./dist/browser/signalr.min.js ./dist/browser/signalr.js",
|
"build:uglify": "node ../common/node_modules/uglify-js/bin/uglifyjs --source-map \"url='signalr.min.js.map',content='./dist/browser/signalr.js.map'\" --comments -o ./dist/browser/signalr.min.js ./dist/browser/signalr.js",
|
||||||
"prepack": "node ../build/embed-version.js",
|
"prepack": "node ../build/embed-version.js",
|
||||||
"test": "echo \"Run 'npm test' in the 'clients\\ts' folder to test this package\" && exit 1"
|
"test": "echo \"Run 'npm test' in the 'clients\\ts' folder to test this package\" && exit 1"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
/** Error thrown when an HTTP request fails. */
|
/** Error thrown when an HTTP request fails. */
|
||||||
export class HttpError extends Error {
|
export class HttpError extends Error {
|
||||||
|
// @ts-ignore: Intentionally unused.
|
||||||
// tslint:disable-next-line:variable-name
|
// tslint:disable-next-line:variable-name
|
||||||
private __proto__: Error;
|
private __proto__: Error;
|
||||||
|
|
||||||
|
|
@ -27,6 +28,7 @@ export class HttpError extends Error {
|
||||||
|
|
||||||
/** Error thrown when a timeout elapses. */
|
/** Error thrown when a timeout elapses. */
|
||||||
export class TimeoutError extends Error {
|
export class TimeoutError extends Error {
|
||||||
|
// @ts-ignore: Intentionally unused.
|
||||||
// tslint:disable-next-line:variable-name
|
// tslint:disable-next-line:variable-name
|
||||||
private __proto__: Error;
|
private __proto__: Error;
|
||||||
|
|
||||||
|
|
@ -46,6 +48,7 @@ export class TimeoutError extends Error {
|
||||||
|
|
||||||
/** Error thrown when an action is aborted. */
|
/** Error thrown when an action is aborted. */
|
||||||
export class AbortError extends Error {
|
export class AbortError extends Error {
|
||||||
|
// @ts-ignore: Intentionally unused.
|
||||||
// tslint:disable-next-line:variable-name
|
// tslint:disable-next-line:variable-name
|
||||||
private __proto__: Error;
|
private __proto__: Error;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ export class NullLogger implements ILogger {
|
||||||
private constructor() {}
|
private constructor() {}
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
public log(logLevel: LogLevel, message: string): void {
|
// tslint:disable-next-line
|
||||||
|
public log(_logLevel: LogLevel, _message: string): void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,7 @@ export interface IStreamResult<T> {
|
||||||
*
|
*
|
||||||
* @typeparam T The type of the items being sent by the server.
|
* @typeparam T The type of the items being sent by the server.
|
||||||
*/
|
*/
|
||||||
// We can't remove this, it's a breaking change, but it's not used.
|
// @ts-ignore: We can't remove this, it's a breaking change, but it's not used.
|
||||||
// tslint:disable-next-line:no-unused-variable
|
|
||||||
export interface ISubscription<T> {
|
export interface ISubscription<T> {
|
||||||
/** Disconnects the {@link IStreamSubscriber} associated with this subscription from the stream. */
|
/** Disconnects the {@link IStreamSubscriber} associated with this subscription from the stream. */
|
||||||
dispose(): void;
|
dispose(): void;
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,8 @@ export class WebSocketTransport implements ITransport {
|
||||||
webSocket.binaryType = "arraybuffer";
|
webSocket.binaryType = "arraybuffer";
|
||||||
}
|
}
|
||||||
|
|
||||||
webSocket.onopen = (event: Event) => {
|
// tslint:disable-next-line:variable-name
|
||||||
|
webSocket.onopen = (_event: Event) => {
|
||||||
this.logger.log(LogLevel.Information, `WebSocket connected to ${url}`);
|
this.logger.log(LogLevel.Information, `WebSocket connected to ${url}`);
|
||||||
this.webSocket = webSocket;
|
this.webSocket = webSocket;
|
||||||
resolve();
|
resolve();
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"removeComments": false,
|
"removeComments": false,
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"noEmitOnError": true,
|
"noEmitOnError": true,
|
||||||
"stripInternal": true,
|
"stripInternal": true,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,12 @@
|
||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs"
|
"module": "commonjs",
|
||||||
|
"noUnusedLocals": false,
|
||||||
|
"noUnusedParameters": false,
|
||||||
|
"typeRoots": [
|
||||||
|
"./common/node_modules/@types"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./*/tests/**/*"
|
"./*/tests/**/*"
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
"unified-signatures": false,
|
"unified-signatures": false,
|
||||||
"max-classes-per-file": false,
|
"max-classes-per-file": false,
|
||||||
"no-floating-promises": true,
|
"no-floating-promises": true,
|
||||||
"no-unused-variable": [true, {"ignore-pattern": "^_"}],
|
|
||||||
"no-empty": false,
|
"no-empty": false,
|
||||||
"no-bitwise": false,
|
"no-bitwise": false,
|
||||||
"no-console": false
|
"no-console": false
|
||||||
|
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Test Page</title>
|
|
||||||
<style>
|
|
||||||
.test-success {
|
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
.test-failed {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Test Page</h1>
|
|
||||||
<p>This page validates that the UMD builds of the signalr-client and signalr-protocol-msgpack modules are available in the global scope when in a browser.</p>
|
|
||||||
<h2>Test Results</h2>
|
|
||||||
<ul id="results-list">
|
|
||||||
</ul>
|
|
||||||
<script src="./signalr-protocol-msgpack/node_modules/msgpack5/dist/msgpack5.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
function getParameterByName(name, url) {
|
|
||||||
if (!url) {
|
|
||||||
url = window.location.href;
|
|
||||||
}
|
|
||||||
name = name.replace(/[\[\]]/g, "\\$&");
|
|
||||||
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
|
||||||
results = regex.exec(url);
|
|
||||||
if (!results) return null;
|
|
||||||
if (!results[2]) return '';
|
|
||||||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
|
||||||
}
|
|
||||||
|
|
||||||
function importSignalR() {
|
|
||||||
var minified = getParameterByName('min') === 'true' ? '.min' : '';
|
|
||||||
document.write('<script type="text/javascript" src="./signalr/dist/browser/signalr' + minified + '.js"><\/script>');
|
|
||||||
document.write('<script type="text/javascript" src="./signalr-protocol-msgpack/dist/browser/signalr-protocol-msgpack' + minified + '.js"><\/script>');
|
|
||||||
}
|
|
||||||
|
|
||||||
var resultsList = document.getElementById("results-list");
|
|
||||||
// Run tests
|
|
||||||
function test(name, impl) {
|
|
||||||
var result = ""
|
|
||||||
var success = false;
|
|
||||||
try {
|
|
||||||
impl();
|
|
||||||
result = "success";
|
|
||||||
success = true;
|
|
||||||
} catch(e) {
|
|
||||||
console.error(e);
|
|
||||||
result = "error: " + e;
|
|
||||||
success = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var cssClass = success ? "test-success": "test-failed";
|
|
||||||
resultsList.innerHTML += "<li class=\"" + cssClass + "\">" + name + ": " + result + "</li>";
|
|
||||||
}
|
|
||||||
|
|
||||||
test("Promise may not be available before the polyfill", function() {
|
|
||||||
if(!Promise) {
|
|
||||||
throw "Promise is falsey: " + Promise;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
test("Buffer is not available before the polyfill", function() {
|
|
||||||
if(typeof Buffer !== "undefined") {
|
|
||||||
throw "Buffer is truthy: " + Buffer;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
importSignalR();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
test("Promise is available after the polyfill", function() {
|
|
||||||
if(!Promise) {
|
|
||||||
throw "Promise is falsey: " + Promise;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
test("Buffer is not available after the polyfill", function() {
|
|
||||||
if(typeof Buffer !== "undefined") {
|
|
||||||
throw "Buffer is truthy: " + Buffer;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
test("signalR is available", function() {
|
|
||||||
if(!window.signalR){
|
|
||||||
throw "window.signalR is falsey: " + window.signalR;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
test("msgpack5 is available", function() {
|
|
||||||
if(!window.msgpack5){
|
|
||||||
throw "window.msgpack5 is falsey: " + window.msgpack5;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
test("signalR.protocols.msgpack.MessagePackHubProtocol is available", function() {
|
|
||||||
if(!window.signalR.protocols.msgpack.MessagePackHubProtocol){
|
|
||||||
throw "signalR.protocols.msgpack is falsey: " + signalR.protocols.msgpack.MessagePackHubProtocol;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const webpack = require("webpack");
|
const webpack = require("./common/node_modules/webpack");
|
||||||
|
|
||||||
module.exports = function (modulePath, browserBaseName, options) {
|
module.exports = function (modulePath, browserBaseName, options) {
|
||||||
const pkg = require(path.resolve(modulePath, "package.json"));
|
const pkg = require(path.resolve(modulePath, "package.json"));
|
||||||
|
|
@ -17,6 +17,10 @@ module.exports = function (modulePath, browserBaseName, options) {
|
||||||
process: false,
|
process: false,
|
||||||
Buffer: false,
|
Buffer: false,
|
||||||
},
|
},
|
||||||
|
resolveLoader: {
|
||||||
|
// Special resolution rules for loaders (which are in the 'common' directory)
|
||||||
|
modules: [ path.resolve(__dirname, "common", "node_modules") ],
|
||||||
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue