Skip to content

Commit 5999180

Browse files
authored
Merge pull request #178 from JeringTech/replace_aspnetcore_dependency
Replaced AspNetCore dependency.
2 parents 59b108a + af7e54f commit 5999180

File tree

10 files changed

+430
-1087
lines changed

10 files changed

+430
-1087
lines changed

Changelog.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Changelog
2-
This project uses [semantic versioning](http://semver.org/spec/v2.0.0.html). Refer to
3-
*[Semantic Versioning in Practice](https://www.jering.tech/articles/semantic-versioning-in-practice)*
4-
for an overview of semantic versioning.
2+
This project uses semantic versioning.
53

6-
## [Unreleased](https://github.com/JeringTech/Javascript.NodeJS/compare/7.0.0-beta.5...HEAD)
4+
## [Unreleased](https://github.com/JeringTech/Javascript.NodeJS/compare/7.0.0...HEAD)
5+
6+
## [7.0.0](https://github.com/JeringTech/Javascript.NodeJS/compare/7.0.0-beta.5...7.0.0) - Sep 16, 2023
7+
### Changes
8+
- **Breaking Changes**:
9+
- Replaced the deprecated package `Microsoft.AspNetCore.Hosting.Abstractions` with `Microsoft.Extensions.Hosting.Abstractions`. ([#173](https://github.com/JeringTech/Javascript.NodeJS/pull/178)).
710

811
## [7.0.0-beta.5](https://github.com/JeringTech/Javascript.NodeJS/compare/7.0.0-beta.4...7.0.0-beta.5) - Jul 28, 2023
912
### Changes

ReadMe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ public string ProjectPath { get; set; }
12541254
```
12551255
###### Remarks
12561256
If this value is `null`, whitespace or an empty string and the application is an ASP.NET Core application,
1257-
project path is `IHostingEnvironment.ContentRootPath`.
1257+
project path is `IHostEnvironment.ContentRootPath`.
12581258
##### NodeJSProcessOptions.ExecutablePath
12591259
The value used to locate the NodeJS executable.
12601260
```csharp
@@ -1295,7 +1295,7 @@ public IDictionary<string, string> EnvironmentVariables { get; set; }
12951295
You can configure NodeJS by specifying environment variables for it. Find the full list of environment variables [here](https://nodejs.org/api/cli.html#cli_environment_variables).
12961296

12971297
If this value doesn't contain an element with key "NODE_ENV" and the application is an ASP.NET Core application,
1298-
an element with key "NODE_ENV" is added. The added element's value is "development" if `IHostingEnvironment.EnvironmentName` is `EnvironmentName.Development`,
1298+
an element with key "NODE_ENV" is added. The added element's value is "development" if `IHostEnvironment.EnvironmentName` is `Environments.Development`,
12991299
and "production" otherwise.
13001300
<!-- NodeJSProcessOptions generated docs -->
13011301
<!-- OutOfProcessNodeJSServiceOptions generated docs -->

perf/NodeJS/packages.lock.json

Lines changed: 16 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -56,42 +56,6 @@
5656
"resolved": "1.4.0",
5757
"contentHash": "ewkwHAqWpbsFp/rS9CDgr/5zEyNl47Vo2GBoJJcEMR5lNkjaCAMM/mMrVawJsSIEZtrL1AYm+YOm8OAKmhrDoA=="
5858
},
59-
"Microsoft.AspNetCore.Hosting.Abstractions": {
60-
"type": "Transitive",
61-
"resolved": "2.2.0",
62-
"contentHash": "ubycklv+ZY7Kutdwuy1W4upWcZ6VFR8WUXU7l7B2+mvbDBBPAcfpi+E+Y5GFe+Q157YfA3C49D2GCjAZc7Mobw==",
63-
"dependencies": {
64-
"Microsoft.AspNetCore.Hosting.Server.Abstractions": "2.2.0",
65-
"Microsoft.AspNetCore.Http.Abstractions": "2.2.0",
66-
"Microsoft.Extensions.Hosting.Abstractions": "2.2.0"
67-
}
68-
},
69-
"Microsoft.AspNetCore.Hosting.Server.Abstractions": {
70-
"type": "Transitive",
71-
"resolved": "2.2.0",
72-
"contentHash": "1PMijw8RMtuQF60SsD/JlKtVfvh4NORAhF4wjysdABhlhTrYmtgssqyncR0Stq5vqtjplZcj6kbT4LRTglt9IQ==",
73-
"dependencies": {
74-
"Microsoft.AspNetCore.Http.Features": "2.2.0",
75-
"Microsoft.Extensions.Configuration.Abstractions": "2.2.0"
76-
}
77-
},
78-
"Microsoft.AspNetCore.Http.Abstractions": {
79-
"type": "Transitive",
80-
"resolved": "2.2.0",
81-
"contentHash": "Nxs7Z1q3f1STfLYKJSVXCs1iBl+Ya6E8o4Oy1bCxJ/rNI44E/0f6tbsrVqAWfB7jlnJfyaAtIalBVxPKUPQb4Q==",
82-
"dependencies": {
83-
"Microsoft.AspNetCore.Http.Features": "2.2.0",
84-
"System.Text.Encodings.Web": "4.5.0"
85-
}
86-
},
87-
"Microsoft.AspNetCore.Http.Features": {
88-
"type": "Transitive",
89-
"resolved": "2.2.0",
90-
"contentHash": "ziFz5zH8f33En4dX81LW84I6XrYXKf9jg6aM39cM+LffN9KJahViKZ61dGMSO2gd3e+qe5yBRwsesvyqlZaSMg==",
91-
"dependencies": {
92-
"Microsoft.Extensions.Primitives": "2.2.0"
93-
}
94-
},
9559
"Microsoft.CodeAnalysis.Analyzers": {
9660
"type": "Transitive",
9761
"resolved": "2.6.1",
@@ -192,10 +156,10 @@
192156
},
193157
"Microsoft.Extensions.Configuration.Abstractions": {
194158
"type": "Transitive",
195-
"resolved": "3.1.15",
196-
"contentHash": "EEgcdG1SxIqIlMVLva8dLaBTwwzrjOYjQwXxFuULGKRQcglYLf5XTxPZ9RyTZBYxVsYVYolj2AAi8nnx/HD1tg==",
159+
"resolved": "7.0.0",
160+
"contentHash": "f34u2eaqIjNO9YLHBz8rozVZ+TcFiFs0F3r7nUJd7FRkVSxk8u4OpoK226mi49MwexHOR2ibP9MFvRUaLilcQQ==",
197161
"dependencies": {
198-
"Microsoft.Extensions.Primitives": "3.1.15"
162+
"Microsoft.Extensions.Primitives": "7.0.0"
199163
}
200164
},
201165
"Microsoft.Extensions.Configuration.Binder": {
@@ -217,26 +181,25 @@
217181
},
218182
"Microsoft.Extensions.DependencyInjection.Abstractions": {
219183
"type": "Transitive",
220-
"resolved": "6.0.0",
221-
"contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg=="
184+
"resolved": "7.0.0",
185+
"contentHash": "h3j/QfmFN4S0w4C2A6X7arXij/M/OVw3uQHSOFxnND4DyAzO1F9eMX7Eti7lU/OkSthEE0WzRsfT/Dmx86jzCw=="
222186
},
223187
"Microsoft.Extensions.FileProviders.Abstractions": {
224188
"type": "Transitive",
225-
"resolved": "2.2.0",
226-
"contentHash": "EcnaSsPTqx2MGnHrmWOD0ugbuuqVT8iICqSqPzi45V5/MA1LjUNb0kwgcxBGqizV1R+WeBK7/Gw25Jzkyk9bIw==",
189+
"resolved": "7.0.0",
190+
"contentHash": "NyawiW9ZT/liQb34k9YqBSNPLuuPkrjMgQZ24Y/xXX1RoiBkLUdPMaQTmxhZ5TYu8ZKZ9qayzil75JX95vGQUg==",
227191
"dependencies": {
228-
"Microsoft.Extensions.Primitives": "2.2.0"
192+
"Microsoft.Extensions.Primitives": "7.0.0"
229193
}
230194
},
231195
"Microsoft.Extensions.Hosting.Abstractions": {
232196
"type": "Transitive",
233-
"resolved": "2.2.0",
234-
"contentHash": "+k4AEn68HOJat5gj1TWa6X28WlirNQO9sPIIeQbia+91n03esEtMSSoekSTpMjUzjqtJWQN3McVx0GvSPFHF/Q==",
197+
"resolved": "7.0.0",
198+
"contentHash": "43n9Je09z0p/7ViPxfRqs5BUItRLNVh5b6JH40F2Agkh2NBsY/jpNYTtbCcxrHCsA3oRmbR6RJBzUutB4VZvNQ==",
235199
"dependencies": {
236-
"Microsoft.Extensions.Configuration.Abstractions": "2.2.0",
237-
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
238-
"Microsoft.Extensions.FileProviders.Abstractions": "2.2.0",
239-
"Microsoft.Extensions.Logging.Abstractions": "2.2.0"
200+
"Microsoft.Extensions.Configuration.Abstractions": "7.0.0",
201+
"Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0",
202+
"Microsoft.Extensions.FileProviders.Abstractions": "7.0.0"
240203
}
241204
},
242205
"Microsoft.Extensions.Http": {
@@ -308,8 +271,8 @@
308271
},
309272
"Microsoft.Extensions.Primitives": {
310273
"type": "Transitive",
311-
"resolved": "6.0.0",
312-
"contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==",
274+
"resolved": "7.0.0",
275+
"contentHash": "um1KU5kxcRp3CNuI8o/GrZtD4AIOXDk+RLsytjZ9QPok3ttLUelLKpilVPuaFT3TFjOhSibUAso0odbOaCDj3Q==",
313276
"dependencies": {
314277
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
315278
}
@@ -1284,11 +1247,8 @@
12841247
"jering.javascript.nodejs": {
12851248
"type": "Project",
12861249
"dependencies": {
1287-
"Microsoft.AspNetCore.Hosting.Abstractions": "[2.2.0, )",
1288-
"Microsoft.Extensions.DependencyInjection": "[6.0.0, )",
1250+
"Microsoft.Extensions.Hosting.Abstractions": "[7.0.0, )",
12891251
"Microsoft.Extensions.Http": "[6.0.0, )",
1290-
"Microsoft.Extensions.Logging": "[6.0.0, )",
1291-
"Microsoft.Extensions.Options": "[6.0.0, )",
12921252
"System.Text.Encodings.Web": "[6.0.0, )",
12931253
"System.Text.Json": "[6.0.5, )"
12941254
}

src/NodeJS/Jering.Javascript.NodeJS.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
</ItemGroup>
4646

4747
<ItemGroup>
48+
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
4849
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
4950
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
5051
<PrivateAssets>all</PrivateAssets>
@@ -60,10 +61,6 @@
6061
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
6162
</PackageReference>
6263
<PackageReference Include="System.Text.Json" Version="6.0.5" />
63-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
64-
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
65-
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
66-
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
6764
</ItemGroup>
6865

6966
<ItemGroup>

src/NodeJS/NodeJSServiceImplementations/OutOfProcess/ConfigureNodeJSProcessOptions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using Microsoft.AspNetCore.Hosting;
41
using Microsoft.Extensions.DependencyInjection;
2+
using Microsoft.Extensions.Hosting;
53
using Microsoft.Extensions.Options;
4+
using System;
5+
using System.Collections.Generic;
66

77
namespace Jering.Javascript.NodeJS
88
{
@@ -59,20 +59,20 @@ public void Configure(NodeJSProcessOptions options)
5959
using IServiceScope scope = _serviceScopeFactory.CreateScope();
6060
IServiceProvider serviceProvider = scope.ServiceProvider;
6161

62-
IHostingEnvironment? hostingEnvironment = serviceProvider.GetService<IHostingEnvironment>();
63-
if (hostingEnvironment == null)
62+
IHostEnvironment? hostEnvironment = serviceProvider.GetService<IHostEnvironment>();
63+
if (hostEnvironment == null)
6464
{
6565
return;
6666
}
6767

6868
if (!projectPathSpecified)
6969
{
70-
options.ProjectPath = hostingEnvironment.ContentRootPath;
70+
options.ProjectPath = hostEnvironment.ContentRootPath;
7171
}
7272

7373
if (!nodeEnvSpecified)
7474
{
75-
options.EnvironmentVariables["NODE_ENV"] = hostingEnvironment.IsDevelopment() ? "development" : "production"; // De-facto standard values for Node
75+
options.EnvironmentVariables["NODE_ENV"] = hostEnvironment.IsDevelopment() ? "development" : "production"; // De-facto standard values for Node
7676
}
7777
}
7878
}

src/NodeJS/NodeJSServiceImplementations/OutOfProcess/NodeJSProcessOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.AspNetCore.Hosting;
1+
using Microsoft.Extensions.Hosting;
22
using System.Collections.Generic;
33
using System.IO;
44

@@ -12,7 +12,7 @@ public class NodeJSProcessOptions
1212
/// <summary>The base path for resolving NodeJS module paths.</summary>
1313
/// <remarks>
1414
/// <para>If this value is <c>null</c>, whitespace or an empty string and the application is an ASP.NET Core application,
15-
/// project path is <see cref="IHostingEnvironment.ContentRootPath"/>.</para>
15+
/// project path is <see cref="IHostEnvironment.ContentRootPath"/>.</para>
1616
/// </remarks>
1717
public string ProjectPath { get; set; } = Directory.GetCurrentDirectory();
1818

@@ -43,7 +43,7 @@ public class NodeJSProcessOptions
4343
/// <remarks>
4444
/// <para>You can configure NodeJS by specifying environment variables for it. Find the full list of environment variables <a href="https://nodejs.org/api/cli.html#cli_environment_variables">here</a>.</para>
4545
/// <para>If this value doesn't contain an element with key "NODE_ENV" and the application is an ASP.NET Core application,
46-
/// an element with key "NODE_ENV" is added. The added element's value is "development" if <see cref="IHostingEnvironment.EnvironmentName"/> is <see cref="EnvironmentName.Development"/>,
46+
/// an element with key "NODE_ENV" is added. The added element's value is "development" if <see cref="IHostEnvironment.EnvironmentName"/> is <see cref="Environments.Development"/>,
4747
/// and "production" otherwise.</para>
4848
/// </remarks>
4949
public IDictionary<string, string> EnvironmentVariables { get; set; } = new Dictionary<string, string>();

src/NodeJS/NodeJSServiceImplementations/OutOfProcess/OutOfProcessNodeJSService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ internal virtual (bool trackInvokeTasks, ConcurrentDictionary<Task, object?> tra
564564
finally
565565
{
566566
// Remove completed task, note that it might already have been removed in MoveToNewProcessAsync
567-
trackedInvokeTasks.TryRemove(trackedInvokeTask, out object _);
567+
trackedInvokeTasks.TryRemove(trackedInvokeTask, out object? _);
568568
}
569569
}
570570

0 commit comments

Comments
 (0)