Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ This project uses [semantic versioning](http://semver.org/spec/v2.0.0.html). Ref
*[Semantic Versioning in Practice](https://www.jering.tech/articles/semantic-versioning-in-practice)*
for an overview of semantic versioning.

## [Unreleased](https://github.com/JeringTech/Javascript.NodeJS/compare/5.4.4...HEAD)
## [Unreleased](https://github.com/JeringTech/Javascript.NodeJS/compare/6.0.0-beta.0...HEAD)

## [6.0.0-beta.0](https://github.com/JeringTech/Javascript.NodeJS/compare/5.4.4...6.0.0-beta.0) - Feb 10, 2021
### Additions
- Added NetCoreApp3.0 as a target.
- Library uses HTTP/2 to communicate with Node.js when using NetCoreApp3.0 binaries.
### Changes
- **Breaking**: Simplified the surface area of `IHttpClientService`. Users can use DI to register a custom implementation of this service
to customize their `HttpClient`.

## [5.4.4](https://github.com/JeringTech/Javascript.NodeJS/compare/5.4.3...5.4.4) - Jan 18, 2021
### Fixes
Expand Down
2 changes: 1 addition & 1 deletion perf/NodeJS/Jering.Javascript.NodeJS.Performance.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<CodeAnalysisRuleSet>../../Jering.Javascript.NodeJS.ruleset</CodeAnalysisRuleSet>
Expand Down
2 changes: 1 addition & 1 deletion perf/NodeJS/PoolThreadingBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class PoolThreadingBenchmarks
private LockFreeMethod _lockFree;
private LockMethod _lock;

private IEnumerable<int> _source = Enumerable.Range(0, 2000);
private readonly IEnumerable<int> _source = Enumerable.Range(0, 2000);

[GlobalSetup]
public void Setup()
Expand Down
134 changes: 72 additions & 62 deletions perf/NodeJS/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
".NETCoreApp,Version=v3.0": {
".NETCoreApp,Version=v3.1": {
"BenchmarkDotNet": {
"type": "Direct",
"requested": "[0.12.0, )",
Expand Down Expand Up @@ -46,48 +46,40 @@
"resolved": "2.4.3",
"contentHash": "U2FC9Y8NyIxxU6MpFFdWWu1xwiqz/61v/Doou7kmVjpeIEMLWyiNNkzNlSE84kyJ0O1LKApuEj5z48Ow0Hi4OQ=="
},
"Jering.IocServices.System.Net.Http": {
"type": "Transitive",
"resolved": "0.4.0",
"contentHash": "EyaYjK7wTMfXRQ1xUC98+vFiV5Tkg0NW4Z5OjWa4dnY6Z6nD5JQokZeobzohT0suQichbeX/7AOLtiQNyEcaLQ==",
"dependencies": {
"NETStandard.Library": "1.6.1"
}
},
"Microsoft.AspNetCore.Hosting.Abstractions": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "1TQgBfd/NPZLR2o/h6l5Cml2ZCF5hsyV4h9WEwWwAIavrbdTnaNozGGcTOd4AOgQvogMM9UM1ajflm9Cwd0jLQ==",
"resolved": "2.2.0",
"contentHash": "ubycklv+ZY7Kutdwuy1W4upWcZ6VFR8WUXU7l7B2+mvbDBBPAcfpi+E+Y5GFe+Q157YfA3C49D2GCjAZc7Mobw==",
"dependencies": {
"Microsoft.AspNetCore.Hosting.Server.Abstractions": "2.1.0",
"Microsoft.AspNetCore.Http.Abstractions": "2.1.0",
"Microsoft.Extensions.Hosting.Abstractions": "2.1.0"
"Microsoft.AspNetCore.Hosting.Server.Abstractions": "2.2.0",
"Microsoft.AspNetCore.Http.Abstractions": "2.2.0",
"Microsoft.Extensions.Hosting.Abstractions": "2.2.0"
}
},
"Microsoft.AspNetCore.Hosting.Server.Abstractions": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "YTKMi2vHX6P+WHEVpW/DS+eFHnwivCSMklkyamcK1ETtc/4j8H3VR0kgW8XIBqukNxhD8k5wYt22P7PhrWSXjQ==",
"resolved": "2.2.0",
"contentHash": "1PMijw8RMtuQF60SsD/JlKtVfvh4NORAhF4wjysdABhlhTrYmtgssqyncR0Stq5vqtjplZcj6kbT4LRTglt9IQ==",
"dependencies": {
"Microsoft.AspNetCore.Http.Features": "2.1.0",
"Microsoft.Extensions.Configuration.Abstractions": "2.1.0"
"Microsoft.AspNetCore.Http.Features": "2.2.0",
"Microsoft.Extensions.Configuration.Abstractions": "2.2.0"
}
},
"Microsoft.AspNetCore.Http.Abstractions": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "vbFDyKsSYBnxl3+RABtN79b0vsTcG66fDY8vD6Nqvu9uLtSej70Q5NcbGlnN6bJpZci5orSdgFTHMhBywivDPg==",
"resolved": "2.2.0",
"contentHash": "Nxs7Z1q3f1STfLYKJSVXCs1iBl+Ya6E8o4Oy1bCxJ/rNI44E/0f6tbsrVqAWfB7jlnJfyaAtIalBVxPKUPQb4Q==",
"dependencies": {
"Microsoft.AspNetCore.Http.Features": "2.1.0",
"Microsoft.AspNetCore.Http.Features": "2.2.0",
"System.Text.Encodings.Web": "4.5.0"
}
},
"Microsoft.AspNetCore.Http.Features": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "UmkUePxRjsQW0j5euFFscBwjvTu25b8+qIK/2fI3GvcqQ+mkwgbWNAT8b/Gkoei1m2bTWC07lSdutuRDPPLcJA==",
"resolved": "2.2.0",
"contentHash": "ziFz5zH8f33En4dX81LW84I6XrYXKf9jg6aM39cM+LffN9KJahViKZ61dGMSO2gd3e+qe5yBRwsesvyqlZaSMg==",
"dependencies": {
"Microsoft.Extensions.Primitives": "2.1.0"
"Microsoft.Extensions.Primitives": "2.2.0"
}
},
"Microsoft.CodeAnalysis.Analyzers": {
Expand Down Expand Up @@ -191,51 +183,63 @@
},
"Microsoft.Extensions.DependencyInjection": {
"type": "Transitive",
"resolved": "3.0.0",
"contentHash": "yDsuNA/BT4j9qrcRs0NUNHQAJfywFWX18ZZ+shxXJL+/nIfz3vhuRTfnYgvFeQlNBlgmgdSjOcs4ajgoS6Q/Ng==",
"resolved": "5.0.1",
"contentHash": "//mDNrYeiJ0eh/awFhDFJQzkRVra/njU5Y4fyK7X29g5HScrzbUkKOKlyTtygthcGFt4zNC8G5CFCjb/oizomA==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.0.0"
"Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "3.0.0",
"contentHash": "ofQRroDlzJ0xKOtzNuaVt6QKNImFkhkG0lIMpGl7PtXnIf5SuLWBeiQZAP8DNSxDBJJdcsPkiJiMYK2WA5H8dQ=="
"resolved": "5.0.0",
"contentHash": "ORj7Zh81gC69TyvmcUm9tSzytcy8AVousi+IVRAI8nLieQjOFryRusSFh7+aLk16FN9pQNqJAiMd7BTKINK0kA=="
},
"Microsoft.Extensions.FileProviders.Abstractions": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "itv+7XBu58pxi8mykxx9cUO1OOVYe0jmQIZVSZVp5lOcLxB7sSV2bnHiI1RSu6Nxne/s6+oBla3ON5CCMSmwhQ==",
"resolved": "2.2.0",
"contentHash": "EcnaSsPTqx2MGnHrmWOD0ugbuuqVT8iICqSqPzi45V5/MA1LjUNb0kwgcxBGqizV1R+WeBK7/Gw25Jzkyk9bIw==",
"dependencies": {
"Microsoft.Extensions.Primitives": "2.1.0"
"Microsoft.Extensions.Primitives": "2.2.0"
}
},
"Microsoft.Extensions.Hosting.Abstractions": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "BpMaoBxdXr5VD0yk7rYN6R8lAU9X9JbvsPveNdKT+llIn3J5s4sxpWqaSG/NnzTzTLU5eJE5nrecTl7clg/7dQ==",
"resolved": "2.2.0",
"contentHash": "+k4AEn68HOJat5gj1TWa6X28WlirNQO9sPIIeQbia+91n03esEtMSSoekSTpMjUzjqtJWQN3McVx0GvSPFHF/Q==",
"dependencies": {
"Microsoft.Extensions.Configuration.Abstractions": "2.1.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.1.0",
"Microsoft.Extensions.FileProviders.Abstractions": "2.1.0",
"Microsoft.Extensions.Logging.Abstractions": "2.1.0"
"Microsoft.Extensions.Configuration.Abstractions": "2.2.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.FileProviders.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging.Abstractions": "2.2.0"
}
},
"Microsoft.Extensions.Http": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "kT1ijDKZuSUhBtYoC1sXrmVKP7mA08h9Xrsr4VrS/QOtiKCEtUTTd7dd3XI9dwAb46tZSak13q/zdIcr4jqbyg==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0",
"Microsoft.Extensions.Logging": "5.0.0",
"Microsoft.Extensions.Logging.Abstractions": "5.0.0",
"Microsoft.Extensions.Options": "5.0.0"
}
},
"Microsoft.Extensions.Logging": {
"type": "Transitive",
"resolved": "3.0.0",
"contentHash": "rxs1i2denq0Sv0XMvAeISK7AskV5x7aihvlIlepJKFfkbE6PgbeXfPOElD0kf3Wr2Roo57ASQa5xUL9LTHWChA==",
"resolved": "5.0.0",
"contentHash": "MgOwK6tPzB6YNH21wssJcw/2MKwee8b2gI7SllYfn6rvTpIrVvVS5HAjSU2vqSku1fwqRvWP0MdIi14qjd93Aw==",
"dependencies": {
"Microsoft.Extensions.Configuration.Binder": "3.0.0",
"Microsoft.Extensions.DependencyInjection": "3.0.0",
"Microsoft.Extensions.Logging.Abstractions": "3.0.0",
"Microsoft.Extensions.Options": "3.0.0"
"Microsoft.Extensions.DependencyInjection": "5.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0",
"Microsoft.Extensions.Logging.Abstractions": "5.0.0",
"Microsoft.Extensions.Options": "5.0.0",
"System.Diagnostics.DiagnosticSource": "5.0.0"
}
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Transitive",
"resolved": "3.0.0",
"contentHash": "+PsosTYZn+omucI0ff9eywo9QcPLwcbIWf7dz7ZLM1zGR8gVZXJ3wo6+tkuIedUNW5iWENlVJPEvrGjiVeoNNQ=="
"resolved": "5.0.0",
"contentHash": "NxP6ahFcBnnSfwNBi2KH2Oz8Xl5Sm2krjId/jRR3I7teFphwiUoUeZPwTNA21EX+5PtjqmyAvKaOeBXcJjcH/w=="
},
"Microsoft.Extensions.Logging.Configuration": {
"type": "Transitive",
Expand All @@ -258,11 +262,11 @@
},
"Microsoft.Extensions.Options": {
"type": "Transitive",
"resolved": "3.0.0",
"contentHash": "aZuVhN/TC872Yb55nrb7an82sfSAdNYxIyzu3zbYHOnhwal5hdkBUxzuoYj1khI2sw0tWq6i82i624zEFmiJhg==",
"resolved": "5.0.0",
"contentHash": "CBvR92TCJ5uBIdd9/HzDSrxYak+0W/3+yxrNg8Qm6Bmrkh5L+nu6m3WeazQehcZ5q1/6dDA7J5YdQjim0165zg==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.0.0",
"Microsoft.Extensions.Primitives": "3.0.0"
"Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0",
"Microsoft.Extensions.Primitives": "5.0.0"
}
},
"Microsoft.Extensions.Options.ConfigurationExtensions": {
Expand All @@ -278,8 +282,8 @@
},
"Microsoft.Extensions.Primitives": {
"type": "Transitive",
"resolved": "3.0.0",
"contentHash": "6gwewTbmOh+ZVBicVkL1XRp79sx4O7BVY6Yy+7OYZdwn3pyOKe9lOam+3gXJ3TZMjhJZdV0Ub8hxHt2vkrmN5Q=="
"resolved": "5.0.0",
"contentHash": "cI/VWn9G1fghXrNDagX9nYaaB/nokkZn0HYAawGaELQrl8InSezfe9OnfPZLcJq3esXxygh3hkq2c3qoV3SDyQ=="
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
Expand Down Expand Up @@ -491,6 +495,11 @@
"System.Runtime": "4.3.0"
}
},
"System.Diagnostics.DiagnosticSource": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA=="
},
"System.Diagnostics.FileVersionInfo": {
"type": "Transitive",
"resolved": "4.3.0",
Expand Down Expand Up @@ -1057,13 +1066,13 @@
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "Xg4G4Indi4dqP1iuAiMSwpiWS54ZghzR644OtsRCm/m/lBMG8dUBhLVN7hLm8NNrNTR+iGbshCPTwrvxZPlm4g=="
"resolved": "5.0.0",
"contentHash": "EEslUvHKll1ftizbn20mX3Ix/l4Ygk/bdJ2LY6/X6FlGaP0RIhKMo9nS6JIGnKKT6KBP2PGj6JC3B9/ZF6ErqQ=="
},
"System.Text.Json": {
"type": "Transitive",
"resolved": "4.6.0",
"contentHash": "4F8Xe+JIkVoDJ8hDAZ7HqLkjctN/6WItJIzQaifBwClC7wmoLSda/Sv2i6i1kycqDb3hWF4JCVbpAweyOKHEUA=="
"resolved": "5.0.1",
"contentHash": "/UM3UK1dXKl8Ybysg/21gM4S8DJgkR+yLU8JwqCVbuNqQNImelntgYFAN5QxR8sJJ1kMx//hOUdf0lltosi8cQ=="
},
"System.Text.RegularExpressions": {
"type": "Transitive",
Expand Down Expand Up @@ -1218,12 +1227,13 @@
"jering.javascript.nodejs": {
"type": "Project",
"dependencies": {
"Jering.IocServices.System.Net.Http": "0.4.0",
"Microsoft.AspNetCore.Hosting.Abstractions": "2.1.0",
"Microsoft.Extensions.DependencyInjection": "2.1.0",
"Microsoft.Extensions.Logging": "2.1.0",
"Microsoft.Extensions.Options": "2.1.0",
"System.Text.Json": "4.6.0"
"Microsoft.AspNetCore.Hosting.Abstractions": "2.2.0",
"Microsoft.Extensions.DependencyInjection": "5.0.1",
"Microsoft.Extensions.Http": "5.0.0",
"Microsoft.Extensions.Logging": "5.0.0",
"Microsoft.Extensions.Options": "5.0.0",
"System.Text.Encodings.Web": "5.0.0",
"System.Text.Json": "5.0.1"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/NodeJS/Javascript/InvocationData/ModuleSourceType.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enum ModuleSourceType {
const enum ModuleSourceType {
Cache,
File,
String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ server.on('clientError', serverOnClientError);
// Start server
server.listen(parseInt(args.port), 'localhost', serverOnListeningListener);

function serverOnRequestListener(req, res) {
function serverOnRequestListener(req: http.IncomingMessage, res: http.ServerResponse) {
const bodyChunks = [];
req.
on('data', chunk => bodyChunks.push(chunk)).
Expand Down Expand Up @@ -220,7 +220,7 @@ function serverOnClientError(error: Error, socket: stream.Duplex) {
// Send timeout details to client for debugging - this shouldn't fire but there have been various node http server timeout issues in the past.
// The socket won't actually get closed (the timeout function needs to do that manually).
function serverOnTimeout(socket: Socket) {
console.error(`Ignoring unexpected socket timeout for address ${socket.remoteAddress}, port ${socket.remotePort}`);
console.log(`[Node.js HTTP server] Ignoring unexpected socket timeout for address ${socket.remoteAddress}, port ${socket.remotePort}`);
}

function serverOnListeningListener() {
Expand Down Expand Up @@ -270,14 +270,14 @@ function parseArgs(args: string[]) {
function exitWhenParentExits(parentPid: number, ignoreSigint: boolean, pollIntervalMS: number) {
setInterval(() => {
if (!processExists(parentPid)) {
console.log(`Parent process (pid: ${parentPid}) exited. Exiting this process...`);
console.log(`[Node.js HTTP server] Parent process (pid: ${parentPid}) exited. Exiting this process...`);
process.exit();
}
}, pollIntervalMS);

if (ignoreSigint) {
process.on('SIGINT', () => {
console.log('Received SIGINT. Waiting for .NET process to exit...');
console.log('[Node.js HTTP server] Received SIGINT. Waiting for .NET process to exit...');
});
}
}
Expand Down
Loading