Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 33cc640

Browse files
Remove obsolete 1.x APIs
1 parent baae621 commit 33cc640

File tree

10 files changed

+11
-112
lines changed

10 files changed

+11
-112
lines changed

samples/misc/NodeServicesExamples/Startup.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHo
4141
});
4242

4343
app.UseStaticFiles();
44-
loggerFactory.AddConsole();
4544
app.UseMvc(routes =>
4645
{
4746
routes.MapRoute(
@@ -53,6 +52,11 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHo
5352
public static void Main(string[] args)
5453
{
5554
var host = new WebHostBuilder()
55+
.ConfigureLogging(factory =>
56+
{
57+
factory.AddConsole();
58+
factory.AddDebug();
59+
})
5660
.UseContentRoot(Directory.GetCurrentDirectory())
5761
.UseIISIntegration()
5862
.UseKestrel()

samples/misc/Webpack/Clientside/PrerenderingSample.ts

-17
This file was deleted.

samples/misc/Webpack/Controllers/FullPagePrerenderingController.cs

-25
This file was deleted.

samples/misc/Webpack/Startup.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHo
3232
});
3333

3434
app.UseStaticFiles();
35-
loggerFactory.AddConsole();
3635
app.UseMvc(routes =>
3736
{
3837
routes.MapRoute(
@@ -44,6 +43,11 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHo
4443
public static void Main(string[] args)
4544
{
4645
var host = new WebHostBuilder()
46+
.ConfigureLogging(factory =>
47+
{
48+
factory.AddConsole();
49+
factory.AddDebug();
50+
})
4751
.UseContentRoot(Directory.GetCurrentDirectory())
4852
.UseIISIntegration()
4953
.UseKestrel()

samples/misc/Webpack/Views/Home/Index.cshtml

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
<h1>Hello</h1>
66
Hi there. Enter some text: <input />
77

8-
<hr />
9-
See also: <a asp-controller='FullPagePrerendering'>Full-page prerendering example</a>
10-
118
@section scripts {
129
<script src="dist/main.js"></script>
1310
}

src/Microsoft.AspNetCore.NodeServices/Configuration/NodeServicesServiceCollectionExtensions.cs

-14
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,6 @@ public static class NodeServicesServiceCollectionExtensions
1515
public static void AddNodeServices(this IServiceCollection serviceCollection)
1616
=> AddNodeServices(serviceCollection, _ => {});
1717

18-
/// <summary>
19-
/// Adds NodeServices support to the <paramref name="serviceCollection"/>.
20-
/// </summary>
21-
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
22-
/// <param name="options">Options for configuring the <see cref="INodeServices"/> instances.</param>
23-
[Obsolete("Use the AddNodeServices(Action<NodeServicesOptions> setupAction) overload instead.")]
24-
public static void AddNodeServices(this IServiceCollection serviceCollection, NodeServicesOptions options)
25-
{
26-
serviceCollection.AddSingleton(typeof (INodeServices), _ =>
27-
{
28-
return NodeServicesFactory.CreateNodeServices(options);
29-
});
30-
}
31-
3218
/// <summary>
3319
/// Adds NodeServices support to the <paramref name="serviceCollection"/>.
3420
/// </summary>

src/Microsoft.AspNetCore.NodeServices/INodeServices.cs

-21
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,5 @@ public interface INodeServices : IDisposable
5050
/// <param name="args">Any sequence of JSON-serializable arguments to be passed to the Node.js function.</param>
5151
/// <returns>A <see cref="Task{TResult}"/> representing the completion of the RPC call.</returns>
5252
Task<T> InvokeExportAsync<T>(CancellationToken cancellationToken, string moduleName, string exportedFunctionName, params object[] args);
53-
54-
/// <summary>
55-
/// Asynchronously invokes code in the Node.js instance.
56-
/// </summary>
57-
/// <typeparam name="T">The JSON-serializable data type that the Node.js code will asynchronously return.</typeparam>
58-
/// <param name="moduleName">The path to the Node.js module (i.e., JavaScript file) relative to your project root whose default CommonJS export is the function to be invoked.</param>
59-
/// <param name="args">Any sequence of JSON-serializable arguments to be passed to the Node.js function.</param>
60-
/// <returns>A <see cref="Task{TResult}"/> representing the completion of the RPC call.</returns>
61-
[Obsolete("Use InvokeAsync instead")]
62-
Task<T> Invoke<T>(string moduleName, params object[] args);
63-
64-
/// <summary>
65-
/// Asynchronously invokes code in the Node.js instance.
66-
/// </summary>
67-
/// <typeparam name="T">The JSON-serializable data type that the Node.js code will asynchronously return.</typeparam>
68-
/// <param name="moduleName">The path to the Node.js module (i.e., JavaScript file) relative to your project root that contains the code to be invoked.</param>
69-
/// <param name="exportedFunctionName">Specifies the CommonJS export to be invoked.</param>
70-
/// <param name="args">Any sequence of JSON-serializable arguments to be passed to the Node.js function.</param>
71-
/// <returns>A <see cref="Task{TResult}"/> representing the completion of the RPC call.</returns>
72-
[Obsolete("Use InvokeExportAsync instead")]
73-
Task<T> InvokeExport<T>(string moduleName, string exportedFunctionName, params object[] args);
7453
}
7554
}

src/Microsoft.AspNetCore.NodeServices/NodeServicesImpl.cs

-12
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,5 @@ private INodeInstance CreateNewNodeInstance()
161161
{
162162
return _nodeInstanceFactory();
163163
}
164-
165-
// Obsolete method - will be removed soon
166-
public Task<T> Invoke<T>(string moduleName, params object[] args)
167-
{
168-
return InvokeAsync<T>(moduleName, args);
169-
}
170-
171-
// Obsolete method - will be removed soon
172-
public Task<T> InvokeExport<T>(string moduleName, string exportedFunctionName, params object[] args)
173-
{
174-
return InvokeExportAsync<T>(moduleName, exportedFunctionName, args);
175-
}
176164
}
177165
}

src/Microsoft.AspNetCore.SpaServices/Prerendering/JavaScriptModuleExport.cs

-6
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,5 @@ public JavaScriptModuleExport(string moduleName)
2626
/// If not set, the JavaScript module's default CommonJS export must itself be the prerendering function.
2727
/// </summary>
2828
public string ExportName { get; set; }
29-
30-
/// <summary>
31-
/// Obsolete. Do not use. Instead, configure Webpack to build a Node.js-compatible bundle and reference that directly.
32-
/// </summary>
33-
[Obsolete("Do not use. This feature will be removed. Instead, configure Webpack to build a Node.js-compatible bundle and reference that directly.")]
34-
public string WebpackConfig { get; set; }
3529
}
3630
}

src/Microsoft.AspNetCore.SpaServices/Prerendering/PrerenderTagHelper.cs

+1-12
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public class PrerenderTagHelper : TagHelper
1919
{
2020
private const string PrerenderModuleAttributeName = "asp-prerender-module";
2121
private const string PrerenderExportAttributeName = "asp-prerender-export";
22-
private const string PrerenderWebpackConfigAttributeName = "asp-prerender-webpack-config";
2322
private const string PrerenderDataAttributeName = "asp-prerender-data";
2423
private const string PrerenderTimeoutAttributeName = "asp-prerender-timeout";
2524
private static INodeServices _fallbackNodeServices; // Used only if no INodeServices was registered with DI
@@ -59,13 +58,6 @@ public PrerenderTagHelper(IServiceProvider serviceProvider)
5958
[HtmlAttributeName(PrerenderExportAttributeName)]
6059
public string ExportName { get; set; }
6160

62-
/// <summary>
63-
/// Obsolete. Do not use. Instead, configure Webpack to build a Node.js-compatible bundle and reference that directly.
64-
/// </summary>
65-
[Obsolete("Do not use. This feature will be removed. Instead, configure Webpack to build a Node.js-compatible bundle and reference that directly.")]
66-
[HtmlAttributeName(PrerenderWebpackConfigAttributeName)]
67-
public string WebpackConfigPath { get; set; }
68-
6961
/// <summary>
7062
/// An optional JSON-serializable parameter to be supplied to the prerendering code.
7163
/// </summary>
@@ -111,10 +103,7 @@ public override async Task ProcessAsync(TagHelperContext context, TagHelperOutpu
111103
_nodeServices,
112104
new JavaScriptModuleExport(ModuleName)
113105
{
114-
ExportName = ExportName,
115-
#pragma warning disable CS0618 // Type or member is obsolete
116-
WebpackConfig = WebpackConfigPath
117-
#pragma warning restore CS0618 // Type or member is obsolete
106+
ExportName = ExportName
118107
},
119108
unencodedAbsoluteUrl,
120109
unencodedPathAndQuery,

0 commit comments

Comments
 (0)