Remove obsolete 1.x APIs

This commit is contained in:
Steve Sanderson
2017-05-18 14:17:29 +01:00
parent baae62132b
commit 33cc640942
10 changed files with 11 additions and 112 deletions

View File

@@ -15,20 +15,6 @@ namespace Microsoft.Extensions.DependencyInjection
public static void AddNodeServices(this IServiceCollection serviceCollection)
=> AddNodeServices(serviceCollection, _ => {});
/// <summary>
/// Adds NodeServices support to the <paramref name="serviceCollection"/>.
/// </summary>
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
/// <param name="options">Options for configuring the <see cref="INodeServices"/> instances.</param>
[Obsolete("Use the AddNodeServices(Action<NodeServicesOptions> setupAction) overload instead.")]
public static void AddNodeServices(this IServiceCollection serviceCollection, NodeServicesOptions options)
{
serviceCollection.AddSingleton(typeof (INodeServices), _ =>
{
return NodeServicesFactory.CreateNodeServices(options);
});
}
/// <summary>
/// Adds NodeServices support to the <paramref name="serviceCollection"/>.
/// </summary>

View File

@@ -50,26 +50,5 @@ namespace Microsoft.AspNetCore.NodeServices
/// <param name="args">Any sequence of JSON-serializable arguments to be passed to the Node.js function.</param>
/// <returns>A <see cref="Task{TResult}"/> representing the completion of the RPC call.</returns>
Task<T> InvokeExportAsync<T>(CancellationToken cancellationToken, string moduleName, string exportedFunctionName, params object[] args);
/// <summary>
/// Asynchronously invokes code in the Node.js instance.
/// </summary>
/// <typeparam name="T">The JSON-serializable data type that the Node.js code will asynchronously return.</typeparam>
/// <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>
/// <param name="args">Any sequence of JSON-serializable arguments to be passed to the Node.js function.</param>
/// <returns>A <see cref="Task{TResult}"/> representing the completion of the RPC call.</returns>
[Obsolete("Use InvokeAsync instead")]
Task<T> Invoke<T>(string moduleName, params object[] args);
/// <summary>
/// Asynchronously invokes code in the Node.js instance.
/// </summary>
/// <typeparam name="T">The JSON-serializable data type that the Node.js code will asynchronously return.</typeparam>
/// <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>
/// <param name="exportedFunctionName">Specifies the CommonJS export to be invoked.</param>
/// <param name="args">Any sequence of JSON-serializable arguments to be passed to the Node.js function.</param>
/// <returns>A <see cref="Task{TResult}"/> representing the completion of the RPC call.</returns>
[Obsolete("Use InvokeExportAsync instead")]
Task<T> InvokeExport<T>(string moduleName, string exportedFunctionName, params object[] args);
}
}

View File

@@ -161,17 +161,5 @@ namespace Microsoft.AspNetCore.NodeServices
{
return _nodeInstanceFactory();
}
// Obsolete method - will be removed soon
public Task<T> Invoke<T>(string moduleName, params object[] args)
{
return InvokeAsync<T>(moduleName, args);
}
// Obsolete method - will be removed soon
public Task<T> InvokeExport<T>(string moduleName, string exportedFunctionName, params object[] args)
{
return InvokeExportAsync<T>(moduleName, exportedFunctionName, args);
}
}
}

View File

@@ -26,11 +26,5 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering
/// If not set, the JavaScript module's default CommonJS export must itself be the prerendering function.
/// </summary>
public string ExportName { get; set; }
/// <summary>
/// Obsolete. Do not use. Instead, configure Webpack to build a Node.js-compatible bundle and reference that directly.
/// </summary>
[Obsolete("Do not use. This feature will be removed. Instead, configure Webpack to build a Node.js-compatible bundle and reference that directly.")]
public string WebpackConfig { get; set; }
}
}

View File

@@ -19,7 +19,6 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering
{
private const string PrerenderModuleAttributeName = "asp-prerender-module";
private const string PrerenderExportAttributeName = "asp-prerender-export";
private const string PrerenderWebpackConfigAttributeName = "asp-prerender-webpack-config";
private const string PrerenderDataAttributeName = "asp-prerender-data";
private const string PrerenderTimeoutAttributeName = "asp-prerender-timeout";
private static INodeServices _fallbackNodeServices; // Used only if no INodeServices was registered with DI
@@ -59,13 +58,6 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering
[HtmlAttributeName(PrerenderExportAttributeName)]
public string ExportName { get; set; }
/// <summary>
/// Obsolete. Do not use. Instead, configure Webpack to build a Node.js-compatible bundle and reference that directly.
/// </summary>
[Obsolete("Do not use. This feature will be removed. Instead, configure Webpack to build a Node.js-compatible bundle and reference that directly.")]
[HtmlAttributeName(PrerenderWebpackConfigAttributeName)]
public string WebpackConfigPath { get; set; }
/// <summary>
/// An optional JSON-serializable parameter to be supplied to the prerendering code.
/// </summary>
@@ -111,10 +103,7 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering
_nodeServices,
new JavaScriptModuleExport(ModuleName)
{
ExportName = ExportName,
#pragma warning disable CS0618 // Type or member is obsolete
WebpackConfig = WebpackConfigPath
#pragma warning restore CS0618 // Type or member is obsolete
ExportName = ExportName
},
unencodedAbsoluteUrl,
unencodedPathAndQuery,