mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Remove obsolete 1.x APIs
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user