From 14f17fa7cdca33fa7b1964ae6a54e4e1c294499e Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Fri, 9 Aug 2019 13:47:51 -0700 Subject: [PATCH] =?UTF-8?q?Obsolete=20Microsoft.AspNetCore.SpaServices=20a?= =?UTF-8?q?nd=20Microsoft.AspNetCore.No=E2=80=A6=20(#12892)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Obsolete Microsoft.AspNetCore.SpaServices and Microsoft.AspNetCore.NodeServices --- src/Middleware/Middleware.sln | 45 ++-- ...t.AspNetCore.NodeServices.netcoreapp3.0.cs | 16 ++ .../Controllers/HomeController.cs | 20 +- .../NodeServicesExamples.csproj | 5 +- .../samples/NodeServicesExamples/Startup.cs | 18 +- .../src/Configuration/NodeServicesFactory.cs | 7 +- .../src/Configuration/NodeServicesOptions.cs | 4 + ...NodeServicesServiceCollectionExtensions.cs | 6 + .../src/HostingModels/HttpNodeInstance.cs | 4 + .../src/HostingModels/INodeInstance.cs | 6 +- .../HostingModels/NodeInvocationException.cs | 6 +- .../src/HostingModels/NodeInvocationInfo.cs | 6 + .../NodeServicesOptionsExtensions.cs | 9 +- .../HostingModels/OutOfProcessNodeInstance.cs | 6 +- .../NodeServices/src/INodeServices.cs | 6 +- .../NodeServices/src/NodeServicesImpl.cs | 6 +- .../src/Util/EmbeddedResourceReader.cs | 7 +- .../NodeServices/src/Util/StringAsTempFile.cs | 6 +- .../NodeServices/src/Util/TaskExtensions.cs | 9 +- .../NodeServices/test/NodeServicesTest.cs | 5 +- ...re.SpaServices.Extensions.netcoreapp3.0.cs | 5 + .../src/AngularCli/AngularCliBuilder.cs | 3 +- ...t.AspNetCore.SpaServices.Extensions.csproj | 6 +- .../Prerendering/ISpaPrerendererBuilder.cs | 5 +- .../Prerendering/SpaPrerenderingExtensions.cs | 2 + .../Prerendering/SpaPrerenderingOptions.cs | 3 +- ...etCore.SpaServices.Extensions.Tests.csproj | 17 ++ .../test/SpaServicesExtensionsTests.cs | 51 ++++ ...ft.AspNetCore.SpaServices.netcoreapp3.0.cs | 12 + .../SpaServices/samples/Webpack/.gitignore | 233 ------------------ .../Webpack/ActionResults/PrerenderResult.cs | 52 ---- .../PrerenderResultExtensions.cs | 13 - .../samples/Webpack/Clientside/App.ts | 4 - .../samples/Webpack/Clientside/HelloWorld.ts | 5 - .../Webpack/Clientside/styles/main.less | 5 - .../Webpack/Controllers/HomeController.cs | 16 -- .../SpaServices/samples/Webpack/Startup.cs | 59 ----- .../samples/Webpack/Views/Home/Index.cshtml | 10 - .../samples/Webpack/Views/Shared/Error.cshtml | 6 - .../Webpack/Views/Shared/_Layout.cshtml | 14 -- .../samples/Webpack/Views/_ViewImports.cshtml | 2 - .../samples/Webpack/Views/_ViewStart.cshtml | 3 - .../samples/Webpack/Webpack.csproj | 25 -- .../samples/Webpack/appsettings.json | 10 - .../SpaServices/samples/Webpack/package.json | 20 -- .../SpaServices/samples/Webpack/tsconfig.json | 13 - .../samples/Webpack/webpack.config.dev.js | 8 - .../samples/Webpack/webpack.config.js | 25 -- .../samples/Webpack/webpack.config.prod.js | 15 -- .../samples/Webpack/wwwroot/favicon.ico | Bin 32038 -> 0 bytes .../samples/Webpack/wwwroot/web.config | 9 - .../src/Prerendering/DefaultSpaPrerenderer.cs | 5 + .../src/Prerendering/ISpaPrerenderer.cs | 7 +- .../Prerendering/JavaScriptModuleExport.cs | 6 +- .../src/Prerendering/PrerenderTagHelper.cs | 4 + .../src/Prerendering/Prerenderer.cs | 10 +- ...PrerenderingServiceCollectionExtensions.cs | 8 +- .../src/Prerendering/RenderToStringResult.cs | 7 +- .../src/Routing/SpaRouteConstraint.cs | 6 +- .../src/Routing/SpaRouteExtensions.cs | 6 +- .../src/Webpack/ConditionalProxyMiddleware.cs | 9 +- .../ConditionalProxyMiddlewareOptions.cs | 6 +- .../src/Webpack/WebpackDevMiddleware.cs | 7 +- .../Webpack/WebpackDevMiddlewareOptions.cs | 13 +- 64 files changed, 324 insertions(+), 618 deletions(-) create mode 100644 src/Middleware/SpaServices.Extensions/test/Microsoft.AspNetCore.SpaServices.Extensions.Tests.csproj create mode 100644 src/Middleware/SpaServices.Extensions/test/SpaServicesExtensionsTests.cs delete mode 100644 src/Middleware/SpaServices/samples/Webpack/.gitignore delete mode 100644 src/Middleware/SpaServices/samples/Webpack/ActionResults/PrerenderResult.cs delete mode 100644 src/Middleware/SpaServices/samples/Webpack/ActionResults/PrerenderResultExtensions.cs delete mode 100644 src/Middleware/SpaServices/samples/Webpack/Clientside/App.ts delete mode 100644 src/Middleware/SpaServices/samples/Webpack/Clientside/HelloWorld.ts delete mode 100644 src/Middleware/SpaServices/samples/Webpack/Clientside/styles/main.less delete mode 100644 src/Middleware/SpaServices/samples/Webpack/Controllers/HomeController.cs delete mode 100644 src/Middleware/SpaServices/samples/Webpack/Startup.cs delete mode 100644 src/Middleware/SpaServices/samples/Webpack/Views/Home/Index.cshtml delete mode 100644 src/Middleware/SpaServices/samples/Webpack/Views/Shared/Error.cshtml delete mode 100644 src/Middleware/SpaServices/samples/Webpack/Views/Shared/_Layout.cshtml delete mode 100644 src/Middleware/SpaServices/samples/Webpack/Views/_ViewImports.cshtml delete mode 100644 src/Middleware/SpaServices/samples/Webpack/Views/_ViewStart.cshtml delete mode 100644 src/Middleware/SpaServices/samples/Webpack/Webpack.csproj delete mode 100644 src/Middleware/SpaServices/samples/Webpack/appsettings.json delete mode 100644 src/Middleware/SpaServices/samples/Webpack/package.json delete mode 100644 src/Middleware/SpaServices/samples/Webpack/tsconfig.json delete mode 100644 src/Middleware/SpaServices/samples/Webpack/webpack.config.dev.js delete mode 100644 src/Middleware/SpaServices/samples/Webpack/webpack.config.js delete mode 100644 src/Middleware/SpaServices/samples/Webpack/webpack.config.prod.js delete mode 100644 src/Middleware/SpaServices/samples/Webpack/wwwroot/favicon.ico delete mode 100644 src/Middleware/SpaServices/samples/Webpack/wwwroot/web.config diff --git a/src/Middleware/Middleware.sln b/src/Middleware/Middleware.sln index f62cfabeb6..f29cf549fd 100644 --- a/src/Middleware/Middleware.sln +++ b/src/Middleware/Middleware.sln @@ -255,8 +255,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.NodeSe EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SpaServices", "SpaServices", "{D6FA4ABE-E685-4EDD-8B06-D8777E76B472}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Webpack", "SpaServices\samples\Webpack\Webpack.csproj", "{121DFA13-E965-4C91-A175-19EF20DFD5AC}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices", "SpaServices\src\Microsoft.AspNetCore.SpaServices.csproj", "{D9D02772-1D53-45C3-B2CC-888F9978958C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices.Extensions", "SpaServices.Extensions\src\Microsoft.AspNetCore.SpaServices.Extensions.csproj", "{5D5B7E54-9323-498A-8983-E9BDFA3B2D07}" @@ -297,6 +295,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestOrigin", "CORS\test\tes EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore", "..\DefaultBuilder\src\Microsoft.AspNetCore.csproj", "{46B4FE62-06A1-4D54-B3E8-D8B4B3560075}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Server.IntegrationTesting.IIS", "..\Servers\IIS\IntegrationTesting.IIS\src\Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj", "{92E11EBB-759E-4DA8-AB61-A9977D9F97D0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices.Extensions.Tests", "SpaServices.Extensions\test\Microsoft.AspNetCore.SpaServices.Extensions.Tests.csproj", "{D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1423,18 +1425,6 @@ Global {40951683-DBC4-437A-BBAB-2FA7147E11EA}.Release|x64.Build.0 = Release|Any CPU {40951683-DBC4-437A-BBAB-2FA7147E11EA}.Release|x86.ActiveCfg = Release|Any CPU {40951683-DBC4-437A-BBAB-2FA7147E11EA}.Release|x86.Build.0 = Release|Any CPU - {121DFA13-E965-4C91-A175-19EF20DFD5AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {121DFA13-E965-4C91-A175-19EF20DFD5AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {121DFA13-E965-4C91-A175-19EF20DFD5AC}.Debug|x64.ActiveCfg = Debug|Any CPU - {121DFA13-E965-4C91-A175-19EF20DFD5AC}.Debug|x64.Build.0 = Debug|Any CPU - {121DFA13-E965-4C91-A175-19EF20DFD5AC}.Debug|x86.ActiveCfg = Debug|Any CPU - {121DFA13-E965-4C91-A175-19EF20DFD5AC}.Debug|x86.Build.0 = Debug|Any CPU - {121DFA13-E965-4C91-A175-19EF20DFD5AC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {121DFA13-E965-4C91-A175-19EF20DFD5AC}.Release|Any CPU.Build.0 = Release|Any CPU - {121DFA13-E965-4C91-A175-19EF20DFD5AC}.Release|x64.ActiveCfg = Release|Any CPU - {121DFA13-E965-4C91-A175-19EF20DFD5AC}.Release|x64.Build.0 = Release|Any CPU - {121DFA13-E965-4C91-A175-19EF20DFD5AC}.Release|x86.ActiveCfg = Release|Any CPU - {121DFA13-E965-4C91-A175-19EF20DFD5AC}.Release|x86.Build.0 = Release|Any CPU {D9D02772-1D53-45C3-B2CC-888F9978958C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D9D02772-1D53-45C3-B2CC-888F9978958C}.Debug|Any CPU.Build.0 = Debug|Any CPU {D9D02772-1D53-45C3-B2CC-888F9978958C}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1627,6 +1617,30 @@ Global {46B4FE62-06A1-4D54-B3E8-D8B4B3560075}.Release|x64.Build.0 = Release|Any CPU {46B4FE62-06A1-4D54-B3E8-D8B4B3560075}.Release|x86.ActiveCfg = Release|Any CPU {46B4FE62-06A1-4D54-B3E8-D8B4B3560075}.Release|x86.Build.0 = Release|Any CPU + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0}.Debug|x64.ActiveCfg = Debug|Any CPU + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0}.Debug|x64.Build.0 = Debug|Any CPU + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0}.Debug|x86.ActiveCfg = Debug|Any CPU + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0}.Debug|x86.Build.0 = Debug|Any CPU + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0}.Release|Any CPU.Build.0 = Release|Any CPU + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0}.Release|x64.ActiveCfg = Release|Any CPU + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0}.Release|x64.Build.0 = Release|Any CPU + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0}.Release|x86.ActiveCfg = Release|Any CPU + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0}.Release|x86.Build.0 = Release|Any CPU + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}.Debug|x64.ActiveCfg = Debug|Any CPU + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}.Debug|x64.Build.0 = Debug|Any CPU + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}.Debug|x86.ActiveCfg = Debug|Any CPU + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}.Debug|x86.Build.0 = Debug|Any CPU + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}.Release|Any CPU.Build.0 = Release|Any CPU + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}.Release|x64.ActiveCfg = Release|Any CPU + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}.Release|x64.Build.0 = Release|Any CPU + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}.Release|x86.ActiveCfg = Release|Any CPU + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1736,7 +1750,6 @@ Global {47B6636D-09A3-47AE-9303-9F5D15EEE9D8} = {ACA6DDB9-7592-47CE-A740-D15BF307E9E0} {C801B6A3-906F-406F-BA25-EAE0B4BCE5C9} = {17B409B3-7EC6-49D8-847E-CFAA319E01B5} {40951683-DBC4-437A-BBAB-2FA7147E11EA} = {17B409B3-7EC6-49D8-847E-CFAA319E01B5} - {121DFA13-E965-4C91-A175-19EF20DFD5AC} = {D6FA4ABE-E685-4EDD-8B06-D8777E76B472} {D9D02772-1D53-45C3-B2CC-888F9978958C} = {D6FA4ABE-E685-4EDD-8B06-D8777E76B472} {5D5B7E54-9323-498A-8983-E9BDFA3B2D07} = {D6FA4ABE-E685-4EDD-8B06-D8777E76B472} {B04E9CB6-0D1C-4C21-B626-89B6926A491F} = {17B409B3-7EC6-49D8-847E-CFAA319E01B5} @@ -1755,6 +1768,8 @@ Global {DFEB537A-2D35-4C62-8A13-42798DF66A80} = {BD7B3AD8-0BA6-405F-8CF6-24B9464D4B5B} {E0521105-3A7B-480B-B962-0BFC2838D919} = {BD7B3AD8-0BA6-405F-8CF6-24B9464D4B5B} {46B4FE62-06A1-4D54-B3E8-D8B4B3560075} = {ACA6DDB9-7592-47CE-A740-D15BF307E9E0} + {92E11EBB-759E-4DA8-AB61-A9977D9F97D0} = {ACA6DDB9-7592-47CE-A740-D15BF307E9E0} + {D0CB733B-4CE8-4F6C-BBB9-548EA1A96966} = {D6FA4ABE-E685-4EDD-8B06-D8777E76B472} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {83786312-A93B-4BB4-AB06-7C6913A59AFA} diff --git a/src/Middleware/NodeServices/ref/Microsoft.AspNetCore.NodeServices.netcoreapp3.0.cs b/src/Middleware/NodeServices/ref/Microsoft.AspNetCore.NodeServices.netcoreapp3.0.cs index 659d4eb1f2..c57f1991df 100644 --- a/src/Middleware/NodeServices/ref/Microsoft.AspNetCore.NodeServices.netcoreapp3.0.cs +++ b/src/Middleware/NodeServices/ref/Microsoft.AspNetCore.NodeServices.netcoreapp3.0.cs @@ -3,10 +3,13 @@ namespace Microsoft.AspNetCore.NodeServices { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static partial class EmbeddedResourceReader { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static string Read(System.Type assemblyContainingType, string path) { throw null; } } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public partial interface INodeServices : System.IDisposable { System.Threading.Tasks.Task InvokeAsync(string moduleName, params object[] args); @@ -14,10 +17,13 @@ namespace Microsoft.AspNetCore.NodeServices System.Threading.Tasks.Task InvokeExportAsync(string moduleName, string exportedFunctionName, params object[] args); System.Threading.Tasks.Task InvokeExportAsync(System.Threading.CancellationToken cancellationToken, string moduleName, string exportedFunctionName, params object[] args); } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static partial class NodeServicesFactory { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static Microsoft.AspNetCore.NodeServices.INodeServices CreateNodeServices(Microsoft.AspNetCore.NodeServices.NodeServicesOptions options) { throw null; } } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public partial class NodeServicesOptions { public NodeServicesOptions(System.IServiceProvider serviceProvider) { } @@ -31,6 +37,7 @@ namespace Microsoft.AspNetCore.NodeServices public string ProjectPath { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } public string[] WatchFileExtensions { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public sealed partial class StringAsTempFile : System.IDisposable { public StringAsTempFile(string content, System.Threading.CancellationToken applicationStoppingToken) { } @@ -41,10 +48,12 @@ namespace Microsoft.AspNetCore.NodeServices } namespace Microsoft.AspNetCore.NodeServices.HostingModels { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public partial interface INodeInstance : System.IDisposable { System.Threading.Tasks.Task InvokeExportAsync(System.Threading.CancellationToken cancellationToken, string moduleName, string exportNameOrNull, params object[] args); } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public partial class NodeInvocationException : System.Exception { public NodeInvocationException(string message, string details) { } @@ -52,6 +61,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels public bool AllowConnectionDraining { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public bool NodeInstanceUnavailable { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public partial class NodeInvocationInfo { public NodeInvocationInfo() { } @@ -59,10 +69,13 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels public string ExportedFunctionName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } public string ModuleName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static partial class NodeServicesOptionsExtensions { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static void UseHttpHosting(this Microsoft.AspNetCore.NodeServices.NodeServicesOptions options) { } } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public abstract partial class OutOfProcessNodeInstance : Microsoft.AspNetCore.NodeServices.HostingModels.INodeInstance, System.IDisposable { protected readonly Microsoft.Extensions.Logging.ILogger OutputLogger; @@ -80,9 +93,12 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels } namespace Microsoft.Extensions.DependencyInjection { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static partial class NodeServicesServiceCollectionExtensions { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static void AddNodeServices(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection) { } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static void AddNodeServices(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, System.Action setupAction) { } } } diff --git a/src/Middleware/NodeServices/samples/NodeServicesExamples/Controllers/HomeController.cs b/src/Middleware/NodeServices/samples/NodeServicesExamples/Controllers/HomeController.cs index d9f32410eb..b6cf86a9bd 100644 --- a/src/Middleware/NodeServices/samples/NodeServicesExamples/Controllers/HomeController.cs +++ b/src/Middleware/NodeServices/samples/NodeServicesExamples/Controllers/HomeController.cs @@ -1,7 +1,9 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.NodeServices; -using Microsoft.AspNetCore.SpaServices.Prerendering; namespace NodeServicesExamples.Controllers { @@ -17,7 +19,9 @@ namespace NodeServicesExamples.Controllers return View(); } +#pragma warning disable 0618 public async Task Chart([FromServices] INodeServices nodeServices) +#pragma warning restore 0618 { var options = new { width = 400, height = 200, showArea = true, showPoint = true, fullWidth = true }; var data = new @@ -35,20 +39,6 @@ namespace NodeServicesExamples.Controllers return View(); } - public async Task Prerendering([FromServices] ISpaPrerenderer prerenderer) - { - var result = await prerenderer.RenderToString("./Node/prerenderPage"); - - if (!string.IsNullOrEmpty(result.RedirectUrl)) - { - return Redirect(result.RedirectUrl); - } - - ViewData["PrerenderedHtml"] = result.Html; - ViewData["PrerenderedGlobals"] = result.CreateGlobalsAssignmentScript(); - return View(); - } - public IActionResult Error() { return View("~/Views/Shared/Error.cshtml"); diff --git a/src/Middleware/NodeServices/samples/NodeServicesExamples/NodeServicesExamples.csproj b/src/Middleware/NodeServices/samples/NodeServicesExamples/NodeServicesExamples.csproj index d5bea12a23..13ae55cac3 100644 --- a/src/Middleware/NodeServices/samples/NodeServicesExamples/NodeServicesExamples.csproj +++ b/src/Middleware/NodeServices/samples/NodeServicesExamples/NodeServicesExamples.csproj @@ -7,14 +7,15 @@ - - + + + diff --git a/src/Middleware/NodeServices/samples/NodeServicesExamples/Startup.cs b/src/Middleware/NodeServices/samples/NodeServicesExamples/Startup.cs index 585d6f30ef..60cb8044e1 100644 --- a/src/Middleware/NodeServices/samples/NodeServicesExamples/Startup.cs +++ b/src/Middleware/NodeServices/samples/NodeServicesExamples/Startup.cs @@ -1,15 +1,20 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.IO; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.NodeServices; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using System.IO; namespace NodeServicesExamples { public class Startup { +#pragma warning disable 0618 // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { @@ -17,7 +22,6 @@ namespace NodeServicesExamples // Enable Node Services services.AddNodeServices(); - services.AddSpaPrerenderer(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -26,11 +30,14 @@ namespace NodeServicesExamples app.UseDeveloperExceptionPage(); // Dynamically transpile any .js files under the '/js/' directory - app.Use(next => async context => { + app.Use(next => async context => + { var requestPath = context.Request.Path.Value; - if (requestPath.StartsWith("/js/") && requestPath.EndsWith(".js")) { + if (requestPath.StartsWith("/js/") && requestPath.EndsWith(".js")) + { var fileInfo = env.WebRootFileProvider.GetFileInfo(requestPath); - if (fileInfo.Exists) { + if (fileInfo.Exists) + { var transpiled = await nodeServices.InvokeAsync("./Node/transpilation.js", fileInfo.PhysicalPath, requestPath); await context.Response.WriteAsync(transpiled); return; @@ -49,6 +56,7 @@ namespace NodeServicesExamples endpoints.MapDefaultControllerRoute(); }); } +#pragma warning restore 0618 public static void Main(string[] args) { diff --git a/src/Middleware/NodeServices/src/Configuration/NodeServicesFactory.cs b/src/Middleware/NodeServices/src/Configuration/NodeServicesFactory.cs index 8432158cb9..06968643bd 100644 --- a/src/Middleware/NodeServices/src/Configuration/NodeServicesFactory.cs +++ b/src/Middleware/NodeServices/src/Configuration/NodeServicesFactory.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; namespace Microsoft.AspNetCore.NodeServices @@ -5,6 +8,7 @@ namespace Microsoft.AspNetCore.NodeServices /// /// Supplies INodeServices instances. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static class NodeServicesFactory { /// @@ -12,6 +16,7 @@ namespace Microsoft.AspNetCore.NodeServices /// /// Options for creating the instance. /// An instance. + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static INodeServices CreateNodeServices(NodeServicesOptions options) { if (options == null) @@ -22,4 +27,4 @@ namespace Microsoft.AspNetCore.NodeServices return new NodeServicesImpl(options.NodeInstanceFactory); } } -} \ No newline at end of file +} diff --git a/src/Middleware/NodeServices/src/Configuration/NodeServicesOptions.cs b/src/Middleware/NodeServices/src/Configuration/NodeServicesOptions.cs index 4d8d2e6a2b..a7aac6eba4 100644 --- a/src/Middleware/NodeServices/src/Configuration/NodeServicesOptions.cs +++ b/src/Middleware/NodeServices/src/Configuration/NodeServicesOptions.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.Collections.Generic; using System.IO; @@ -14,6 +17,7 @@ namespace Microsoft.AspNetCore.NodeServices /// /// Describes options used to configure an instance. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public class NodeServicesOptions { internal const string TimeoutConfigPropertyName = nameof(InvocationTimeoutMilliseconds); diff --git a/src/Middleware/NodeServices/src/Configuration/NodeServicesServiceCollectionExtensions.cs b/src/Middleware/NodeServices/src/Configuration/NodeServicesServiceCollectionExtensions.cs index f74ae0889c..1d793671b8 100644 --- a/src/Middleware/NodeServices/src/Configuration/NodeServicesServiceCollectionExtensions.cs +++ b/src/Middleware/NodeServices/src/Configuration/NodeServicesServiceCollectionExtensions.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using Microsoft.AspNetCore.NodeServices; @@ -6,12 +9,14 @@ namespace Microsoft.Extensions.DependencyInjection /// /// Extension methods for setting up NodeServices in an . /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static class NodeServicesServiceCollectionExtensions { /// /// Adds NodeServices support to the . /// /// The . + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static void AddNodeServices(this IServiceCollection serviceCollection) => AddNodeServices(serviceCollection, _ => {}); @@ -20,6 +25,7 @@ namespace Microsoft.Extensions.DependencyInjection /// /// The . /// A callback that will be invoked to populate the . + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static void AddNodeServices(this IServiceCollection serviceCollection, Action setupAction) { if (setupAction == null) diff --git a/src/Middleware/NodeServices/src/HostingModels/HttpNodeInstance.cs b/src/Middleware/NodeServices/src/HostingModels/HttpNodeInstance.cs index 1466db3eaf..9d7f5726b2 100644 --- a/src/Middleware/NodeServices/src/HostingModels/HttpNodeInstance.cs +++ b/src/Middleware/NodeServices/src/HostingModels/HttpNodeInstance.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.IO; using System.Net.Http; @@ -19,6 +22,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels /// accept RPC invocations. /// /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] internal class HttpNodeInstance : OutOfProcessNodeInstance { private static readonly Regex EndpointMessageRegex = diff --git a/src/Middleware/NodeServices/src/HostingModels/INodeInstance.cs b/src/Middleware/NodeServices/src/HostingModels/INodeInstance.cs index a1ce02146a..00bc1277ba 100644 --- a/src/Middleware/NodeServices/src/HostingModels/INodeInstance.cs +++ b/src/Middleware/NodeServices/src/HostingModels/INodeInstance.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.Threading; using System.Threading.Tasks; @@ -7,6 +10,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels /// /// Represents an instance of Node.js to which Remote Procedure Calls (RPC) may be sent. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public interface INodeInstance : IDisposable { /// @@ -20,4 +24,4 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels /// A representing the completion of the RPC call. Task InvokeExportAsync(CancellationToken cancellationToken, string moduleName, string exportNameOrNull, params object[] args); } -} \ No newline at end of file +} diff --git a/src/Middleware/NodeServices/src/HostingModels/NodeInvocationException.cs b/src/Middleware/NodeServices/src/HostingModels/NodeInvocationException.cs index dea3c2cc7e..6e4b97b4be 100644 --- a/src/Middleware/NodeServices/src/HostingModels/NodeInvocationException.cs +++ b/src/Middleware/NodeServices/src/HostingModels/NodeInvocationException.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; namespace Microsoft.AspNetCore.NodeServices.HostingModels @@ -5,6 +8,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels /// /// Represents an exception caused by invoking Node.js code. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public class NodeInvocationException : Exception { /// @@ -52,4 +56,4 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels AllowConnectionDraining = allowConnectionDraining; } } -} \ No newline at end of file +} diff --git a/src/Middleware/NodeServices/src/HostingModels/NodeInvocationInfo.cs b/src/Middleware/NodeServices/src/HostingModels/NodeInvocationInfo.cs index 86c427327b..7d32eacb26 100644 --- a/src/Middleware/NodeServices/src/HostingModels/NodeInvocationInfo.cs +++ b/src/Middleware/NodeServices/src/HostingModels/NodeInvocationInfo.cs @@ -1,8 +1,14 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; + namespace Microsoft.AspNetCore.NodeServices.HostingModels { /// /// Describes an RPC call sent from .NET code to Node.js code. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public class NodeInvocationInfo { /// diff --git a/src/Middleware/NodeServices/src/HostingModels/NodeServicesOptionsExtensions.cs b/src/Middleware/NodeServices/src/HostingModels/NodeServicesOptionsExtensions.cs index 2cbe0a0f1c..674f0ee6dc 100644 --- a/src/Middleware/NodeServices/src/HostingModels/NodeServicesOptionsExtensions.cs +++ b/src/Middleware/NodeServices/src/HostingModels/NodeServicesOptionsExtensions.cs @@ -1,17 +1,24 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; + namespace Microsoft.AspNetCore.NodeServices.HostingModels { /// /// Extension methods that help with populating a object. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static class NodeServicesOptionsExtensions { /// /// Configures the service so that it will use out-of-process /// Node.js instances and perform RPC calls over HTTP. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static void UseHttpHosting(this NodeServicesOptions options) { options.NodeInstanceFactory = () => new HttpNodeInstance(options); } } -} \ No newline at end of file +} diff --git a/src/Middleware/NodeServices/src/HostingModels/OutOfProcessNodeInstance.cs b/src/Middleware/NodeServices/src/HostingModels/OutOfProcessNodeInstance.cs index b75827c452..cf68baa338 100644 --- a/src/Middleware/NodeServices/src/HostingModels/OutOfProcessNodeInstance.cs +++ b/src/Middleware/NodeServices/src/HostingModels/OutOfProcessNodeInstance.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.Collections.Generic; using System.Diagnostics; @@ -19,6 +22,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels /// protocol, or any other RPC-type mechanism). /// /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public abstract class OutOfProcessNodeInstance : INodeInstance { /// @@ -472,4 +476,4 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels Dispose(false); } } -} \ No newline at end of file +} diff --git a/src/Middleware/NodeServices/src/INodeServices.cs b/src/Middleware/NodeServices/src/INodeServices.cs index 2a1ce1aa77..a88ece3c5c 100644 --- a/src/Middleware/NodeServices/src/INodeServices.cs +++ b/src/Middleware/NodeServices/src/INodeServices.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.Threading; using System.Threading.Tasks; @@ -9,6 +12,7 @@ namespace Microsoft.AspNetCore.NodeServices /// might change over time (e.g., the process might be restarted), the instance /// will remain constant. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public interface INodeServices : IDisposable { /// @@ -51,4 +55,4 @@ namespace Microsoft.AspNetCore.NodeServices /// A representing the completion of the RPC call. Task InvokeExportAsync(CancellationToken cancellationToken, string moduleName, string exportedFunctionName, params object[] args); } -} \ No newline at end of file +} diff --git a/src/Middleware/NodeServices/src/NodeServicesImpl.cs b/src/Middleware/NodeServices/src/NodeServicesImpl.cs index d1cf92404f..621a9af7cc 100644 --- a/src/Middleware/NodeServices/src/NodeServicesImpl.cs +++ b/src/Middleware/NodeServices/src/NodeServicesImpl.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.Threading; using System.Threading.Tasks; @@ -17,6 +20,7 @@ namespace Microsoft.AspNetCore.NodeServices /// analogous to the "connection draining" feature implemented by HTTP load balancers. /// /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] internal class NodeServicesImpl : INodeServices { private static TimeSpan ConnectionDrainingTimespan = TimeSpan.FromSeconds(15); @@ -162,4 +166,4 @@ namespace Microsoft.AspNetCore.NodeServices return _nodeInstanceFactory(); } } -} \ No newline at end of file +} diff --git a/src/Middleware/NodeServices/src/Util/EmbeddedResourceReader.cs b/src/Middleware/NodeServices/src/Util/EmbeddedResourceReader.cs index 053182669b..0c4c777e74 100644 --- a/src/Middleware/NodeServices/src/Util/EmbeddedResourceReader.cs +++ b/src/Middleware/NodeServices/src/Util/EmbeddedResourceReader.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.IO; using System.Reflection; @@ -7,6 +10,7 @@ namespace Microsoft.AspNetCore.NodeServices /// /// Contains methods for reading embedded resources. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static class EmbeddedResourceReader { /// @@ -15,6 +19,7 @@ namespace Microsoft.AspNetCore.NodeServices /// Any in the assembly whose resource is to be read. /// The path of the resource to be read. /// The contents of the resource. + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static string Read(Type assemblyContainingType, string path) { var asm = assemblyContainingType.GetTypeInfo().Assembly; @@ -27,4 +32,4 @@ namespace Microsoft.AspNetCore.NodeServices } } } -} \ No newline at end of file +} diff --git a/src/Middleware/NodeServices/src/Util/StringAsTempFile.cs b/src/Middleware/NodeServices/src/Util/StringAsTempFile.cs index c4aea7ff2d..ed9ee76172 100644 --- a/src/Middleware/NodeServices/src/Util/StringAsTempFile.cs +++ b/src/Middleware/NodeServices/src/Util/StringAsTempFile.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.IO; using System.Threading; @@ -7,6 +10,7 @@ namespace Microsoft.AspNetCore.NodeServices /// /// Makes it easier to pass script files to Node in a way that's sure to clean up after the process exits. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public sealed class StringAsTempFile : IDisposable { private bool _disposedValue; @@ -79,4 +83,4 @@ namespace Microsoft.AspNetCore.NodeServices DisposeImpl(false); } } -} \ No newline at end of file +} diff --git a/src/Middleware/NodeServices/src/Util/TaskExtensions.cs b/src/Middleware/NodeServices/src/Util/TaskExtensions.cs index 75cfdb1604..8743b9e4b5 100644 --- a/src/Middleware/NodeServices/src/Util/TaskExtensions.cs +++ b/src/Middleware/NodeServices/src/Util/TaskExtensions.cs @@ -1,10 +1,16 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; using System.Threading; using System.Threading.Tasks; namespace Microsoft.AspNetCore.NodeServices { + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] internal static class TaskExtensions { + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static Task OrThrowOnCancellation(this Task task, CancellationToken cancellationToken) { return task.IsCompleted @@ -16,6 +22,7 @@ namespace Microsoft.AspNetCore.NodeServices TaskScheduler.Default); } + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static Task OrThrowOnCancellation(this Task task, CancellationToken cancellationToken) { return task.IsCompleted @@ -27,4 +34,4 @@ namespace Microsoft.AspNetCore.NodeServices TaskScheduler.Default); } } -} \ No newline at end of file +} diff --git a/src/Middleware/NodeServices/test/NodeServicesTest.cs b/src/Middleware/NodeServices/test/NodeServicesTest.cs index f851e08d0c..2bae8f11b6 100644 --- a/src/Middleware/NodeServices/test/NodeServicesTest.cs +++ b/src/Middleware/NodeServices/test/NodeServicesTest.cs @@ -1,15 +1,16 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNetCore.NodeServices.HostingModels; -using Microsoft.Extensions.DependencyInjection; using System; using System.IO; using System.Threading.Tasks; +using Microsoft.AspNetCore.NodeServices.HostingModels; +using Microsoft.Extensions.DependencyInjection; using Xunit; namespace Microsoft.AspNetCore.NodeServices { + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public class NodeServicesTest : IDisposable { private readonly INodeServices _nodeServices; diff --git a/src/Middleware/SpaServices.Extensions/ref/Microsoft.AspNetCore.SpaServices.Extensions.netcoreapp3.0.cs b/src/Middleware/SpaServices.Extensions/ref/Microsoft.AspNetCore.SpaServices.Extensions.netcoreapp3.0.cs index be28dc70e2..97f23b740d 100644 --- a/src/Middleware/SpaServices.Extensions/ref/Microsoft.AspNetCore.SpaServices.Extensions.netcoreapp3.0.cs +++ b/src/Middleware/SpaServices.Extensions/ref/Microsoft.AspNetCore.SpaServices.Extensions.netcoreapp3.0.cs @@ -7,10 +7,13 @@ namespace Microsoft.AspNetCore.Builder { public static void UseSpa(this Microsoft.AspNetCore.Builder.IApplicationBuilder app, System.Action configuration) { } } + [System.ObsoleteAttribute("Prerendering is no longer supported out of box")] public static partial class SpaPrerenderingExtensions { + [System.ObsoleteAttribute("Prerendering is no longer supported out of box")] public static void UseSpaPrerendering(this Microsoft.AspNetCore.SpaServices.ISpaBuilder spaBuilder, System.Action configuration) { } } + [System.ObsoleteAttribute("Prerendering is no longer supported out of box")] public partial class SpaPrerenderingOptions { public SpaPrerenderingOptions() { } @@ -44,6 +47,7 @@ namespace Microsoft.AspNetCore.SpaServices } namespace Microsoft.AspNetCore.SpaServices.AngularCli { + [System.ObsoleteAttribute("Prerendering is no longer supported out of box")] public partial class AngularCliBuilder : Microsoft.AspNetCore.SpaServices.Prerendering.ISpaPrerendererBuilder { public AngularCliBuilder(string npmScript) { } @@ -57,6 +61,7 @@ namespace Microsoft.AspNetCore.SpaServices.AngularCli } namespace Microsoft.AspNetCore.SpaServices.Prerendering { + [System.ObsoleteAttribute("Prerendering is no longer supported out of box")] public partial interface ISpaPrerendererBuilder { System.Threading.Tasks.Task Build(Microsoft.AspNetCore.SpaServices.ISpaBuilder spaBuilder); diff --git a/src/Middleware/SpaServices.Extensions/src/AngularCli/AngularCliBuilder.cs b/src/Middleware/SpaServices.Extensions/src/AngularCli/AngularCliBuilder.cs index 61dedd350a..fa3e9cc449 100644 --- a/src/Middleware/SpaServices.Extensions/src/AngularCli/AngularCliBuilder.cs +++ b/src/Middleware/SpaServices.Extensions/src/AngularCli/AngularCliBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Builder; @@ -17,6 +17,7 @@ namespace Microsoft.AspNetCore.SpaServices.AngularCli /// Provides an implementation of that can build /// an Angular application by invoking the Angular CLI. /// + [Obsolete("Prerendering is no longer supported out of box")] public class AngularCliBuilder : ISpaPrerendererBuilder { private static TimeSpan RegexMatchTimeout = TimeSpan.FromSeconds(5); // This is a development-time only feature, so a very long timeout is fine diff --git a/src/Middleware/SpaServices.Extensions/src/Microsoft.AspNetCore.SpaServices.Extensions.csproj b/src/Middleware/SpaServices.Extensions/src/Microsoft.AspNetCore.SpaServices.Extensions.csproj index 02741c62dc..38e9a0e72c 100644 --- a/src/Middleware/SpaServices.Extensions/src/Microsoft.AspNetCore.SpaServices.Extensions.csproj +++ b/src/Middleware/SpaServices.Extensions/src/Microsoft.AspNetCore.SpaServices.Extensions.csproj @@ -1,4 +1,4 @@ - + Helpers for building single-page applications on ASP.NET MVC Core. @@ -13,4 +13,8 @@ + + + + diff --git a/src/Middleware/SpaServices.Extensions/src/Prerendering/ISpaPrerendererBuilder.cs b/src/Middleware/SpaServices.Extensions/src/Prerendering/ISpaPrerendererBuilder.cs index 9c3171de87..4f98a0461a 100644 --- a/src/Middleware/SpaServices.Extensions/src/Prerendering/ISpaPrerendererBuilder.cs +++ b/src/Middleware/SpaServices.Extensions/src/Prerendering/ISpaPrerendererBuilder.cs @@ -1,7 +1,7 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNetCore.Builder; +using System; using System.Threading.Tasks; namespace Microsoft.AspNetCore.SpaServices.Prerendering @@ -11,6 +11,7 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering /// so that it can be prerendered. This is only intended to be used at development /// time. In production, a SPA should already have been built during publishing. /// + [Obsolete("Prerendering is no longer supported out of box")] public interface ISpaPrerendererBuilder { /// diff --git a/src/Middleware/SpaServices.Extensions/src/Prerendering/SpaPrerenderingExtensions.cs b/src/Middleware/SpaServices.Extensions/src/Prerendering/SpaPrerenderingExtensions.cs index 3b817494d7..a9438b3f4c 100644 --- a/src/Middleware/SpaServices.Extensions/src/Prerendering/SpaPrerenderingExtensions.cs +++ b/src/Middleware/SpaServices.Extensions/src/Prerendering/SpaPrerenderingExtensions.cs @@ -23,6 +23,7 @@ namespace Microsoft.AspNetCore.Builder /// /// Extension methods for configuring prerendering of a Single Page Application. /// + [Obsolete("Prerendering is no longer supported out of box")] public static class SpaPrerenderingExtensions { /// @@ -30,6 +31,7 @@ namespace Microsoft.AspNetCore.Builder /// /// The . /// Supplies configuration for the prerendering middleware. + [Obsolete("Prerendering is no longer supported out of box")] public static void UseSpaPrerendering( this ISpaBuilder spaBuilder, Action configuration) diff --git a/src/Middleware/SpaServices.Extensions/src/Prerendering/SpaPrerenderingOptions.cs b/src/Middleware/SpaServices.Extensions/src/Prerendering/SpaPrerenderingOptions.cs index bc121bbc9a..907bf066dd 100644 --- a/src/Middleware/SpaServices.Extensions/src/Prerendering/SpaPrerenderingOptions.cs +++ b/src/Middleware/SpaServices.Extensions/src/Prerendering/SpaPrerenderingOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; @@ -11,6 +11,7 @@ namespace Microsoft.AspNetCore.Builder /// /// Represents options for the SPA prerendering middleware. /// + [Obsolete("Prerendering is no longer supported out of box")] public class SpaPrerenderingOptions { /// diff --git a/src/Middleware/SpaServices.Extensions/test/Microsoft.AspNetCore.SpaServices.Extensions.Tests.csproj b/src/Middleware/SpaServices.Extensions/test/Microsoft.AspNetCore.SpaServices.Extensions.Tests.csproj new file mode 100644 index 0000000000..78dc7705ba --- /dev/null +++ b/src/Middleware/SpaServices.Extensions/test/Microsoft.AspNetCore.SpaServices.Extensions.Tests.csproj @@ -0,0 +1,17 @@ + + + + netcoreapp3.0 + true + + + + + + + + + + + + diff --git a/src/Middleware/SpaServices.Extensions/test/SpaServicesExtensionsTests.cs b/src/Middleware/SpaServices.Extensions/test/SpaServicesExtensionsTests.cs new file mode 100644 index 0000000000..8d55dc3f35 --- /dev/null +++ b/src/Middleware/SpaServices.Extensions/test/SpaServicesExtensionsTests.cs @@ -0,0 +1,51 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using Moq; +using Xunit; + +namespace Microsoft.AspNetCore.SpaServices.Extensions.Tests +{ + public class SpaServicesExtensionsTests + { + [Fact] + public void UseSpa_ThrowsInvalidOperationException_IfRootpathNotSet() + { + // Arrange + var applicationbuilder = GetApplicationBuilder(GetServiceProvider()); + + // Act & Assert + var exception = Assert.Throws( + () => applicationbuilder.UseSpa(rb => { })); + + Assert.Equal("No RootPath was set on the SpaStaticFilesOptions.", exception.Message); + } + + private IApplicationBuilder GetApplicationBuilder(IServiceProvider serviceProvider = null) + { + if(serviceProvider == null) + { + serviceProvider = new Mock(MockBehavior.Strict).Object; + } + + var applicationbuilderMock = new Mock(); + applicationbuilderMock + .Setup(s => s.ApplicationServices) + .Returns(serviceProvider); + + return applicationbuilderMock.Object; + } + + private IServiceProvider GetServiceProvider() + { + var services = new ServiceCollection(); + services.AddLogging(); + services.AddSpaStaticFiles(); + + return services.BuildServiceProvider(); + } + } +} diff --git a/src/Middleware/SpaServices/ref/Microsoft.AspNetCore.SpaServices.netcoreapp3.0.cs b/src/Middleware/SpaServices/ref/Microsoft.AspNetCore.SpaServices.netcoreapp3.0.cs index 9548d1f7b7..1b9fa3ae00 100644 --- a/src/Middleware/SpaServices/ref/Microsoft.AspNetCore.SpaServices.netcoreapp3.0.cs +++ b/src/Middleware/SpaServices/ref/Microsoft.AspNetCore.SpaServices.netcoreapp3.0.cs @@ -3,33 +3,41 @@ namespace Microsoft.AspNetCore.Builder { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static partial class SpaRouteExtensions { public static void MapSpaFallbackRoute(this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string name, object defaults, object constraints = null, object dataTokens = null) { } public static void MapSpaFallbackRoute(this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string name, string templatePrefix, object defaults, object constraints = null, object dataTokens = null) { } } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static partial class WebpackDevMiddleware { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static void UseWebpackDevMiddleware(this Microsoft.AspNetCore.Builder.IApplicationBuilder appBuilder, Microsoft.AspNetCore.SpaServices.Webpack.WebpackDevMiddlewareOptions options = null) { } } } namespace Microsoft.AspNetCore.SpaServices.Prerendering { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public partial interface ISpaPrerenderer { System.Threading.Tasks.Task RenderToString(string moduleName, string exportName = null, object customDataParameter = null, int timeoutMilliseconds = 0); } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public partial class JavaScriptModuleExport { public JavaScriptModuleExport(string moduleName) { } public string ExportName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } public string ModuleName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static partial class Prerenderer { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static System.Threading.Tasks.Task RenderToString(string applicationBasePath, Microsoft.AspNetCore.NodeServices.INodeServices nodeServices, System.Threading.CancellationToken applicationStoppingToken, Microsoft.AspNetCore.SpaServices.Prerendering.JavaScriptModuleExport bootModule, string requestAbsoluteUrl, string requestPathAndQuery, object customDataParameter, int timeoutMilliseconds, string requestPathBase) { throw null; } } [Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute(Attributes="asp-prerender-module")] + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public partial class PrerenderTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { public PrerenderTagHelper(System.IServiceProvider serviceProvider) { } @@ -47,6 +55,7 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering [System.Diagnostics.DebuggerStepThroughAttribute] public override System.Threading.Tasks.Task ProcessAsync(Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext context, Microsoft.AspNetCore.Razor.TagHelpers.TagHelperOutput output) { throw null; } } + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public partial class RenderToStringResult { public RenderToStringResult() { } @@ -59,6 +68,7 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering } namespace Microsoft.AspNetCore.SpaServices.Webpack { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public partial class WebpackDevMiddlewareOptions { public WebpackDevMiddlewareOptions() { } @@ -75,8 +85,10 @@ namespace Microsoft.AspNetCore.SpaServices.Webpack } namespace Microsoft.Extensions.DependencyInjection { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static partial class PrerenderingServiceCollectionExtensions { + [System.ObsoleteAttribute("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static void AddSpaPrerenderer(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection) { } } } diff --git a/src/Middleware/SpaServices/samples/Webpack/.gitignore b/src/Middleware/SpaServices/samples/Webpack/.gitignore deleted file mode 100644 index 1363491964..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/.gitignore +++ /dev/null @@ -1,233 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -yarn.lock -wwwroot/dist - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Microsoft Azure ApplicationInsights config file -ApplicationInsights.config - -# Windows Store app package directory -AppPackages/ -BundleArtifacts/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe - -# FAKE - F# Make -.fake/ diff --git a/src/Middleware/SpaServices/samples/Webpack/ActionResults/PrerenderResult.cs b/src/Middleware/SpaServices/samples/Webpack/ActionResults/PrerenderResult.cs deleted file mode 100644 index b44d761b01..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/ActionResults/PrerenderResult.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.NodeServices; -using Microsoft.AspNetCore.SpaServices.Prerendering; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace Webpack.ActionResults -{ - // This is an example of how you could invoke the prerendering API from an ActionResult, so as to - // prerender a SPA component as the entire response page (instead of injecting the SPA component - // into a Razor view's output) - public class PrerenderResult : ActionResult - { - private JavaScriptModuleExport _moduleExport; - private object _dataToSupply; - - public PrerenderResult(JavaScriptModuleExport moduleExport, object dataToSupply = null) - { - _moduleExport = moduleExport; - _dataToSupply = dataToSupply; - } - - public override async Task ExecuteResultAsync(ActionContext context) - { - var nodeServices = context.HttpContext.RequestServices.GetRequiredService(); - var hostEnv = context.HttpContext.RequestServices.GetRequiredService(); - var applicationLifetime = context.HttpContext.RequestServices.GetRequiredService(); - var applicationBasePath = hostEnv.ContentRootPath; - var request = context.HttpContext.Request; - var response = context.HttpContext.Response; - - var prerenderedHtml = await Prerenderer.RenderToString( - applicationBasePath, - nodeServices, - applicationLifetime.ApplicationStopping, - _moduleExport, - request.GetEncodedUrl(), - request.Path + request.QueryString.Value, - _dataToSupply, - /* timeoutMilliseconds */ 30000, - /* requestPathBase */ "/" - ); - - response.ContentType = "text/html"; - await response.WriteAsync(prerenderedHtml.Html); - } - } -} diff --git a/src/Middleware/SpaServices/samples/Webpack/ActionResults/PrerenderResultExtensions.cs b/src/Middleware/SpaServices/samples/Webpack/ActionResults/PrerenderResultExtensions.cs deleted file mode 100644 index 926e114999..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/ActionResults/PrerenderResultExtensions.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.SpaServices.Prerendering; - -namespace Webpack.ActionResults -{ - public static class PrerenderResultExtensions - { - public static PrerenderResult Prerender(this ControllerBase controller, JavaScriptModuleExport exportToPrerender, object dataToSupply = null) - { - return new PrerenderResult(exportToPrerender, dataToSupply); - } - } -} diff --git a/src/Middleware/SpaServices/samples/Webpack/Clientside/App.ts b/src/Middleware/SpaServices/samples/Webpack/Clientside/App.ts deleted file mode 100644 index 07a4e7733f..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/Clientside/App.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { HelloWorld } from './HelloWorld'; -import './styles/main.less'; - -new HelloWorld().doIt(); diff --git a/src/Middleware/SpaServices/samples/Webpack/Clientside/HelloWorld.ts b/src/Middleware/SpaServices/samples/Webpack/Clientside/HelloWorld.ts deleted file mode 100644 index 512dcf94c4..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/Clientside/HelloWorld.ts +++ /dev/null @@ -1,5 +0,0 @@ -export class HelloWorld { - public doIt() { - console.log('Hello from MyApp'); - } -} diff --git a/src/Middleware/SpaServices/samples/Webpack/Clientside/styles/main.less b/src/Middleware/SpaServices/samples/Webpack/Clientside/styles/main.less deleted file mode 100644 index ea61843fc2..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/Clientside/styles/main.less +++ /dev/null @@ -1,5 +0,0 @@ -@headerColor: red; - -h1 { - color: @headerColor; -} diff --git a/src/Middleware/SpaServices/samples/Webpack/Controllers/HomeController.cs b/src/Middleware/SpaServices/samples/Webpack/Controllers/HomeController.cs deleted file mode 100644 index 136e94e0a3..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/Controllers/HomeController.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace Webpack.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - } -} diff --git a/src/Middleware/SpaServices/samples/Webpack/Startup.cs b/src/Middleware/SpaServices/samples/Webpack/Startup.cs deleted file mode 100644 index 3aed2d5db4..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/Startup.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.SpaServices.Webpack; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using System.IO; -using Microsoft.AspNetCore.NodeServices; - -namespace Webpack -{ - public class Startup - { - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc(); - services.AddNodeServices(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app) - { - app.UseDeveloperExceptionPage(); - - // For real apps, you should only use Webpack Dev Middleware at development time. For production, - // you'll get better performance and reliability if you precompile the webpack output and simply - // serve the resulting static files. For examples of setting up this automatic switch between - // development-style and production-style webpack usage, see the 'templates' dir in this repo. - app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { - HotModuleReplacement = true - }); - - app.UseStaticFiles(); - app.UseRouting(); - app.UseEndpoints(endpoints => - { - endpoints.MapDefaultControllerRoute(); - }); - } - - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .ConfigureLogging(factory => - { - factory.AddConsole(); - factory.AddDebug(); - }) - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseKestrel() - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/Middleware/SpaServices/samples/Webpack/Views/Home/Index.cshtml b/src/Middleware/SpaServices/samples/Webpack/Views/Home/Index.cshtml deleted file mode 100644 index 7828ec195f..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/Views/Home/Index.cshtml +++ /dev/null @@ -1,10 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - -

Hello

-Hi there. Enter some text: - -@section scripts { - -} diff --git a/src/Middleware/SpaServices/samples/Webpack/Views/Shared/Error.cshtml b/src/Middleware/SpaServices/samples/Webpack/Views/Shared/Error.cshtml deleted file mode 100644 index 473b35d6ca..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/Views/Shared/Error.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Error"; -} - -

Error.

-

An error occurred while processing your request.

diff --git a/src/Middleware/SpaServices/samples/Webpack/Views/Shared/_Layout.cshtml b/src/Middleware/SpaServices/samples/Webpack/Views/Shared/_Layout.cshtml deleted file mode 100644 index 929671831e..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - @ViewData["Title"] - - - - - - @RenderBody() - @RenderSection("scripts", required: false) - - diff --git a/src/Middleware/SpaServices/samples/Webpack/Views/_ViewImports.cshtml b/src/Middleware/SpaServices/samples/Webpack/Views/_ViewImports.cshtml deleted file mode 100644 index de3b5a18ab..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/Views/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@using Webpack -@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" diff --git a/src/Middleware/SpaServices/samples/Webpack/Views/_ViewStart.cshtml b/src/Middleware/SpaServices/samples/Webpack/Views/_ViewStart.cshtml deleted file mode 100644 index 820a2f6e02..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/src/Middleware/SpaServices/samples/Webpack/Webpack.csproj b/src/Middleware/SpaServices/samples/Webpack/Webpack.csproj deleted file mode 100644 index 494b84a780..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/Webpack.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - netcoreapp3.0 - true - false - - - - - - - - - - - - - - - - - - - diff --git a/src/Middleware/SpaServices/samples/Webpack/appsettings.json b/src/Middleware/SpaServices/samples/Webpack/appsettings.json deleted file mode 100644 index e5472e562b..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Verbose", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/src/Middleware/SpaServices/samples/Webpack/package.json b/src/Middleware/SpaServices/samples/Webpack/package.json deleted file mode 100644 index 3216132bb9..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "Webpack", - "version": "0.0.0", - "devDependencies": { - "css-loader": "^0.23.1", - "extendify": "^1.0.0", - "extract-text-webpack-plugin": "^1.0.1", - "less": "^2.6.0", - "less-loader": "^2.2.2", - "style-loader": "^0.13.0", - "webpack-hot-middleware": "^2.7.1" - }, - "dependencies": { - "aspnet-prerendering": "^1.0.4", - "aspnet-webpack": "^1.0.3", - "ts-loader": "^0.8.1", - "typescript": "^2.0.0", - "webpack": "^1.13.3" - } -} diff --git a/src/Middleware/SpaServices/samples/Webpack/tsconfig.json b/src/Middleware/SpaServices/samples/Webpack/tsconfig.json deleted file mode 100644 index 453b7a3308..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "node", - "module": "commonjs", - "target": "es5", - "jsx": "preserve", - "sourceMap": true, - "lib": ["es6", "dom"] - }, - "exclude": [ - "node_modules" - ] -} diff --git a/src/Middleware/SpaServices/samples/Webpack/webpack.config.dev.js b/src/Middleware/SpaServices/samples/Webpack/webpack.config.dev.js deleted file mode 100644 index fc339d2e6e..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/webpack.config.dev.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - devtool: 'inline-source-map', - module: { - loaders: [ - { test: /\.less$/, loader: 'style-loader!css-loader!less-loader' } - ] - } -}; diff --git a/src/Middleware/SpaServices/samples/Webpack/webpack.config.js b/src/Middleware/SpaServices/samples/Webpack/webpack.config.js deleted file mode 100644 index 011ed5f2e5..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/webpack.config.js +++ /dev/null @@ -1,25 +0,0 @@ -var path = require('path'); -var merge = require('extendify')({ isDeep: true, arrays: 'concat' }); -var devConfig = require('./webpack.config.dev'); -var prodConfig = require('./webpack.config.prod'); -var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; - -module.exports = merge({ - resolve: { - extensions: [ '', '.js', '.jsx', '.ts', '.tsx' ] - }, - module: { - loaders: [ - { test: /\.ts(x?)$/, exclude: /node_modules/, loader: 'ts-loader?silent' } - ], - }, - entry: { - main: ['./Clientside/App.ts'] - }, - output: { - path: path.join(__dirname, 'wwwroot', 'dist'), - filename: '[name].js', - publicPath: '/dist/' - }, - plugins: [] -}, isDevelopment ? devConfig : prodConfig); diff --git a/src/Middleware/SpaServices/samples/Webpack/webpack.config.prod.js b/src/Middleware/SpaServices/samples/Webpack/webpack.config.prod.js deleted file mode 100644 index 56203448a9..0000000000 --- a/src/Middleware/SpaServices/samples/Webpack/webpack.config.prod.js +++ /dev/null @@ -1,15 +0,0 @@ -var webpack = require('webpack'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var extractLESS = new ExtractTextPlugin('my-styles.css'); - -module.exports = { - module: { - loaders: [ - { test: /\.less$/, loader: extractLESS.extract(['css-loader', 'less-loader']) }, - ] - }, - plugins: [ - extractLESS, - new webpack.optimize.UglifyJsPlugin({ minimize: true, compressor: { warnings: false } }) - ] -}; diff --git a/src/Middleware/SpaServices/samples/Webpack/wwwroot/favicon.ico b/src/Middleware/SpaServices/samples/Webpack/wwwroot/favicon.ico deleted file mode 100644 index a3a799985c43bc7309d701b2cad129023377dc71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32038 zcmeHwX>eTEbtY7aYbrGrkNjgie?1jXjZ#zP%3n{}GObKv$BxI7Sl;Bwl5E+Qtj&t8 z*p|m4DO#HoJC-FyvNnp8NP<{Na0LMnTtO21(rBP}?EAiNjWgeO?z`{3ZoURUQlV2d zY1Pqv{m|X_oO91|?^z!6@@~od!@OH>&BN;>c@O+yUfy5w>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8S8G}Z$?AL4`;pE?7J5K8yWqy23>cCT2{=-)+A$X^-I9=e!@J@A&-;Ufc)`H}c(VI&;0x zrrGv()5mjP%jXzS{^|29?bLNXS0bC%p!YXI!;O457rjCEEzMkGf~B3$T}dXBO23tP z+Ci>;5UoM?C@bU@f9G1^X3=ly&ZeFH<@|RnOG--A&)fd)AUgjw?%izq{p(KJ`EP0v z2mU)P!+3t@X14DA=E2RR-|p${GZ9ETX=d+kJRZL$nSa0daI@&oUUxnZg0xd_xu>Vz lzF#z5%kSKX?YLH3ll^(hI(_`L*t#Iva2Ede*Z;>H_ - - - - - - - - diff --git a/src/Middleware/SpaServices/src/Prerendering/DefaultSpaPrerenderer.cs b/src/Middleware/SpaServices/src/Prerendering/DefaultSpaPrerenderer.cs index 022c39fc01..be38e0c0f5 100644 --- a/src/Middleware/SpaServices/src/Prerendering/DefaultSpaPrerenderer.cs +++ b/src/Middleware/SpaServices/src/Prerendering/DefaultSpaPrerenderer.cs @@ -1,3 +1,7 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; using System.Threading; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; @@ -12,6 +16,7 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering /// server-side prerendering APIs. This is an alternative to prerendering via /// the asp-prerender-module tag helper. ///
+ [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] internal class DefaultSpaPrerenderer : ISpaPrerenderer { private readonly string _applicationBasePath; diff --git a/src/Middleware/SpaServices/src/Prerendering/ISpaPrerenderer.cs b/src/Middleware/SpaServices/src/Prerendering/ISpaPrerenderer.cs index 183d4ae632..dcf986673e 100644 --- a/src/Middleware/SpaServices/src/Prerendering/ISpaPrerenderer.cs +++ b/src/Middleware/SpaServices/src/Prerendering/ISpaPrerenderer.cs @@ -1,4 +1,8 @@ -using System.Threading.Tasks; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Threading.Tasks; namespace Microsoft.AspNetCore.SpaServices.Prerendering { @@ -7,6 +11,7 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering /// JavaScript-based Single Page Applications. This is an alternative /// to using the 'asp-prerender-module' tag helper. ///
+ [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public interface ISpaPrerenderer { /// diff --git a/src/Middleware/SpaServices/src/Prerendering/JavaScriptModuleExport.cs b/src/Middleware/SpaServices/src/Prerendering/JavaScriptModuleExport.cs index 97456b653d..13fd2177dd 100644 --- a/src/Middleware/SpaServices/src/Prerendering/JavaScriptModuleExport.cs +++ b/src/Middleware/SpaServices/src/Prerendering/JavaScriptModuleExport.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; namespace Microsoft.AspNetCore.SpaServices.Prerendering @@ -5,6 +8,7 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering /// /// Describes how to find the JavaScript code that performs prerendering. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public class JavaScriptModuleExport { /// @@ -27,4 +31,4 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering /// public string ExportName { get; set; } } -} \ No newline at end of file +} diff --git a/src/Middleware/SpaServices/src/Prerendering/PrerenderTagHelper.cs b/src/Middleware/SpaServices/src/Prerendering/PrerenderTagHelper.cs index 665fbff8ef..3aaed1445a 100644 --- a/src/Middleware/SpaServices/src/Prerendering/PrerenderTagHelper.cs +++ b/src/Middleware/SpaServices/src/Prerendering/PrerenderTagHelper.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.Threading; using System.Threading.Tasks; @@ -14,6 +17,7 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering /// A tag helper for prerendering JavaScript applications on the server. /// [HtmlTargetElement(Attributes = PrerenderModuleAttributeName)] + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public class PrerenderTagHelper : TagHelper { private const string PrerenderModuleAttributeName = "asp-prerender-module"; diff --git a/src/Middleware/SpaServices/src/Prerendering/Prerenderer.cs b/src/Middleware/SpaServices/src/Prerendering/Prerenderer.cs index 4e2fb16a42..26316320c6 100644 --- a/src/Middleware/SpaServices/src/Prerendering/Prerenderer.cs +++ b/src/Middleware/SpaServices/src/Prerendering/Prerenderer.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.Threading; using System.Threading.Tasks; @@ -10,12 +13,14 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering /// /// Performs server-side prerendering by invoking code in Node.js. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static class Prerenderer { private static readonly object CreateNodeScriptLock = new object(); private static StringAsTempFile NodeScript; + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] internal static Task RenderToString( string applicationBasePath, INodeServices nodeServices, @@ -63,6 +68,7 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering /// The maximum duration to wait for prerendering to complete. /// The PathBase for the currently-executing HTTP request. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static Task RenderToString( string applicationBasePath, INodeServices nodeServices, @@ -88,7 +94,7 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering private static string GetNodeScriptFilename(CancellationToken applicationStoppingToken) { - lock(CreateNodeScriptLock) + lock (CreateNodeScriptLock) { if (NodeScript == null) { @@ -100,4 +106,4 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering return NodeScript.FileName; } } -} \ No newline at end of file +} diff --git a/src/Middleware/SpaServices/src/Prerendering/PrerenderingServiceCollectionExtensions.cs b/src/Middleware/SpaServices/src/Prerendering/PrerenderingServiceCollectionExtensions.cs index d6a674396f..cabc57adcf 100644 --- a/src/Middleware/SpaServices/src/Prerendering/PrerenderingServiceCollectionExtensions.cs +++ b/src/Middleware/SpaServices/src/Prerendering/PrerenderingServiceCollectionExtensions.cs @@ -1,10 +1,15 @@ -using Microsoft.AspNetCore.SpaServices.Prerendering; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.SpaServices.Prerendering; namespace Microsoft.Extensions.DependencyInjection { /// /// Extension methods for setting up prerendering features in an . /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static class PrerenderingServiceCollectionExtensions { /// @@ -12,6 +17,7 @@ namespace Microsoft.Extensions.DependencyInjection /// of . /// /// The . + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static void AddSpaPrerenderer(this IServiceCollection serviceCollection) { serviceCollection.AddHttpContextAccessor(); diff --git a/src/Middleware/SpaServices/src/Prerendering/RenderToStringResult.cs b/src/Middleware/SpaServices/src/Prerendering/RenderToStringResult.cs index 1a2e156354..f6f5d77911 100644 --- a/src/Middleware/SpaServices/src/Prerendering/RenderToStringResult.cs +++ b/src/Middleware/SpaServices/src/Prerendering/RenderToStringResult.cs @@ -1,3 +1,7 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Text; @@ -7,6 +11,7 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering /// /// Describes the prerendering result returned by JavaScript code. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public class RenderToStringResult { /// @@ -57,4 +62,4 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering return stringBuilder.ToString(); } } -} \ No newline at end of file +} diff --git a/src/Middleware/SpaServices/src/Routing/SpaRouteConstraint.cs b/src/Middleware/SpaServices/src/Routing/SpaRouteConstraint.cs index d6a1d5b227..6f25a25379 100644 --- a/src/Middleware/SpaServices/src/Routing/SpaRouteConstraint.cs +++ b/src/Middleware/SpaServices/src/Routing/SpaRouteConstraint.cs @@ -1,9 +1,13 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; namespace Microsoft.AspNetCore.SpaServices { + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] internal class SpaRouteConstraint : IRouteConstraint { private readonly string _clientRouteTokenName; @@ -34,4 +38,4 @@ namespace Microsoft.AspNetCore.SpaServices return uri.IndexOf('.', lastSegmentStartPos + 1) >= 0; } } -} \ No newline at end of file +} diff --git a/src/Middleware/SpaServices/src/Routing/SpaRouteExtensions.cs b/src/Middleware/SpaServices/src/Routing/SpaRouteExtensions.cs index 7838aa13b9..547cf7c8ad 100644 --- a/src/Middleware/SpaServices/src/Routing/SpaRouteExtensions.cs +++ b/src/Middleware/SpaServices/src/Routing/SpaRouteExtensions.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.Collections.Generic; using Microsoft.AspNetCore.Routing; @@ -10,6 +13,7 @@ namespace Microsoft.AspNetCore.Builder /// /// Extension methods useful for configuring routing in a single-page application (SPA). /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static class SpaRouteExtensions { private const string ClientRouteTokenName = "clientRoute"; @@ -91,4 +95,4 @@ namespace Microsoft.AspNetCore.Builder private static IDictionary ObjectToDictionary(object value) => value as IDictionary ?? new RouteValueDictionary(value); } -} \ No newline at end of file +} diff --git a/src/Middleware/SpaServices/src/Webpack/ConditionalProxyMiddleware.cs b/src/Middleware/SpaServices/src/Webpack/ConditionalProxyMiddleware.cs index 8cfbd07a18..59623ad879 100644 --- a/src/Middleware/SpaServices/src/Webpack/ConditionalProxyMiddleware.cs +++ b/src/Middleware/SpaServices/src/Webpack/ConditionalProxyMiddleware.cs @@ -1,9 +1,11 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; namespace Microsoft.AspNetCore.SpaServices.Webpack @@ -14,6 +16,7 @@ namespace Microsoft.AspNetCore.SpaServices.Webpack /// This is useful for Webpack middleware, because it lets you fall back on prebuilt files on disk for /// chunks not exposed by the current Webpack config (e.g., DLL/vendor chunks). /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] internal class ConditionalProxyMiddleware { private const int DefaultHttpBufferSize = 4096; @@ -89,7 +92,7 @@ namespace Microsoft.AspNetCore.SpaServices.Webpack } // We can handle this - context.Response.StatusCode = (int) responseMessage.StatusCode; + context.Response.StatusCode = (int)responseMessage.StatusCode; foreach (var header in responseMessage.Headers) { context.Response.Headers[header.Key] = header.Value.ToArray(); @@ -120,4 +123,4 @@ namespace Microsoft.AspNetCore.SpaServices.Webpack } } } -} \ No newline at end of file +} diff --git a/src/Middleware/SpaServices/src/Webpack/ConditionalProxyMiddlewareOptions.cs b/src/Middleware/SpaServices/src/Webpack/ConditionalProxyMiddlewareOptions.cs index 2c3311aabd..7f6f80fd77 100644 --- a/src/Middleware/SpaServices/src/Webpack/ConditionalProxyMiddlewareOptions.cs +++ b/src/Middleware/SpaServices/src/Webpack/ConditionalProxyMiddlewareOptions.cs @@ -1,7 +1,11 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; namespace Microsoft.AspNetCore.SpaServices.Webpack { + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] internal class ConditionalProxyMiddlewareOptions { public ConditionalProxyMiddlewareOptions(string scheme, string host, string port, TimeSpan requestTimeout) @@ -17,4 +21,4 @@ namespace Microsoft.AspNetCore.SpaServices.Webpack public string Port { get; } public TimeSpan RequestTimeout { get; } } -} \ No newline at end of file +} diff --git a/src/Middleware/SpaServices/src/Webpack/WebpackDevMiddleware.cs b/src/Middleware/SpaServices/src/Webpack/WebpackDevMiddleware.cs index 2e8f92ea3c..1a39d2de20 100644 --- a/src/Middleware/SpaServices/src/Webpack/WebpackDevMiddleware.cs +++ b/src/Middleware/SpaServices/src/Webpack/WebpackDevMiddleware.cs @@ -1,3 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.IO; using System.Threading; @@ -11,6 +14,7 @@ namespace Microsoft.AspNetCore.Builder /// /// Extension methods that can be used to enable Webpack dev middleware support. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static class WebpackDevMiddleware { private const string DefaultConfigFile = "webpack.config.js"; @@ -36,6 +40,7 @@ namespace Microsoft.AspNetCore.Builder ///
/// The . /// Options for configuring the Webpack compiler instance. + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public static void UseWebpackDevMiddleware( this IApplicationBuilder appBuilder, WebpackDevMiddlewareOptions options = null) @@ -145,4 +150,4 @@ namespace Microsoft.AspNetCore.Builder } } #pragma warning restore CS0649 -} \ No newline at end of file +} diff --git a/src/Middleware/SpaServices/src/Webpack/WebpackDevMiddlewareOptions.cs b/src/Middleware/SpaServices/src/Webpack/WebpackDevMiddlewareOptions.cs index df50100dc7..28685e0d90 100644 --- a/src/Middleware/SpaServices/src/Webpack/WebpackDevMiddlewareOptions.cs +++ b/src/Middleware/SpaServices/src/Webpack/WebpackDevMiddlewareOptions.cs @@ -1,3 +1,7 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; using System.Collections.Generic; namespace Microsoft.AspNetCore.SpaServices.Webpack @@ -5,6 +9,7 @@ namespace Microsoft.AspNetCore.SpaServices.Webpack /// /// Options for configuring a Webpack dev middleware compiler. /// + [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")] public class WebpackDevMiddlewareOptions { /// @@ -30,10 +35,10 @@ namespace Microsoft.AspNetCore.SpaServices.Webpack /// public bool ReactHotModuleReplacement { get; set; } - /// + /// /// Specifies additional options to be passed to the Webpack Hot Middleware client, if used. - /// - public IDictionary HotModuleReplacementClientOptions { get; set; } + /// + public IDictionary HotModuleReplacementClientOptions { get; set; } /// /// Specifies the Webpack configuration file to be used. If not set, defaults to 'webpack.config.js'. @@ -58,4 +63,4 @@ namespace Microsoft.AspNetCore.SpaServices.Webpack /// public object EnvParam { get; set; } } -} \ No newline at end of file +}