From 59d43346e6578985e9e9570c3ac3bb9154919bad Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Thu, 11 Jul 2019 15:35:47 -0700 Subject: [PATCH 01/76] Update branding to 2.1.12 (#12096) * also improve PreparingPatchUpdates.md - document changes to dependencies.props - reflect changes in how Templating is handled - e.g. use EF Core examples - nit: adjust indentation to avoid markdown warnings --- build/dependencies.props | 6 +-- docs/PreparingPatchUpdates.md | 38 +++++++++++-------- eng/Baseline.Designer.props | 6 +-- eng/Baseline.xml | 4 +- eng/PatchConfig.props | 4 ++ .../ArchiveBaseline.2.1.12.txt | 1 + .../ArchiveBaseline.2.1.12.txt | 1 + version.props | 2 +- 8 files changed, 37 insertions(+), 25 deletions(-) create mode 100644 src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.12.txt create mode 100644 src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.12.txt diff --git a/build/dependencies.props b/build/dependencies.props index 062cf99832..da966e4990 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,10 +2,10 @@ - 2.1.11 - 2.1.11 + 2.1.12 + 2.1.12 - 4.5.2 + 4.5.2 diff --git a/docs/PreparingPatchUpdates.md b/docs/PreparingPatchUpdates.md index 34813e8162..05e334abb0 100644 --- a/docs/PreparingPatchUpdates.md +++ b/docs/PreparingPatchUpdates.md @@ -16,26 +16,32 @@ In order to prepare this repo to build a new servicing update, the following cha * Update the package baselines. This is used to ensure packages keep a consistent set of dependencies between releases. See [eng/tools/BaselineGenerator/](/eng/tools/BaselineGenerator/README.md) for instructions on how to run this tool. +* **For the subset of external dependencies mentioned at the top of [build/dependencies.props](/build/dependencies.props):** + If a package (Microsoft.NetCore.App for example) shipped in the last release, update the package version properties. + + * Changes made above to external dependencies listed in [eng/Baseline.Designer.props](/eng/Baseline.Designer.props) + should _not_ require further updates. The versions of affected packages should have been updated in + [build/dependencies.props](/build/dependencies.props) during the previous patching cycle. + * **For packages with source code in this repo (not a submodule):** Update the list of packages in [eng/PatchConfig.props](/eng/PatchConfig.props) to list which packages should be patching in this release. * **For packages still building from submodules:** Update the list of repositories which will contain changes in [build/submodules.props](/build/submodules.props). - * `` items represent repos which were released in a previous patch, and will not contain servicing updates in the next patch. - * `` items represent repos which will produce new packages in this patch. - * It is usually best to move everything to `` and then iteratively add them back to `` as new repos receive approval to patch. - * Don't change the `PatchPolicy` attribute. The build system uses this to ensure patching rules are obeyed. + * `` items represent repos which were released in a previous patch, and will not contain servicing updates in the next patch. + * `` items represent repos which will produce new packages in this patch. + * It is usually best to move everything to `` and then iteratively add them back to `` as new repos receive approval to patch. + * But, do not change the Templating item at all. That is only _treated_ as a submodule. + * Don't change the `PatchPolicy` attribute. The build system uses this to ensure patching rules are obeyed. -* For each repository still listed as a ``, update the version.props file in that submodule. For example, https://github.com/aspnet/Templating/pull/824 +* **For each repository still listed as a ``:** Update the version.props file in that submodule. For example, https://github.com/aspnet/EntityFrameworkCore/pull/15369/files#diff-2a92b4d7f8df251ffd3a0aa63e97aad5 - * The version prefix in repos should match the version of ASP.NET Core. - * Exception: SignalR, which is "1.1", not "2.1". - * This leaves holes in versioning, which is okay. This may mean you increment the patch value by more than one. Example: - * EF Core ships patches in 2.1.4 as "2.1.4" - * EF Core does not ship patches in 2.1.5 or 2.1.6 - * EF Core ships in 2.1.7, therefore, EFCore's version.props file should jump from 2.1.4 to 2.1.7. + * This leaves holes in versioning, which is okay. This may mean you increment the patch value by more than one. Example: + * EF Core ships patches in 2.1.8 as "2.1.8" + * EF Core does not ship patches in 2.1.9 or 2.1.10 + * EF Core ships in 2.1.11, therefore, EFCore's version.props file should jump from 2.1.8 to 2.1.11. - ```diff - - - 2.1.4 - + 2.1.7 - ``` + ```diff + + - 8 + + 11 + ``` diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props index 519b19b9db..a830a66044 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -2,7 +2,7 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.11 + 2.1.12 @@ -898,14 +898,14 @@ - 2.1.1 + 2.1.12 - + diff --git a/eng/Baseline.xml b/eng/Baseline.xml index 6011202d83..dff0b069c0 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -4,7 +4,7 @@ This file contains a list of all the packages and their versions which were rele build of ASP.NET Core 2.1.x. Update this list when preparing for a new patch. --> - + @@ -97,7 +97,7 @@ build of ASP.NET Core 2.1.x. Update this list when preparing for a new patch. - + diff --git a/eng/PatchConfig.props b/eng/PatchConfig.props index 47f840db70..0965ea09da 100644 --- a/eng/PatchConfig.props +++ b/eng/PatchConfig.props @@ -40,4 +40,8 @@ Later on, this will be checked using this condition: Microsoft.AspNetCore.Server.HttpSys; + + + + diff --git a/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.12.txt b/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.12.txt new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.12.txt @@ -0,0 +1 @@ + diff --git a/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.12.txt b/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.12.txt new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.12.txt @@ -0,0 +1 @@ + diff --git a/version.props b/version.props index 8c94afbed8..e65ef23479 100644 --- a/version.props +++ b/version.props @@ -2,7 +2,7 @@ 2 1 - 12 + 13 servicing Servicing t000 From 4fd1d01467df0e6439ef16d33cc13c220d32931d Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Fri, 12 Jul 2019 06:56:50 -0700 Subject: [PATCH 02/76] Update branding to 2.2.7 (#12100) * Add Microsoft.AspNetCore.Mvc.Api.Analyzers to baselines * also improve PreparingPatchUpdates.md - document changes to dependencies.props - reflect changes in how Templating is handled - e.g. use EF Core examples - nit: adjust indentation to avoid markdown warnings --- build/dependencies.props | 16 +++++++-------- build/submodules.props | 2 +- docs/PreparingPatchUpdates.md | 38 ++++++++++++++++++++--------------- eng/Baseline.Designer.props | 19 +++++++++++------- eng/Baseline.xml | 11 +++++----- eng/PatchConfig.props | 4 ++++ version.props | 2 +- 7 files changed, 54 insertions(+), 38 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index ff1b314c33..5f51ce3667 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,17 +2,17 @@ - 2.2.5 - 2.2.5 + 2.2.6 + 2.2.6 - 2.2.4 - 2.2.4 - 2.2.4 - 2.2.4 - 2.2.4 - 2.2.4 + 2.2.6 + 2.2.6 + 2.2.6 + 2.2.6 + 2.2.6 + 2.2.6 diff --git a/build/submodules.props b/build/submodules.props index a088430493..4370c412c7 100644 --- a/build/submodules.props +++ b/build/submodules.props @@ -37,6 +37,6 @@ - + diff --git a/docs/PreparingPatchUpdates.md b/docs/PreparingPatchUpdates.md index 34813e8162..05e334abb0 100644 --- a/docs/PreparingPatchUpdates.md +++ b/docs/PreparingPatchUpdates.md @@ -16,26 +16,32 @@ In order to prepare this repo to build a new servicing update, the following cha * Update the package baselines. This is used to ensure packages keep a consistent set of dependencies between releases. See [eng/tools/BaselineGenerator/](/eng/tools/BaselineGenerator/README.md) for instructions on how to run this tool. +* **For the subset of external dependencies mentioned at the top of [build/dependencies.props](/build/dependencies.props):** + If a package (Microsoft.NetCore.App for example) shipped in the last release, update the package version properties. + + * Changes made above to external dependencies listed in [eng/Baseline.Designer.props](/eng/Baseline.Designer.props) + should _not_ require further updates. The versions of affected packages should have been updated in + [build/dependencies.props](/build/dependencies.props) during the previous patching cycle. + * **For packages with source code in this repo (not a submodule):** Update the list of packages in [eng/PatchConfig.props](/eng/PatchConfig.props) to list which packages should be patching in this release. * **For packages still building from submodules:** Update the list of repositories which will contain changes in [build/submodules.props](/build/submodules.props). - * `` items represent repos which were released in a previous patch, and will not contain servicing updates in the next patch. - * `` items represent repos which will produce new packages in this patch. - * It is usually best to move everything to `` and then iteratively add them back to `` as new repos receive approval to patch. - * Don't change the `PatchPolicy` attribute. The build system uses this to ensure patching rules are obeyed. + * `` items represent repos which were released in a previous patch, and will not contain servicing updates in the next patch. + * `` items represent repos which will produce new packages in this patch. + * It is usually best to move everything to `` and then iteratively add them back to `` as new repos receive approval to patch. + * But, do not change the Templating item at all. That is only _treated_ as a submodule. + * Don't change the `PatchPolicy` attribute. The build system uses this to ensure patching rules are obeyed. -* For each repository still listed as a ``, update the version.props file in that submodule. For example, https://github.com/aspnet/Templating/pull/824 +* **For each repository still listed as a ``:** Update the version.props file in that submodule. For example, https://github.com/aspnet/EntityFrameworkCore/pull/15369/files#diff-2a92b4d7f8df251ffd3a0aa63e97aad5 - * The version prefix in repos should match the version of ASP.NET Core. - * Exception: SignalR, which is "1.1", not "2.1". - * This leaves holes in versioning, which is okay. This may mean you increment the patch value by more than one. Example: - * EF Core ships patches in 2.1.4 as "2.1.4" - * EF Core does not ship patches in 2.1.5 or 2.1.6 - * EF Core ships in 2.1.7, therefore, EFCore's version.props file should jump from 2.1.4 to 2.1.7. + * This leaves holes in versioning, which is okay. This may mean you increment the patch value by more than one. Example: + * EF Core ships patches in 2.1.8 as "2.1.8" + * EF Core does not ship patches in 2.1.9 or 2.1.10 + * EF Core ships in 2.1.11, therefore, EFCore's version.props file should jump from 2.1.8 to 2.1.11. - ```diff - - - 2.1.4 - + 2.1.7 - ``` + ```diff + + - 8 + + 11 + ``` diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props index 62cc7a6854..02e35937c3 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -2,7 +2,7 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.2.5 + 2.2.6 @@ -77,12 +77,12 @@ - 2.2.5 + 2.2.6 - 2.2.5 + 2.2.6 @@ -649,6 +649,11 @@ 2.2.0 + + + 2.2.6 + + 2.2.0 @@ -954,7 +959,7 @@ - 2.2.0 + 2.2.6 @@ -965,13 +970,13 @@ - 2.2.2 + 2.2.6 - + @@ -1347,4 +1352,4 @@ - + \ No newline at end of file diff --git a/eng/Baseline.xml b/eng/Baseline.xml index cc802678a3..4edbdbadf4 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -4,7 +4,7 @@ This file contains a list of all the packages and their versions which were rele build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. --> - + @@ -12,8 +12,8 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. - - + + @@ -74,6 +74,7 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. + @@ -102,8 +103,8 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. - - + + diff --git a/eng/PatchConfig.props b/eng/PatchConfig.props index 3daf32fba4..196624c7d6 100644 --- a/eng/PatchConfig.props +++ b/eng/PatchConfig.props @@ -73,4 +73,8 @@ Later on, this will be checked using this condition: Microsoft.AspNetCore.Server.IIS; + + + + diff --git a/version.props b/version.props index f5ceabf956..6dd444f335 100644 --- a/version.props +++ b/version.props @@ -2,7 +2,7 @@ 2 2 - 6 + 7 servicing $([System.DateTime]::Now.ToString('yyMMdd'))-99 From c8fc054096fccbcec3a01e919f0402e68428b57b Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Fri, 12 Jul 2019 11:45:46 -0700 Subject: [PATCH 03/76] Version the SPA template package [release/2.1] (#11774) * Version the SPA template package * Update src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj * Fix templates --- build/artifacts.props | 2 +- src/AzureIntegration/build/repo.targets | 2 +- src/Templating/NuGetPackageVerifier.json | 2 +- .../Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj | 1 + .../content/Angular-CSharp/.template.config/template.json | 2 +- .../test/Templates.Test/Helpers/TemplatePackageInstaller.cs | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build/artifacts.props b/build/artifacts.props index 075e0d5d20..e51a66c3f8 100644 --- a/build/artifacts.props +++ b/build/artifacts.props @@ -145,7 +145,7 @@ - + diff --git a/src/AzureIntegration/build/repo.targets b/src/AzureIntegration/build/repo.targets index 4f6c94e8f2..856963004f 100644 --- a/src/AzureIntegration/build/repo.targets +++ b/src/AzureIntegration/build/repo.targets @@ -70,7 +70,7 @@ - + diff --git a/src/Templating/NuGetPackageVerifier.json b/src/Templating/NuGetPackageVerifier.json index c3c62e30d3..42e021f202 100644 --- a/src/Templating/NuGetPackageVerifier.json +++ b/src/Templating/NuGetPackageVerifier.json @@ -24,7 +24,7 @@ "Template" ] }, - "Microsoft.DotNet.Web.Spa.ProjectTemplates": { + "Microsoft.DotNet.Web.Spa.ProjectTemplates.2.1": { "packageTypes": [ "Template" ] diff --git a/src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj b/src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj index 576f467305..37899ac5e3 100644 --- a/src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj +++ b/src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj @@ -4,6 +4,7 @@ netcoreapp2.1 + Microsoft.DotNet.Web.Spa.ProjectTemplates.$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion) Single Page Application templates for ASP.NET Core $(PackageTags);spa diff --git a/src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/template.json b/src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/template.json index e7b2a59892..fb783b15d7 100644 --- a/src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/template.json +++ b/src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/template.json @@ -140,4 +140,4 @@ "continueOnError": true } ] -} \ No newline at end of file +} diff --git a/src/Templating/test/Templates.Test/Helpers/TemplatePackageInstaller.cs b/src/Templating/test/Templates.Test/Helpers/TemplatePackageInstaller.cs index 4493d1fb31..fd60b79630 100644 --- a/src/Templating/test/Templates.Test/Helpers/TemplatePackageInstaller.cs +++ b/src/Templating/test/Templates.Test/Helpers/TemplatePackageInstaller.cs @@ -21,7 +21,7 @@ namespace Templates.Test.Helpers "Microsoft.DotNet.Web.ProjectTemplates.1.x", "Microsoft.DotNet.Web.ProjectTemplates.2.0", "Microsoft.DotNet.Web.ProjectTemplates.2.1", - "Microsoft.DotNet.Web.Spa.ProjectTemplates", + "Microsoft.DotNet.Web.Spa.ProjectTemplates.2.1", }; public static string CustomHivePath { get; } = Path.Combine(AppContext.BaseDirectory, ".templateengine"); From 797f7b167012bb2bc54123cd97c5ac07c9cafaf0 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Fri, 12 Jul 2019 11:46:06 -0700 Subject: [PATCH 04/76] Version the SPA template package (#11773) * Version the SPA template package * Fix templates --- build/artifacts.props | 2 +- src/Templating/NuGetPackageVerifier.json | 4 ++-- .../Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/artifacts.props b/build/artifacts.props index 232539cb25..cfcf7445c5 100644 --- a/build/artifacts.props +++ b/build/artifacts.props @@ -152,7 +152,7 @@ - + diff --git a/src/Templating/NuGetPackageVerifier.json b/src/Templating/NuGetPackageVerifier.json index a1bfc0f1c5..062bbdbe04 100644 --- a/src/Templating/NuGetPackageVerifier.json +++ b/src/Templating/NuGetPackageVerifier.json @@ -24,11 +24,11 @@ "Template" ] }, - "Microsoft.DotNet.Web.Spa.ProjectTemplates": { + "Microsoft.DotNet.Web.Spa.ProjectTemplates.2.2": { "packageTypes": [ "Template" ] } } } -} \ No newline at end of file +} diff --git a/src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj b/src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj index b31f3d8ddd..fb7c42b621 100644 --- a/src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj +++ b/src/Templating/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj @@ -4,6 +4,7 @@ netcoreapp2.2 + Microsoft.DotNet.Web.Spa.ProjectTemplates.$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion) Single Page Application templates for ASP.NET Core To install the templates in this package, run 'dotnet new --install $(PackageId)::$(PackageVersion)'. From 6ed7bf85b198a22a3cdd5b61c4eca5657959dadc Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Fri, 12 Jul 2019 11:11:45 -0700 Subject: [PATCH 05/76] Re-pin System.Threading.Tasks.Extensions - not shipping this time around --- build/dependencies.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index da966e4990..0b1adf4cf1 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,7 +5,6 @@ 2.1.12 2.1.12 - 4.5.2 @@ -188,6 +187,7 @@ 4.5.0 5.2.0 3.1.1 + 4.5.3 4.5.3 4.3.4 4.5.3 @@ -205,8 +205,8 @@ 4.5.0 4.5.0 4.9.0 + 4.5.2 4.5.0 - 4.5.3 4.5.3 1.3.7 9.0.1 From 7f1350268a9f5f49977241987a8eb8113a845faa Mon Sep 17 00:00:00 2001 From: Isaac Levin <8878502+isaac2004@users.noreply.github.com> Date: Fri, 12 Jul 2019 19:23:43 -0400 Subject: [PATCH 06/76] Update Startup.cs --- .../content/BlazorServerWeb-CSharp/Startup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Startup.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Startup.cs index f6d8f25248..f5a91824f6 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Startup.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Startup.cs @@ -144,7 +144,7 @@ namespace BlazorServerWeb_CSharp } else { - app.UseExceptionHandler("/Home/Error"); + app.UseExceptionHandler("/Error"); #if (RequiresHttps) // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); From 7ba5f7e8b9c09669b9dcbd41c409e22271b5bc72 Mon Sep 17 00:00:00 2001 From: Isaac Levin <8878502+isaac2004@users.noreply.github.com> Date: Fri, 12 Jul 2019 19:26:14 -0400 Subject: [PATCH 07/76] Add files via upload --- .../BlazorServerWeb-CSharp/Pages/Error.razor | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.razor diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.razor new file mode 100644 index 0000000000..cd87ea9518 --- /dev/null +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.razor @@ -0,0 +1,16 @@ +@page "/error" + + +

Error.

+

An error occurred while processing your request.

+ +

Development Mode

+

+ Swapping to Development environment will display more detailed information about the error that occurred. +

+

+ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +

\ No newline at end of file From 87a92e52c8b4bb7cb75ff78d53d641b1d34f8775 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 12 Jul 2019 22:29:54 -0700 Subject: [PATCH 08/76] Make some pubternal types in data protection (#12121) - Make CngAuthenticatedEncryptorBase internal - Left IActivator public because they are used in constructors the XmlKeyManager ctor --- ...AspNetCore.DataProtection.netstandard2.0.cs | 18 ------------------ .../Internal/CngAuthenticatedEncryptorBase.cs | 2 +- .../src/Internal/DataProtectionBuilder.cs | 2 +- .../Cng/CngAuthenticatedEncryptorBaseTests.cs | 2 +- 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.netstandard2.0.cs b/src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.netstandard2.0.cs index badd03a3ce..70cd9bfe67 100644 --- a/src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.netstandard2.0.cs +++ b/src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.netstandard2.0.cs @@ -217,26 +217,8 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat public System.Xml.Linq.XElement SerializedDescriptorElement { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } } -namespace Microsoft.AspNetCore.DataProtection.Cng.Internal -{ - public abstract partial class CngAuthenticatedEncryptorBase : Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor, System.IDisposable - { - protected CngAuthenticatedEncryptorBase() { } - public byte[] Decrypt(System.ArraySegment ciphertext, System.ArraySegment additionalAuthenticatedData) { throw null; } - protected unsafe abstract byte[] DecryptImpl(byte* pbCiphertext, uint cbCiphertext, byte* pbAdditionalAuthenticatedData, uint cbAdditionalAuthenticatedData); - public abstract void Dispose(); - public byte[] Encrypt(System.ArraySegment plaintext, System.ArraySegment additionalAuthenticatedData) { throw null; } - public byte[] Encrypt(System.ArraySegment plaintext, System.ArraySegment additionalAuthenticatedData, uint preBufferSize, uint postBufferSize) { throw null; } - protected unsafe abstract byte[] EncryptImpl(byte* pbPlaintext, uint cbPlaintext, byte* pbAdditionalAuthenticatedData, uint cbAdditionalAuthenticatedData, uint cbPreBuffer, uint cbPostBuffer); - } -} namespace Microsoft.AspNetCore.DataProtection.Internal { - public partial class DataProtectionBuilder : Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder - { - public DataProtectionBuilder(Microsoft.Extensions.DependencyInjection.IServiceCollection services) { } - public Microsoft.Extensions.DependencyInjection.IServiceCollection Services { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - } public partial interface IActivator { object CreateInstance(System.Type expectedBaseType, string implementationTypeName); diff --git a/src/DataProtection/DataProtection/src/Cng/Internal/CngAuthenticatedEncryptorBase.cs b/src/DataProtection/DataProtection/src/Cng/Internal/CngAuthenticatedEncryptorBase.cs index 7b7e3e2d79..a6f9bef9eb 100644 --- a/src/DataProtection/DataProtection/src/Cng/Internal/CngAuthenticatedEncryptorBase.cs +++ b/src/DataProtection/DataProtection/src/Cng/Internal/CngAuthenticatedEncryptorBase.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.DataProtection.Cng.Internal /// /// Base class used for all CNG-related authentication encryption operations. /// - public unsafe abstract class CngAuthenticatedEncryptorBase : IOptimizedAuthenticatedEncryptor, IDisposable + internal unsafe abstract class CngAuthenticatedEncryptorBase : IOptimizedAuthenticatedEncryptor, IDisposable { public byte[] Decrypt(ArraySegment ciphertext, ArraySegment additionalAuthenticatedData) { diff --git a/src/DataProtection/DataProtection/src/Internal/DataProtectionBuilder.cs b/src/DataProtection/DataProtection/src/Internal/DataProtectionBuilder.cs index bc8908c9c4..53ec101992 100644 --- a/src/DataProtection/DataProtection/src/Internal/DataProtectionBuilder.cs +++ b/src/DataProtection/DataProtection/src/Internal/DataProtectionBuilder.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.DataProtection.Internal /// /// Default implementation of . /// - public class DataProtectionBuilder : IDataProtectionBuilder + internal class DataProtectionBuilder : IDataProtectionBuilder { /// /// Creates a new configuration object linked to a . diff --git a/src/DataProtection/DataProtection/test/Cng/CngAuthenticatedEncryptorBaseTests.cs b/src/DataProtection/DataProtection/test/Cng/CngAuthenticatedEncryptorBaseTests.cs index faedbf44e9..dd439785f4 100644 --- a/src/DataProtection/DataProtection/test/Cng/CngAuthenticatedEncryptorBaseTests.cs +++ b/src/DataProtection/DataProtection/test/Cng/CngAuthenticatedEncryptorBaseTests.cs @@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.DataProtection.Cng.Internal Assert.Equal(new byte[] { 0x20, 0x21, 0x22 }, retVal); } - public abstract class MockableEncryptor : CngAuthenticatedEncryptorBase + internal abstract class MockableEncryptor : CngAuthenticatedEncryptorBase { public override void Dispose() { From 6a95fcc5e3451091f480aafd1857bd1dd241aa68 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2019 06:59:23 -0700 Subject: [PATCH 09/76] [release/3.0-preview7] Update dependencies from 2 repositories (#12146) * Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20190712.6 - Microsoft.EntityFrameworkCore.Tools - 3.0.0-preview7.19362.6 - Microsoft.EntityFrameworkCore.SqlServer - 3.0.0-preview7.19362.6 - dotnet-ef - 3.0.0-preview7.19362.6 - Microsoft.EntityFrameworkCore - 3.0.0-preview7.19362.6 - Microsoft.EntityFrameworkCore.InMemory - 3.0.0-preview7.19362.6 - Microsoft.EntityFrameworkCore.Relational - 3.0.0-preview7.19362.6 - Microsoft.EntityFrameworkCore.Sqlite - 3.0.0-preview7.19362.6 Dependency coherency updates - Microsoft.AspNetCore.Analyzer.Testing - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.ActivatorUtilities.Sources - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Caching.Abstractions - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Caching.Memory - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Caching.SqlServer - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Caching.StackExchangeRedis - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Abstractions - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.AzureKeyVault - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Binder - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.CommandLine - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.EnvironmentVariables - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.FileExtensions - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Ini - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Json - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.KeyPerFile - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.UserSecrets - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Xml - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.DependencyInjection.Abstractions - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.DependencyInjection - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.DiagnosticAdapter - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Diagnostics.HealthChecks - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileProviders.Abstractions - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileProviders.Composite - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileProviders.Embedded - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileProviders.Physical - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileSystemGlobbing - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Hosting.Abstractions - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Hosting - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.HostFactoryResolver.Sources - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Http - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Localization.Abstractions - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Localization - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Abstractions - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.AzureAppServices - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Configuration - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Console - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Debug - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.EventSource - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.EventLog - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.TraceSource - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Testing - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.ObjectPool - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Options.ConfigurationExtensions - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Options.DataAnnotations - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Options - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.ParameterDefaultValue.Sources - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Primitives - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.TypeNameHelper.Sources - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.ValueStopwatch.Sources - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.WebEncoders - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Internal.Extensions.Refs - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.JSInterop - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Mono.WebAssembly.Interop - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Bcl.AsyncInterfaces - 1.0.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.CSharp - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Win32.Registry - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.ComponentModel.Annotations - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Diagnostics.EventLog - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.IO.Pipelines - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Net.Http.WinHttpHandler - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Net.WebSockets.WebSocketProtocol - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Reflection.Metadata - 1.7.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Runtime.CompilerServices.Unsafe - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Security.Cryptography.Cng - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Security.Cryptography.Pkcs - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Security.Cryptography.Xml - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Security.Permissions - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Security.Principal.Windows - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.ServiceProcess.ServiceController - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Text.Encodings.Web - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Text.Json - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - System.Threading.Channels - 4.6.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.DependencyModel - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Ref - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - NETStandard.Library.Ref - 2.1.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.Platforms - 3.0.0-preview7.19362.9 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview7-27912-14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Internal.AspNetCore.Analyzers - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) - Microsoft.AspNetCore.Testing - 3.0.0-preview7.19362.4 (parent: Microsoft.EntityFrameworkCore) * Update dependencies from https://github.com/aspnet/AspNetCore-Tooling build 20190712.5 - Microsoft.NET.Sdk.Razor - 3.0.0-preview7.19362.5 - Microsoft.CodeAnalysis.Razor - 3.0.0-preview7.19362.5 - Microsoft.AspNetCore.Razor.Language - 3.0.0-preview7.19362.5 - Microsoft.AspNetCore.Mvc.Razor.Extensions - 3.0.0-preview7.19362.5 --- eng/Version.Details.xml | 384 ++++++++++++++++++++-------------------- eng/Versions.props | 192 ++++++++++---------- 2 files changed, 288 insertions(+), 288 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9f1be421c3..e37dcc9a42 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -13,396 +13,396 @@ https://github.com/aspnet/Blazor 10ac2538243650ab287ba9fafe6d05e30c40f9ae - + https://github.com/aspnet/AspNetCore-Tooling - 0b81b1d4ddaf7b59e6718b140cdd99968f2a0de5 + 393795bbe6d2748aafd3a30db90042c5aae72180 - + https://github.com/aspnet/AspNetCore-Tooling - 0b81b1d4ddaf7b59e6718b140cdd99968f2a0de5 + 393795bbe6d2748aafd3a30db90042c5aae72180 - + https://github.com/aspnet/AspNetCore-Tooling - 0b81b1d4ddaf7b59e6718b140cdd99968f2a0de5 + 393795bbe6d2748aafd3a30db90042c5aae72180 - + https://github.com/aspnet/AspNetCore-Tooling - 0b81b1d4ddaf7b59e6718b140cdd99968f2a0de5 + 393795bbe6d2748aafd3a30db90042c5aae72180 - + https://github.com/aspnet/EntityFrameworkCore - f7e7e91a5dce99c342e014bacea8e852cf9ca741 + 283ca96f86a1bf16262377037366350512dc125a - + https://github.com/aspnet/EntityFrameworkCore - f7e7e91a5dce99c342e014bacea8e852cf9ca741 + 283ca96f86a1bf16262377037366350512dc125a - + https://github.com/aspnet/EntityFrameworkCore - f7e7e91a5dce99c342e014bacea8e852cf9ca741 + 283ca96f86a1bf16262377037366350512dc125a - + https://github.com/aspnet/EntityFrameworkCore - f7e7e91a5dce99c342e014bacea8e852cf9ca741 + 283ca96f86a1bf16262377037366350512dc125a - + https://github.com/aspnet/EntityFrameworkCore - f7e7e91a5dce99c342e014bacea8e852cf9ca741 + 283ca96f86a1bf16262377037366350512dc125a - + https://github.com/aspnet/EntityFrameworkCore - f7e7e91a5dce99c342e014bacea8e852cf9ca741 + 283ca96f86a1bf16262377037366350512dc125a - + https://github.com/aspnet/EntityFrameworkCore - f7e7e91a5dce99c342e014bacea8e852cf9ca741 + 283ca96f86a1bf16262377037366350512dc125a - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 https://github.com/dotnet/corefx a28176b5ec68b6da1472934fe9493790d1665cae - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/dotnet/core-setup - fbe9466dddee8b3bbde6b706598d8f83802d08ce + 4da6ee6450e4dd43ef8c05925fec22d9ac3892f3 - + https://github.com/dotnet/core-setup - fbe9466dddee8b3bbde6b706598d8f83802d08ce + 4da6ee6450e4dd43ef8c05925fec22d9ac3892f3 - + https://github.com/dotnet/core-setup - fbe9466dddee8b3bbde6b706598d8f83802d08ce + 4da6ee6450e4dd43ef8c05925fec22d9ac3892f3 - + https://github.com/dotnet/core-setup - fbe9466dddee8b3bbde6b706598d8f83802d08ce + 4da6ee6450e4dd43ef8c05925fec22d9ac3892f3 - + https://github.com/dotnet/corefx - 9c3c40ac8b4f9b56791bc3c18c540079dad8a812 + 1719a3fe2a5c81b67a4909787da4a02fb0d0d419 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 https://github.com/dotnet/arcade @@ -416,9 +416,9 @@ https://github.com/dotnet/arcade 9946534da4f73e6242ca105f6798ab58119c9ab0 - + https://github.com/aspnet/Extensions - 0db848f9c0091be8980db79c0b88c519910c4c3b + 918f4d16989011843965fe7e7a183f623ea08ed3 https://github.com/dotnet/roslyn diff --git a/eng/Versions.props b/eng/Versions.props index 3d796aacf9..7137ec77aa 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -54,110 +54,110 @@ 3.3.0-beta1-19351-01 - 3.0.0-preview7-27902-19 - 3.0.0-preview7-27902-19 - 3.0.0-preview7-27902-19 - 2.1.0-preview7-27902-19 + 3.0.0-preview7-27912-14 + 3.0.0-preview7-27912-14 + 3.0.0-preview7-27912-14 + 2.1.0-preview7-27912-14 - 1.0.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 + 1.0.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 4.7.0-preview6.19264.9 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 1.7.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 - 4.6.0-preview7.19352.8 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 1.7.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 + 4.6.0-preview7.19362.9 - 3.0.0-preview7.19352.8 + 3.0.0-preview7.19362.9 0.10.0-preview7.19351.1 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 - 3.0.0-preview7.19352.13 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 + 3.0.0-preview7.19362.4 - 3.0.0-preview7.19352.17 - 3.0.0-preview7.19352.17 - 3.0.0-preview7.19352.17 - 3.0.0-preview7.19352.17 - 3.0.0-preview7.19352.17 - 3.0.0-preview7.19352.17 - 3.0.0-preview7.19352.17 + 3.0.0-preview7.19362.6 + 3.0.0-preview7.19362.6 + 3.0.0-preview7.19362.6 + 3.0.0-preview7.19362.6 + 3.0.0-preview7.19362.6 + 3.0.0-preview7.19362.6 + 3.0.0-preview7.19362.6 - 3.0.0-preview7.19352.14 - 3.0.0-preview7.19352.14 - 3.0.0-preview7.19352.14 - 3.0.0-preview7.19352.14 + 3.0.0-preview7.19362.5 + 3.0.0-preview7.19362.5 + 3.0.0-preview7.19362.5 + 3.0.0-preview7.19362.5 + - + - + diff --git a/src/Middleware/RequestThrottling/perf/Microbenchmarks/QueueEmptyOverhead.cs b/src/Middleware/ConcurrencyLimiter/perf/Microbenchmarks/QueueEmptyOverhead.cs similarity index 89% rename from src/Middleware/RequestThrottling/perf/Microbenchmarks/QueueEmptyOverhead.cs rename to src/Middleware/ConcurrencyLimiter/perf/Microbenchmarks/QueueEmptyOverhead.cs index b4145022b2..a20e68486f 100644 --- a/src/Middleware/RequestThrottling/perf/Microbenchmarks/QueueEmptyOverhead.cs +++ b/src/Middleware/ConcurrencyLimiter/perf/Microbenchmarks/QueueEmptyOverhead.cs @@ -5,16 +5,16 @@ using System.Threading.Tasks; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.RequestThrottling.Tests; +using Microsoft.AspNetCore.ConcurrencyLimiter.Tests; -namespace Microsoft.AspNetCore.RequestThrottling.Microbenchmarks +namespace Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks { public class QueueEmptyOverhead { private const int _numRequests = 20000; - private RequestThrottlingMiddleware _middlewareFIFO; - private RequestThrottlingMiddleware _middlewareLIFO; + private ConcurrencyLimiterMiddleware _middlewareFIFO; + private ConcurrencyLimiterMiddleware _middlewareLIFO; private RequestDelegate _restOfServer; [GlobalSetup] diff --git a/src/Middleware/RequestThrottling/perf/Microbenchmarks/QueueFullOverhead.cs b/src/Middleware/ConcurrencyLimiter/perf/Microbenchmarks/QueueFullOverhead.cs similarity index 90% rename from src/Middleware/RequestThrottling/perf/Microbenchmarks/QueueFullOverhead.cs rename to src/Middleware/ConcurrencyLimiter/perf/Microbenchmarks/QueueFullOverhead.cs index 2cdfdc1f83..bd47f120e1 100644 --- a/src/Middleware/RequestThrottling/perf/Microbenchmarks/QueueFullOverhead.cs +++ b/src/Middleware/ConcurrencyLimiter/perf/Microbenchmarks/QueueFullOverhead.cs @@ -5,9 +5,9 @@ using System.Threading; using System.Threading.Tasks; using BenchmarkDotNet.Attributes; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.RequestThrottling.Tests; +using Microsoft.AspNetCore.ConcurrencyLimiter.Tests; -namespace Microsoft.AspNetCore.RequestThrottling.Microbenchmarks +namespace Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks { public class QueueFullOverhead { @@ -15,8 +15,8 @@ namespace Microsoft.AspNetCore.RequestThrottling.Microbenchmarks private int _requestCount = 0; private ManualResetEventSlim _mres = new ManualResetEventSlim(); - private RequestThrottlingMiddleware _middleware_FIFO; - private RequestThrottlingMiddleware _middleware_LIFO; + private ConcurrencyLimiterMiddleware _middleware_FIFO; + private ConcurrencyLimiterMiddleware _middleware_LIFO; [Params(8)] public int MaxConcurrentRequests; diff --git a/src/Middleware/RequestThrottling/ref/Microsoft.AspNetCore.RequestThrottling.csproj b/src/Middleware/ConcurrencyLimiter/ref/Microsoft.AspNetCore.ConcurrencyLimiter.csproj similarity index 86% rename from src/Middleware/RequestThrottling/ref/Microsoft.AspNetCore.RequestThrottling.csproj rename to src/Middleware/ConcurrencyLimiter/ref/Microsoft.AspNetCore.ConcurrencyLimiter.csproj index ba0a06082e..9744b563e9 100644 --- a/src/Middleware/RequestThrottling/ref/Microsoft.AspNetCore.RequestThrottling.csproj +++ b/src/Middleware/ConcurrencyLimiter/ref/Microsoft.AspNetCore.ConcurrencyLimiter.csproj @@ -4,7 +4,7 @@ netcoreapp3.0 - + diff --git a/src/Middleware/RequestThrottling/ref/Microsoft.AspNetCore.RequestThrottling.netcoreapp3.0.cs b/src/Middleware/ConcurrencyLimiter/ref/Microsoft.AspNetCore.ConcurrencyLimiter.netcoreapp3.0.cs similarity index 68% rename from src/Middleware/RequestThrottling/ref/Microsoft.AspNetCore.RequestThrottling.netcoreapp3.0.cs rename to src/Middleware/ConcurrencyLimiter/ref/Microsoft.AspNetCore.ConcurrencyLimiter.netcoreapp3.0.cs index d1ded94586..dd8206d528 100644 --- a/src/Middleware/RequestThrottling/ref/Microsoft.AspNetCore.RequestThrottling.netcoreapp3.0.cs +++ b/src/Middleware/ConcurrencyLimiter/ref/Microsoft.AspNetCore.ConcurrencyLimiter.netcoreapp3.0.cs @@ -3,13 +3,24 @@ namespace Microsoft.AspNetCore.Builder { - public static partial class RequestThrottlingExtensions + public static partial class ConcurrencyLimiterExtensions { - public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseRequestThrottling(this Microsoft.AspNetCore.Builder.IApplicationBuilder app) { throw null; } + public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseConcurrencyLimiter(this Microsoft.AspNetCore.Builder.IApplicationBuilder app) { throw null; } } } -namespace Microsoft.AspNetCore.RequestThrottling +namespace Microsoft.AspNetCore.ConcurrencyLimiter { + public partial class ConcurrencyLimiterMiddleware + { + public ConcurrencyLimiterMiddleware(Microsoft.AspNetCore.Http.RequestDelegate next, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Microsoft.AspNetCore.ConcurrencyLimiter.IQueuePolicy queue, Microsoft.Extensions.Options.IOptions options) { } + [System.Diagnostics.DebuggerStepThroughAttribute] + public System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext context) { throw null; } + } + public partial class ConcurrencyLimiterOptions + { + public ConcurrencyLimiterOptions() { } + public Microsoft.AspNetCore.Http.RequestDelegate OnRejected { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } public partial interface IQueuePolicy { void OnExit(); @@ -21,23 +32,12 @@ namespace Microsoft.AspNetCore.RequestThrottling public int MaxConcurrentRequests { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } public int RequestQueueLimit { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } } - public partial class RequestThrottlingMiddleware - { - public RequestThrottlingMiddleware(Microsoft.AspNetCore.Http.RequestDelegate next, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Microsoft.AspNetCore.RequestThrottling.IQueuePolicy queue, Microsoft.Extensions.Options.IOptions options) { } - [System.Diagnostics.DebuggerStepThroughAttribute] - public System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext context) { throw null; } - } - public partial class RequestThrottlingOptions - { - public RequestThrottlingOptions() { } - public Microsoft.AspNetCore.Http.RequestDelegate OnRejected { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - } } namespace Microsoft.Extensions.DependencyInjection { public static partial class QueuePolicyServiceCollectionExtensions { - public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddStackQueue(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action configure) { throw null; } - public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddTailDropQueue(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action configure) { throw null; } + public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddStackQueue(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action configure) { throw null; } + public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddTailDropQueue(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action configure) { throw null; } } } diff --git a/src/Middleware/RequestThrottling/sample/RequestThrottlingSample.csproj b/src/Middleware/ConcurrencyLimiter/sample/ConcurrencyLimiterSample.csproj similarity index 79% rename from src/Middleware/RequestThrottling/sample/RequestThrottlingSample.csproj rename to src/Middleware/ConcurrencyLimiter/sample/ConcurrencyLimiterSample.csproj index 3262b0749b..cb1aa19fa2 100644 --- a/src/Middleware/RequestThrottling/sample/RequestThrottlingSample.csproj +++ b/src/Middleware/ConcurrencyLimiter/sample/ConcurrencyLimiterSample.csproj @@ -6,13 +6,13 @@ - + - + diff --git a/src/Middleware/ConcurrencyLimiter/sample/Startup.cs b/src/Middleware/ConcurrencyLimiter/sample/Startup.cs new file mode 100644 index 0000000000..618d6e56f6 --- /dev/null +++ b/src/Middleware/ConcurrencyLimiter/sample/Startup.cs @@ -0,0 +1,47 @@ +// 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.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; + +namespace ConcurrencyLimiterSample +{ + public class Startup + { + public void ConfigureServices(IServiceCollection services) + { + services.AddStackQueue((options) => { + options.MaxConcurrentRequests = Environment.ProcessorCount; + options.RequestQueueLimit = 50; + }); + } + + public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) + { + app.UseConcurrencyLimiter(); + app.Run(async context => + { + var delay = 100; + Task.Delay(delay).Wait(); + + await context.Response.WriteAsync("Hello World!"); + }); + } + + public static void Main(string[] args) + { + new WebHostBuilder() + .UseKestrel() + .UseStartup() + .Build() + .Run(); + } + } +} diff --git a/src/Middleware/RequestThrottling/src/RequestThrottlingEventSource.cs b/src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterEventSource.cs similarity index 83% rename from src/Middleware/RequestThrottling/src/RequestThrottlingEventSource.cs rename to src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterEventSource.cs index fe62439858..3582c83e63 100644 --- a/src/Middleware/RequestThrottling/src/RequestThrottlingEventSource.cs +++ b/src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterEventSource.cs @@ -8,11 +8,11 @@ using System.Text; using System.Threading; using Microsoft.Extensions.Internal; -namespace Microsoft.AspNetCore.RequestThrottling +namespace Microsoft.AspNetCore.ConcurrencyLimiter { - internal sealed class RequestThrottlingEventSource : EventSource + internal sealed class ConcurrencyLimiterEventSource : EventSource { - public static readonly RequestThrottlingEventSource Log = new RequestThrottlingEventSource(); + public static readonly ConcurrencyLimiterEventSource Log = new ConcurrencyLimiterEventSource(); private static readonly QueueFrame CachedNonTimerResult = new QueueFrame(timer: null, parent: Log); private PollingCounter _rejectedRequestsCounter; @@ -22,13 +22,13 @@ namespace Microsoft.AspNetCore.RequestThrottling private long _rejectedRequests; private int _queueLength; - internal RequestThrottlingEventSource() - : base("Microsoft.AspNetCore.RequestThrottling") + internal ConcurrencyLimiterEventSource() + : base("Microsoft.AspNetCore.ConcurrencyLimiter") { } // Used for testing - internal RequestThrottlingEventSource(string eventSourceName) + internal ConcurrencyLimiterEventSource(string eventSourceName) : base(eventSourceName) { } @@ -65,9 +65,9 @@ namespace Microsoft.AspNetCore.RequestThrottling internal struct QueueFrame : IDisposable { private ValueStopwatch? _timer; - private RequestThrottlingEventSource _parent; + private ConcurrencyLimiterEventSource _parent; - public QueueFrame(ValueStopwatch? timer, RequestThrottlingEventSource parent) + public QueueFrame(ValueStopwatch? timer, ConcurrencyLimiterEventSource parent) { _timer = timer; _parent = parent; diff --git a/src/Middleware/RequestThrottling/src/RequestThrottlingExtensions.cs b/src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterExtensions.cs similarity index 55% rename from src/Middleware/RequestThrottling/src/RequestThrottlingExtensions.cs rename to src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterExtensions.cs index 17968b44d5..d02c55f6cd 100644 --- a/src/Middleware/RequestThrottling/src/RequestThrottlingExtensions.cs +++ b/src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterExtensions.cs @@ -2,28 +2,28 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.RequestThrottling; +using Microsoft.AspNetCore.ConcurrencyLimiter; namespace Microsoft.AspNetCore.Builder { /// - /// Extension methods for adding the to an application. + /// Extension methods for adding the to an application. /// - public static class RequestThrottlingExtensions + public static class ConcurrencyLimiterExtensions { /// - /// Adds the to limit the number of concurrently-executing requests. + /// Adds the to limit the number of concurrently-executing requests. /// /// The . /// The . - public static IApplicationBuilder UseRequestThrottling(this IApplicationBuilder app) + public static IApplicationBuilder UseConcurrencyLimiter(this IApplicationBuilder app) { if (app == null) { throw new ArgumentNullException(nameof(app)); } - return app.UseMiddleware(); + return app.UseMiddleware(); } } } diff --git a/src/Middleware/RequestThrottling/src/RequestThrottlingMiddleware.cs b/src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterMiddleware.cs similarity index 85% rename from src/Middleware/RequestThrottling/src/RequestThrottlingMiddleware.cs rename to src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterMiddleware.cs index c9a56944af..f2c6cf821d 100644 --- a/src/Middleware/RequestThrottling/src/RequestThrottlingMiddleware.cs +++ b/src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterMiddleware.cs @@ -7,12 +7,12 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.RequestThrottling +namespace Microsoft.AspNetCore.ConcurrencyLimiter { /// /// Limits the number of concurrent requests allowed in the application. /// - public class RequestThrottlingMiddleware + public class ConcurrencyLimiterMiddleware { private readonly IQueuePolicy _queuePolicy; private readonly RequestDelegate _next; @@ -20,13 +20,13 @@ namespace Microsoft.AspNetCore.RequestThrottling private readonly ILogger _logger; /// - /// Creates a new . + /// Creates a new . /// /// The representing the next middleware in the pipeline. /// The used for logging. /// The queueing strategy to use for the server. /// The options for the middleware, currently containing the 'OnRejected' callback. - public RequestThrottlingMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, IQueuePolicy queue, IOptions options) + public ConcurrencyLimiterMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, IQueuePolicy queue, IOptions options) { if (options.Value.OnRejected == null) { @@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.RequestThrottling } _next = next; - _logger = loggerFactory.CreateLogger(); + _logger = loggerFactory.CreateLogger(); _onRejected = options.Value.OnRejected; _queuePolicy = queue; } @@ -50,11 +50,11 @@ namespace Microsoft.AspNetCore.RequestThrottling if (waitInQueueTask.IsCompleted) { - RequestThrottlingEventSource.Log.QueueSkipped(); + ConcurrencyLimiterEventSource.Log.QueueSkipped(); } else { - using (RequestThrottlingEventSource.Log.QueueTimer()) + using (ConcurrencyLimiterEventSource.Log.QueueTimer()) { await waitInQueueTask; } @@ -73,14 +73,14 @@ namespace Microsoft.AspNetCore.RequestThrottling } else { - RequestThrottlingEventSource.Log.RequestRejected(); - RequestThrottlingLog.RequestRejectedQueueFull(_logger); + ConcurrencyLimiterEventSource.Log.RequestRejected(); + ConcurrencyLimiterLog.RequestRejectedQueueFull(_logger); context.Response.StatusCode = StatusCodes.Status503ServiceUnavailable; await _onRejected(context); } } - private static class RequestThrottlingLog + private static class ConcurrencyLimiterLog { private static readonly Action _requestEnqueued = LoggerMessage.Define(LogLevel.Debug, new EventId(1, "RequestEnqueued"), "MaxConcurrentRequests limit reached, request has been queued. Current active requests: {ActiveRequests}."); diff --git a/src/Middleware/RequestThrottling/src/RequestThrottlingOptions.cs b/src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterOptions.cs similarity index 78% rename from src/Middleware/RequestThrottling/src/RequestThrottlingOptions.cs rename to src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterOptions.cs index 8efcc64ccf..429c6a4777 100644 --- a/src/Middleware/RequestThrottling/src/RequestThrottlingOptions.cs +++ b/src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterOptions.cs @@ -4,12 +4,12 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -namespace Microsoft.AspNetCore.RequestThrottling +namespace Microsoft.AspNetCore.ConcurrencyLimiter { /// - /// Specifies options for the . + /// Specifies options for the . /// - public class RequestThrottlingOptions + public class ConcurrencyLimiterOptions { /// /// A that handles requests rejected by this middleware. diff --git a/src/Middleware/RequestThrottling/src/Microsoft.AspNetCore.RequestThrottling.csproj b/src/Middleware/ConcurrencyLimiter/src/Microsoft.AspNetCore.ConcurrencyLimiter.csproj similarity index 100% rename from src/Middleware/RequestThrottling/src/Microsoft.AspNetCore.RequestThrottling.csproj rename to src/Middleware/ConcurrencyLimiter/src/Microsoft.AspNetCore.ConcurrencyLimiter.csproj diff --git a/src/Middleware/ConcurrencyLimiter/src/Properties/AssemblyInfo.cs b/src/Middleware/ConcurrencyLimiter/src/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..1a93825d99 --- /dev/null +++ b/src/Middleware/ConcurrencyLimiter/src/Properties/AssemblyInfo.cs @@ -0,0 +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.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.ConcurrencyLimiter.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Middleware/RequestThrottling/src/QueuePolicies/TailDropQueuePolicy.cs b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/FIFOQueuePolicy.cs similarity index 91% rename from src/Middleware/RequestThrottling/src/QueuePolicies/TailDropQueuePolicy.cs rename to src/Middleware/ConcurrencyLimiter/src/QueuePolicies/FIFOQueuePolicy.cs index 3a98fac973..addf7e263b 100644 --- a/src/Middleware/RequestThrottling/src/QueuePolicies/TailDropQueuePolicy.cs +++ b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/FIFOQueuePolicy.cs @@ -6,9 +6,9 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.RequestThrottling +namespace Microsoft.AspNetCore.ConcurrencyLimiter { - internal class TailDropQueuePolicy : IQueuePolicy, IDisposable + internal class FIFOQueuePolicy : IQueuePolicy, IDisposable { private readonly int _maxConcurrentRequests; private readonly int _requestQueueLimit; @@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.RequestThrottling private object _totalRequestsLock = new object(); public int TotalRequests { get; private set; } - public TailDropQueuePolicy(IOptions options) + public FIFOQueuePolicy(IOptions options) { _maxConcurrentRequests = options.Value.MaxConcurrentRequests; if (_maxConcurrentRequests <= 0) diff --git a/src/Middleware/RequestThrottling/src/QueuePolicies/IQueuePolicy.cs b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/IQueuePolicy.cs similarity index 90% rename from src/Middleware/RequestThrottling/src/QueuePolicies/IQueuePolicy.cs rename to src/Middleware/ConcurrencyLimiter/src/QueuePolicies/IQueuePolicy.cs index ebaa753ffb..e8e86d5c22 100644 --- a/src/Middleware/RequestThrottling/src/QueuePolicies/IQueuePolicy.cs +++ b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/IQueuePolicy.cs @@ -4,10 +4,10 @@ using System; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.RequestThrottling +namespace Microsoft.AspNetCore.ConcurrencyLimiter { /// - /// Queueing policies, meant to be used with the . + /// Queueing policies, meant to be used with the . /// public interface IQueuePolicy { diff --git a/src/Middleware/RequestThrottling/src/QueuePolicies/StackQueuePolicy.cs b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/LIFOQueuePolicy.cs similarity index 94% rename from src/Middleware/RequestThrottling/src/QueuePolicies/StackQueuePolicy.cs rename to src/Middleware/ConcurrencyLimiter/src/QueuePolicies/LIFOQueuePolicy.cs index b8b3feca63..122c87196e 100644 --- a/src/Middleware/RequestThrottling/src/QueuePolicies/StackQueuePolicy.cs +++ b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/LIFOQueuePolicy.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.RequestThrottling +namespace Microsoft.AspNetCore.ConcurrencyLimiter { - internal class StackQueuePolicy : IQueuePolicy + internal class LIFOQueuePolicy : IQueuePolicy { private readonly List> _buffer; private readonly int _maxQueueCapacity; @@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.RequestThrottling private int _freeServerSpots; - public StackQueuePolicy(IOptions options) + public LIFOQueuePolicy(IOptions options) { _buffer = new List>(); _maxQueueCapacity = options.Value.RequestQueueLimit; diff --git a/src/Middleware/RequestThrottling/src/QueuePolicies/QueuePolicyOptions.cs b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyOptions.cs similarity index 87% rename from src/Middleware/RequestThrottling/src/QueuePolicies/QueuePolicyOptions.cs rename to src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyOptions.cs index 1a36fcef64..53923ccd1b 100644 --- a/src/Middleware/RequestThrottling/src/QueuePolicies/QueuePolicyOptions.cs +++ b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyOptions.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.Text; -namespace Microsoft.AspNetCore.RequestThrottling +namespace Microsoft.AspNetCore.ConcurrencyLimiter { /// /// Specifies options for the @@ -19,6 +19,6 @@ namespace Microsoft.AspNetCore.RequestThrottling /// Maximum number of queued requests before the server starts rejecting connections with '503 Service Unavailible'. /// Defaults to 5000 queued requests. /// - public int RequestQueueLimit { get; set; } = 5000; + public int RequestQueueLimit { get; set; } } } diff --git a/src/Middleware/RequestThrottling/src/QueuePolicies/QueuePolicyServiceCollectionExtensions.cs b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyServiceCollectionExtensions.cs similarity index 80% rename from src/Middleware/RequestThrottling/src/QueuePolicies/QueuePolicyServiceCollectionExtensions.cs rename to src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyServiceCollectionExtensions.cs index c5ba0464b0..021ae8278a 100644 --- a/src/Middleware/RequestThrottling/src/QueuePolicies/QueuePolicyServiceCollectionExtensions.cs +++ b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyServiceCollectionExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.RequestThrottling; +using Microsoft.AspNetCore.ConcurrencyLimiter; namespace Microsoft.Extensions.DependencyInjection { @@ -12,7 +12,7 @@ namespace Microsoft.Extensions.DependencyInjection public static class QueuePolicyServiceCollectionExtensions { /// - /// Tells to use a FIFO queue as its queueing strategy. + /// Tells to use a FIFO queue as its queueing strategy. /// /// The to add services to. /// Set the options used by the queue. @@ -21,12 +21,12 @@ namespace Microsoft.Extensions.DependencyInjection public static IServiceCollection AddTailDropQueue(this IServiceCollection services, Action configure) { services.Configure(configure); - services.AddSingleton(); + services.AddSingleton(); return services; } /// - /// Tells to use a LIFO stack as its queueing strategy. + /// Tells to use a LIFO stack as its queueing strategy. /// /// The to add services to. /// Set the options used by the queue. @@ -35,7 +35,7 @@ namespace Microsoft.Extensions.DependencyInjection public static IServiceCollection AddStackQueue(this IServiceCollection services, Action configure) { services.Configure(configure); - services.AddSingleton(); + services.AddSingleton(); return services; } } diff --git a/src/Middleware/RequestThrottling/test/RequestThrottlingEventSourceTests.cs b/src/Middleware/ConcurrencyLimiter/test/ConcurrencyLimiterEventSourceTests.cs similarity index 85% rename from src/Middleware/RequestThrottling/test/RequestThrottlingEventSourceTests.cs rename to src/Middleware/ConcurrencyLimiter/test/ConcurrencyLimiterEventSourceTests.cs index 7725f6d7c4..9728d63b90 100644 --- a/src/Middleware/RequestThrottling/test/RequestThrottlingEventSourceTests.cs +++ b/src/Middleware/ConcurrencyLimiter/test/ConcurrencyLimiterEventSourceTests.cs @@ -9,17 +9,17 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Internal; using Xunit; -namespace Microsoft.AspNetCore.RequestThrottling.Tests +namespace Microsoft.AspNetCore.ConcurrencyLimiter.Tests { - public class RequestThrottlingEventSourceTests + public class ConcurrencyLimiterEventSourceTests { [Fact] public void MatchesNameAndGuid() { - var eventSource = new RequestThrottlingEventSource(); + var eventSource = new ConcurrencyLimiterEventSource(); - Assert.Equal("Microsoft.AspNetCore.RequestThrottling", eventSource.Name); - Assert.Equal(Guid.Parse("436f1cb1-8acc-56c0-86ec-e0832bd696ed"), eventSource.Guid); + Assert.Equal("Microsoft.AspNetCore.ConcurrencyLimiter", eventSource.Name); + Assert.Equal(Guid.Parse("a605548a-6963-55cf-f000-99a6013deb01"), eventSource.Guid); } [Fact] @@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests // Arrange var expectedId = 1; var eventListener = new TestEventListener(expectedId); - var eventSource = GetRequestThrottlingEventSource(); + var eventSource = GetConcurrencyLimiterEventSource(); eventListener.EnableEvents(eventSource, EventLevel.Informational); // Act @@ -54,7 +54,7 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests "requests-rejected", }); - using var eventSource = GetRequestThrottlingEventSource(); + using var eventSource = GetConcurrencyLimiterEventSource(); using var timeoutTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); @@ -95,7 +95,7 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests "requests-rejected", }); - using var eventSource = GetRequestThrottlingEventSource(); + using var eventSource = GetConcurrencyLimiterEventSource(); using var timeoutTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(5)); @@ -140,9 +140,9 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests return false; } - private static RequestThrottlingEventSource GetRequestThrottlingEventSource() + private static ConcurrencyLimiterEventSource GetConcurrencyLimiterEventSource() { - return new RequestThrottlingEventSource(Guid.NewGuid().ToString()); + return new ConcurrencyLimiterEventSource(Guid.NewGuid().ToString()); } } } diff --git a/src/Middleware/RequestThrottling/test/Microsoft.AspNetCore.RequestThrottling.Tests.csproj b/src/Middleware/ConcurrencyLimiter/test/Microsoft.AspNetCore.ConcurrencyLimiter.Tests.csproj similarity index 87% rename from src/Middleware/RequestThrottling/test/Microsoft.AspNetCore.RequestThrottling.Tests.csproj rename to src/Middleware/ConcurrencyLimiter/test/Microsoft.AspNetCore.ConcurrencyLimiter.Tests.csproj index 759af99f21..99bf7ae196 100644 --- a/src/Middleware/RequestThrottling/test/Microsoft.AspNetCore.RequestThrottling.Tests.csproj +++ b/src/Middleware/ConcurrencyLimiter/test/Microsoft.AspNetCore.ConcurrencyLimiter.Tests.csproj @@ -12,6 +12,6 @@ - + diff --git a/src/Middleware/RequestThrottling/test/MiddlewareTests.cs b/src/Middleware/ConcurrencyLimiter/test/MiddlewareTests.cs similarity index 99% rename from src/Middleware/RequestThrottling/test/MiddlewareTests.cs rename to src/Middleware/ConcurrencyLimiter/test/MiddlewareTests.cs index becace2358..b285ad518a 100644 --- a/src/Middleware/RequestThrottling/test/MiddlewareTests.cs +++ b/src/Middleware/ConcurrencyLimiter/test/MiddlewareTests.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Xunit; -namespace Microsoft.AspNetCore.RequestThrottling.Tests +namespace Microsoft.AspNetCore.ConcurrencyLimiter.Tests { public class MiddlewareTests { diff --git a/src/Middleware/RequestThrottling/test/PolicyTests/StackQueueTests.cs b/src/Middleware/ConcurrencyLimiter/test/PolicyTests/StackQueueTests.cs similarity index 84% rename from src/Middleware/RequestThrottling/test/PolicyTests/StackQueueTests.cs rename to src/Middleware/ConcurrencyLimiter/test/PolicyTests/StackQueueTests.cs index e109a08bbc..cce15aec2d 100644 --- a/src/Middleware/RequestThrottling/test/PolicyTests/StackQueueTests.cs +++ b/src/Middleware/ConcurrencyLimiter/test/PolicyTests/StackQueueTests.cs @@ -3,14 +3,14 @@ using System.Threading.Tasks; using Microsoft.Extensions.Options; using Xunit; -namespace Microsoft.AspNetCore.RequestThrottling.Tests.PolicyTests +namespace Microsoft.AspNetCore.ConcurrencyLimiter.Tests.PolicyTests { public static class StackQueueTests { [Fact] public static void BaseFunctionality() { - var stack = new StackQueuePolicy(Options.Create(new QueuePolicyOptions { + var stack = new LIFOQueuePolicy(Options.Create(new QueuePolicyOptions { MaxConcurrentRequests = 0, RequestQueueLimit = 2, })); @@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests.PolicyTests [Fact] public static void OldestRequestOverwritten() { - var stack = new StackQueuePolicy(Options.Create(new QueuePolicyOptions { + var stack = new LIFOQueuePolicy(Options.Create(new QueuePolicyOptions { MaxConcurrentRequests = 0, RequestQueueLimit = 3, })); @@ -49,7 +49,7 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests.PolicyTests [Fact] public static void RespectsMaxConcurrency() { - var stack = new StackQueuePolicy(Options.Create(new QueuePolicyOptions { + var stack = new LIFOQueuePolicy(Options.Create(new QueuePolicyOptions { MaxConcurrentRequests = 2, RequestQueueLimit = 2, })); @@ -67,7 +67,7 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests.PolicyTests [Fact] public static void ExitRequestsPreserveSemaphoreState() { - var stack = new StackQueuePolicy(Options.Create(new QueuePolicyOptions { + var stack = new LIFOQueuePolicy(Options.Create(new QueuePolicyOptions { MaxConcurrentRequests = 1, RequestQueueLimit = 2, })); @@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests.PolicyTests [Fact] public static void StaleRequestsAreProperlyOverwritten() { - var stack = new StackQueuePolicy(Options.Create(new QueuePolicyOptions + var stack = new LIFOQueuePolicy(Options.Create(new QueuePolicyOptions { MaxConcurrentRequests = 0, RequestQueueLimit = 4, @@ -108,7 +108,7 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests.PolicyTests [Fact] public static async Task OneTryEnterAsyncOneOnExit() { - var stack = new StackQueuePolicy(Options.Create(new QueuePolicyOptions + var stack = new LIFOQueuePolicy(Options.Create(new QueuePolicyOptions { MaxConcurrentRequests = 1, RequestQueueLimit = 4, diff --git a/src/Middleware/RequestThrottling/test/PolicyTests/TailDropTests.cs b/src/Middleware/ConcurrencyLimiter/test/PolicyTests/TailDropTests.cs similarity index 95% rename from src/Middleware/RequestThrottling/test/PolicyTests/TailDropTests.cs rename to src/Middleware/ConcurrencyLimiter/test/PolicyTests/TailDropTests.cs index 82ea4e2ceb..67b7880d77 100644 --- a/src/Middleware/RequestThrottling/test/PolicyTests/TailDropTests.cs +++ b/src/Middleware/ConcurrencyLimiter/test/PolicyTests/TailDropTests.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Internal; using Xunit; -namespace Microsoft.AspNetCore.RequestThrottling.Tests.PolicyTests +namespace Microsoft.AspNetCore.ConcurrencyLimiter.Tests.PolicyTests { public class TailDropTests { diff --git a/src/Middleware/RequestThrottling/test/TaskExtensions.cs b/src/Middleware/ConcurrencyLimiter/test/TaskExtensions.cs similarity index 100% rename from src/Middleware/RequestThrottling/test/TaskExtensions.cs rename to src/Middleware/ConcurrencyLimiter/test/TaskExtensions.cs diff --git a/src/Middleware/RequestThrottling/test/TestUtils.cs b/src/Middleware/ConcurrencyLimiter/test/TestUtils.cs similarity index 74% rename from src/Middleware/RequestThrottling/test/TestUtils.cs rename to src/Middleware/ConcurrencyLimiter/test/TestUtils.cs index 1b386d9cfe..5e2c0fdd78 100644 --- a/src/Middleware/RequestThrottling/test/TestUtils.cs +++ b/src/Middleware/ConcurrencyLimiter/test/TestUtils.cs @@ -8,18 +8,18 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.RequestThrottling.Tests +namespace Microsoft.AspNetCore.ConcurrencyLimiter.Tests { public static class TestUtils { - public static RequestThrottlingMiddleware CreateTestMiddleware(IQueuePolicy queue = null, RequestDelegate onRejected = null, RequestDelegate next = null) + public static ConcurrencyLimiterMiddleware CreateTestMiddleware(IQueuePolicy queue = null, RequestDelegate onRejected = null, RequestDelegate next = null) { - var options = Options.Create(new RequestThrottlingOptions + var options = Options.Create(new ConcurrencyLimiterOptions { OnRejected = onRejected ?? (context => Task.CompletedTask), }); - return new RequestThrottlingMiddleware( + return new ConcurrencyLimiterMiddleware( next: next ?? (context => Task.CompletedTask), loggerFactory: NullLoggerFactory.Instance, queue: queue ?? CreateTailDropQueue(1, 0), @@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests ); } - public static RequestThrottlingMiddleware CreateTestMiddleware_TailDrop(int maxConcurrentRequests, int requestQueueLimit, RequestDelegate onRejected = null, RequestDelegate next = null) + public static ConcurrencyLimiterMiddleware CreateTestMiddleware_TailDrop(int maxConcurrentRequests, int requestQueueLimit, RequestDelegate onRejected = null, RequestDelegate next = null) { return CreateTestMiddleware( queue: CreateTailDropQueue(maxConcurrentRequests, requestQueueLimit), @@ -36,7 +36,7 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests ); } - public static RequestThrottlingMiddleware CreateTestMiddleware_StackPolicy(int maxConcurrentRequests, int requestQueueLimit, RequestDelegate onRejected = null, RequestDelegate next = null) + public static ConcurrencyLimiterMiddleware CreateTestMiddleware_StackPolicy(int maxConcurrentRequests, int requestQueueLimit, RequestDelegate onRejected = null, RequestDelegate next = null) { return CreateTestMiddleware( queue: CreateStackPolicy(maxConcurrentRequests, requestQueueLimit), @@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests ); } - internal static StackQueuePolicy CreateStackPolicy(int maxConcurrentRequests, int requestsQueuelimit = 100) + internal static LIFOQueuePolicy CreateStackPolicy(int maxConcurrentRequests, int requestsQueuelimit = 100) { var options = Options.Create(new QueuePolicyOptions { @@ -53,10 +53,10 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests RequestQueueLimit = requestsQueuelimit }); - return new StackQueuePolicy(options); + return new LIFOQueuePolicy(options); } - internal static TailDropQueuePolicy CreateTailDropQueue(int maxConcurrentRequests, int requestQueueLimit = 100) + internal static FIFOQueuePolicy CreateTailDropQueue(int maxConcurrentRequests, int requestQueueLimit = 100) { var options = Options.Create(new QueuePolicyOptions { @@ -64,7 +64,7 @@ namespace Microsoft.AspNetCore.RequestThrottling.Tests RequestQueueLimit = requestQueueLimit }); - return new TailDropQueuePolicy(options); + return new FIFOQueuePolicy(options); } } diff --git a/src/Middleware/Middleware.sln b/src/Middleware/Middleware.sln index aa94cdf17f..f62cfabeb6 100644 --- a/src/Middleware/Middleware.sln +++ b/src/Middleware/Middleware.sln @@ -277,19 +277,19 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HeaderPropagationSample", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Server.IIS", "..\Servers\IIS\IIS\src\Microsoft.AspNetCore.Server.IIS.csproj", "{B9BE1823-B555-4AAB-AEBC-C8C3F48C8861}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RequestThrottling", "RequestThrottling", "{8C9AA8A2-9D1F-4450-9F8D-56BAB6F3D343}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ConcurrencyLimiter", "ConcurrencyLimiter", "{8C9AA8A2-9D1F-4450-9F8D-56BAB6F3D343}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RequestThrottlingSample", "RequestThrottling\sample\RequestThrottlingSample.csproj", "{6720919C-0DEA-49E1-90DC-F1883F7919CD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConcurrencyLimiterSample", "ConcurrencyLimiter\sample\ConcurrencyLimiterSample.csproj", "{6720919C-0DEA-49E1-90DC-F1883F7919CD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.RequestThrottling", "RequestThrottling\src\Microsoft.AspNetCore.RequestThrottling.csproj", "{4CE2384D-6B88-4824-ADD1-4183D180FEFF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.ConcurrencyLimiter", "ConcurrencyLimiter\src\Microsoft.AspNetCore.ConcurrencyLimiter.csproj", "{4CE2384D-6B88-4824-ADD1-4183D180FEFF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.RequestThrottling.Tests", "RequestThrottling\test\Microsoft.AspNetCore.RequestThrottling.Tests.csproj", "{353AA2B0-1013-486C-B5BD-9379385CA403}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.ConcurrencyLimiter.Tests", "ConcurrencyLimiter\test\Microsoft.AspNetCore.ConcurrencyLimiter.Tests.csproj", "{353AA2B0-1013-486C-B5BD-9379385CA403}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Metadata", "..\Http\Metadata\src\Microsoft.AspNetCore.Metadata.csproj", "{7E2EA6E2-31FE-418A-9AE4-955A4C708AE7}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Authorization", "..\Security\Authorization\Core\src\Microsoft.AspNetCore.Authorization.csproj", "{CDDD7C43-5BEB-4E3E-8A59-FCDC83C9FBCF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.RequestThrottling.Microbenchmarks", "RequestThrottling\perf\Microbenchmarks\Microsoft.AspNetCore.RequestThrottling.Microbenchmarks.csproj", "{737B26B4-CFC6-4B44-9070-DD36334E85B3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks", "ConcurrencyLimiter\perf\Microbenchmarks\Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks.csproj", "{737B26B4-CFC6-4B44-9070-DD36334E85B3}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestDestination", "CORS\test\testassets\TestDestination\TestDestination.csproj", "{DFEB537A-2D35-4C62-8A13-42798DF66A80}" EndProject diff --git a/src/Middleware/RequestThrottling/sample/Startup.cs b/src/Middleware/RequestThrottling/sample/Startup.cs deleted file mode 100644 index 846a7cc186..0000000000 --- a/src/Middleware/RequestThrottling/sample/Startup.cs +++ /dev/null @@ -1,66 +0,0 @@ -// 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.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; - -namespace RequestThrottlingSample -{ - public class Startup - { - static IConfiguration _config; - - // This method gets called by the runtime. Use this method to add services to the container. - // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 - public void ConfigureServices(IServiceCollection services) - { - services.AddStackQueue((options) => - { - options.MaxConcurrentRequests = Math.Max(1, _config.GetValue("maxConcurrent")); - options.RequestQueueLimit = Math.Max(1, _config.GetValue("maxQueue")); - }); - - services.AddLogging(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - app.UseRequestThrottling(); - app.Run(async context => - { - await context.Response.WriteAsync("Hello Request Throttling! If you rapidly refresh this page, it will 503."); - await Task.Delay(400); - }); - } - - // Entry point for the application. - public static void Main(string[] args) - { - _config = new ConfigurationBuilder() - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .AddCommandLine(args) - .Build(); - - var host = new WebHostBuilder() - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) // for the cert file - .ConfigureLogging(factory => - { - factory.SetMinimumLevel(LogLevel.Debug); - factory.AddConsole(); - }) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/Middleware/RequestThrottling/src/Properties/AssemblyInfo.cs b/src/Middleware/RequestThrottling/src/Properties/AssemblyInfo.cs deleted file mode 100644 index 1dcaedfaa6..0000000000 --- a/src/Middleware/RequestThrottling/src/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// 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.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Microsoft.AspNetCore.RequestThrottling.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] From 5712263ddaa0d0f849ec727a58da82cb8be23de2 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Sat, 13 Jul 2019 11:05:28 -0700 Subject: [PATCH 11/76] Re-pin EF dependencies (#12132) - not shipping this time around - bump a few versions to match newer 'release/2.1' dependencies - System.Diagnostics.DiagnosticSource - System.Security.Principal.Windows - System.Threading.Tasks.Extensions (will bump this again in 'release/2.1') --- build/dependencies.props | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 5f51ce3667..574bb8be33 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -6,15 +6,6 @@ 2.2.6 - - 2.2.6 - 2.2.6 - 2.2.6 - 2.2.6 - 2.2.6 - 2.2.6 - - @@ -102,6 +93,12 @@ 0.6.0-rtm-final 2.2.0-rtm-35687 + 2.2.6 + 2.2.6 + 2.2.6 + 2.2.6 + 2.2.6 + 2.2.6 0.9.9 @@ -220,7 +217,7 @@ 1.5.0 4.5.0 4.6.1 - 4.5.0 + 4.5.1 4.5.0 5.3.0 3.2.0 @@ -231,18 +228,18 @@ 4.5.0 3.1.1 4.3.0 - 4.5.2 1.6.0 + 4.5.2 4.3.0 4.5.0 4.5.0 4.5.0 - 4.5.0 + 4.5.1 4.5.0 4.5.0 4.5.0 4.9.0 - 4.5.1 + 4.5.3 4.5.0 4.5.3 1.3.7 From c5cf99f6a24d9da3468989fefdff9036aac5bd4e Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Thu, 4 Jul 2019 17:31:19 -0700 Subject: [PATCH 12/76] Add APIs for conversions This change adds API surface for performing type conversions in the same way that `@bind` will perform them. This allows us to centralize these implementations where it makes sense (form controls). More critically we need to present a uniform API surface for the compiler to use in code generation for converting values to strings using the appropriate culture. Surfacing an API for this and using it from the compiler is the missing piece for `@bind` and globalization (number, date). --- ...ft.AspNetCore.Components.netstandard2.0.cs | 47 + .../Components/src/BindConverter.cs | 1418 +++++++++++++++++ .../EventCallbackFactoryBinderExtensions.cs | 564 +------ .../Forms/InputComponents/InputCheckbox.cs | 2 +- .../src/Forms/InputComponents/InputDate.cs | 10 +- .../src/Forms/InputComponents/InputNumber.cs | 119 +- .../src/Forms/InputComponents/InputSelect.cs | 11 +- .../src/Forms/InputComponents/InputText.cs | 2 +- .../Forms/InputComponents/InputTextArea.cs | 2 +- .../Components/test/BindConverterTest.cs | 307 ++++ 10 files changed, 1808 insertions(+), 674 deletions(-) create mode 100644 src/Components/Components/src/BindConverter.cs create mode 100644 src/Components/Components/test/BindConverterTest.cs diff --git a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs index 9405897b79..f7a8157984 100644 --- a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs +++ b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs @@ -25,6 +25,53 @@ namespace Microsoft.AspNetCore.Components public static partial class BindAttributes { } + public static partial class BindConverter + { + public static bool FormatValue(bool value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(System.DateTime value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(System.DateTime value, string format, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(System.DateTimeOffset value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(System.DateTimeOffset value, string format, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(decimal value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(double value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(int value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(long value, System.Globalization.CultureInfo culture = null) { throw null; } + public static bool? FormatValue(bool? value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(System.DateTimeOffset? value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(System.DateTimeOffset? value, string format, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(System.DateTime? value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(System.DateTime? value, string format, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(decimal? value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(double? value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(int? value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(long? value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(float? value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(float value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(string value, System.Globalization.CultureInfo culture = null) { throw null; } + public static object FormatValue(T value, System.Globalization.CultureInfo culture = null) { throw null; } + public static bool TryConvertToBool(object obj, System.Globalization.CultureInfo culture, out bool value) { throw null; } + public static bool TryConvertToDateTime(object obj, System.Globalization.CultureInfo culture, out System.DateTime value) { throw null; } + public static bool TryConvertToDateTime(object obj, System.Globalization.CultureInfo culture, string format, out System.DateTime value) { throw null; } + public static bool TryConvertToDateTimeOffset(object obj, System.Globalization.CultureInfo culture, out System.DateTimeOffset value) { throw null; } + public static bool TryConvertToDateTimeOffset(object obj, System.Globalization.CultureInfo culture, string format, out System.DateTimeOffset value) { throw null; } + public static bool TryConvertToDecimal(object obj, System.Globalization.CultureInfo culture, out decimal value) { throw null; } + public static bool TryConvertToDouble(object obj, System.Globalization.CultureInfo culture, out double value) { throw null; } + public static bool TryConvertToFloat(object obj, System.Globalization.CultureInfo culture, out float value) { throw null; } + public static bool TryConvertToInt(object obj, System.Globalization.CultureInfo culture, out int value) { throw null; } + public static bool TryConvertToLong(object obj, System.Globalization.CultureInfo culture, out long value) { throw null; } + public static bool TryConvertToNullableBool(object obj, System.Globalization.CultureInfo culture, out bool? value) { throw null; } + public static bool TryConvertToNullableDateTime(object obj, System.Globalization.CultureInfo culture, out System.DateTime? value) { throw null; } + public static bool TryConvertToNullableDateTime(object obj, System.Globalization.CultureInfo culture, string format, out System.DateTime? value) { throw null; } + public static bool TryConvertToNullableDateTimeOffset(object obj, System.Globalization.CultureInfo culture, out System.DateTimeOffset? value) { throw null; } + public static bool TryConvertToNullableDateTimeOffset(object obj, System.Globalization.CultureInfo culture, string format, out System.DateTimeOffset? value) { throw null; } + public static bool TryConvertToNullableDecimal(object obj, System.Globalization.CultureInfo culture, out decimal? value) { throw null; } + public static bool TryConvertToNullableDouble(object obj, System.Globalization.CultureInfo culture, out double? value) { throw null; } + public static bool TryConvertToNullableFloat(object obj, System.Globalization.CultureInfo culture, out float? value) { throw null; } + public static bool TryConvertToNullableInt(object obj, System.Globalization.CultureInfo culture, out int? value) { throw null; } + public static bool TryConvertToNullableLong(object obj, System.Globalization.CultureInfo culture, out long? value) { throw null; } + public static bool TryConvertToString(object obj, System.Globalization.CultureInfo culture, out string value) { throw null; } + public static bool TryConvertTo(object obj, System.Globalization.CultureInfo culture, out T value) { throw null; } + } [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)] public sealed partial class BindElementAttribute : System.Attribute { diff --git a/src/Components/Components/src/BindConverter.cs b/src/Components/Components/src/BindConverter.cs new file mode 100644 index 0000000000..f77689bde2 --- /dev/null +++ b/src/Components/Components/src/BindConverter.cs @@ -0,0 +1,1418 @@ +// 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.Concurrent; +using System.ComponentModel; +using System.Globalization; +using System.Reflection; + +namespace Microsoft.AspNetCore.Components +{ + /// + /// Performs conversions during binding. + /// + // + // Perf: our conversion routines present a regular API surface that allows us to specialize on types to avoid boxing. + // for instance, many of these types could be cast to IFormattable to do the appropriate formatting, but that's going + // to allocate. + public static class BindConverter + { + private static object BoxedTrue = true; + private static object BoxedFalse = false; + + private delegate object BindFormatter(T value, CultureInfo culture); + private delegate object BindFormatterWithFormat(T value, CultureInfo culture, string format); + + internal delegate bool BindParser(object obj, CultureInfo culture, out T value); + internal delegate bool BindParserWithFormat(object obj, CultureInfo culture, string format, out T value); + + /// + /// Formats the provided as a . + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(string value, CultureInfo culture = null) => FormatStringValueCore(value, culture); + + private static string FormatStringValueCore(string value, CultureInfo culture) + { + return value; + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static bool FormatValue(bool value, CultureInfo culture = null) + { + // Formatting for bool is special-cased. We need to produce a boolean value for conditional attributes + // to work. + return value; + } + + // Used with generics + private static object FormatBoolValueCore(bool value, CultureInfo culture) + { + // Formatting for bool is special-cased. We need to produce a boolean value for conditional attributes + // to work. + return value ? BoxedTrue : BoxedFalse; + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static bool? FormatValue(bool? value, CultureInfo culture = null) + { + // Formatting for bool is special-cased. We need to produce a boolean value for conditional attributes + // to work. + return value == null ? (bool?)null : value.Value; + } + + // Used with generics + private static object FormatNullableBoolValueCore(bool? value, CultureInfo culture) + { + // Formatting for bool is special-cased. We need to produce a boolean value for conditional attributes + // to work. + return value == null ? null : value.Value ? BoxedTrue : BoxedFalse; + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(int value, CultureInfo culture = null) => FormatIntValueCore(value, culture); + + private static string FormatIntValueCore(int value, CultureInfo culture) + { + return value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(int? value, CultureInfo culture = null) => FormatNullableIntValueCore(value, culture); + + private static string FormatNullableIntValueCore(int? value, CultureInfo culture) + { + if (value == null) + { + return null; + } + + return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(long value, CultureInfo culture = null) => FormatLongValueCore(value, culture); + + private static string FormatLongValueCore(long value, CultureInfo culture) + { + return value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(long? value, CultureInfo culture = null) => FormatNullableLongValueCore(value, culture); + + private static string FormatNullableLongValueCore(long? value, CultureInfo culture) + { + if (value == null) + { + return null; + } + + return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(float value, CultureInfo culture = null) => FormatFloatValueCore(value, culture); + + private static string FormatFloatValueCore(float value, CultureInfo culture) + { + return value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(float? value, CultureInfo culture = null) => FormatNullableFloatValueCore(value, culture); + + private static string FormatNullableFloatValueCore(float? value, CultureInfo culture) + { + if (value == null) + { + return null; + } + + return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(double value, CultureInfo culture = null) => FormatDoubleValueCore(value, culture); + + private static string FormatDoubleValueCore(double value, CultureInfo culture) + { + return value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(double? value, CultureInfo culture = null) => FormatNullableDoubleValueCore(value, culture); + + private static string FormatNullableDoubleValueCore(double? value, CultureInfo culture) + { + if (value == null) + { + return null; + } + + return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(decimal value, CultureInfo culture = null) => FormatDecimalValueCore(value, culture); + + private static string FormatDecimalValueCore(decimal value, CultureInfo culture) + { + return value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided as a . + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(decimal? value, CultureInfo culture = null) => FormatNullableDecimalValueCore(value, culture); + + private static string FormatNullableDecimalValueCore(decimal? value, CultureInfo culture) + { + if (value == null) + { + return null; + } + + return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided as a . + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(DateTime value, CultureInfo culture = null) => FormatDateTimeValueCore(value, format: null, culture); + + /// + /// Formats the provided as a . + /// + /// The value to format. + /// The format to use. Provided to . + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(DateTime value, string format, CultureInfo culture = null) => FormatDateTimeValueCore(value, format, culture); + + private static string FormatDateTimeValueCore(DateTime value, string format, CultureInfo culture) + { + if (format != null) + { + return value.ToString(format, culture ?? CultureInfo.CurrentCulture); + } + + return value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + private static string FormatDateTimeValueCore(DateTime value, CultureInfo culture) + { + return value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided as a . + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(DateTime? value, CultureInfo culture = null) => FormatNullableDateTimeValueCore(value, format: null, culture); + + /// + /// Formats the provided as a . + /// + /// The value to format. + /// The format to use. Provided to . + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(DateTime? value, string format, CultureInfo culture = null) => FormatNullableDateTimeValueCore(value, format, culture); + + private static string FormatNullableDateTimeValueCore(DateTime? value, string format, CultureInfo culture) + { + if (value == null) + { + return null; + } + + if (format != null) + { + return value.Value.ToString(format, culture ?? CultureInfo.CurrentCulture); + } + + return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + private static string FormatNullableDateTimeValueCore(DateTime? value, CultureInfo culture) + { + if (value == null) + { + return null; + } + + return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided as a . + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(DateTimeOffset value, CultureInfo culture = null) => FormatDateTimeOffsetValueCore(value, format: null, culture); + + + /// + /// Formats the provided as a . + /// + /// The value to format. + /// The format to use. Provided to . + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(DateTimeOffset value, string format, CultureInfo culture = null) => FormatDateTimeOffsetValueCore(value, format, culture); + + private static string FormatDateTimeOffsetValueCore(DateTimeOffset value, string format, CultureInfo culture) + { + if (format != null) + { + return value.ToString(format, culture ?? CultureInfo.CurrentCulture); + } + + return value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + private static string FormatDateTimeOffsetValueCore(DateTimeOffset value, CultureInfo culture) + { + return value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided as a . + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(DateTimeOffset? value, CultureInfo culture = null) => FormatNullableDateTimeOffsetValueCore(value, format: null, culture); + + /// + /// Formats the provided as a . + /// + /// The value to format. + /// The format to use. Provided to . + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(DateTimeOffset? value, string format, CultureInfo culture = null) => FormatNullableDateTimeOffsetValueCore(value, format, culture); + + private static string FormatNullableDateTimeOffsetValueCore(DateTimeOffset? value, string format, CultureInfo culture) + { + if (value == null) + { + return null; + } + + if (format != null) + { + return value.Value.ToString(format, culture ?? CultureInfo.CurrentCulture); + } + + return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + private static string FormatNullableDateTimeOffsetValueCore(DateTimeOffset? value, CultureInfo culture) + { + if (value == null) + { + return null; + } + + return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + private static string FormatEnumValueCore(T value, CultureInfo culture) where T : struct, Enum + { + return value.ToString(); // The overload that acccepts a culture is [Obsolete] + } + + private static string FormatNullableEnumValueCore(T? value, CultureInfo culture) where T : struct, Enum + { + if (value == null) + { + return null; + } + + return value.Value.ToString(); // The overload that acccepts a culture is [Obsolete] + } + + /// + /// Formats the provided as a . + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static object FormatValue(T value, CultureInfo culture = null) + { + var formatter = FormatterDelegateCache.Get(); + return formatter(value, culture); + } + + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToString(object obj, CultureInfo culture, out string value) + { + return ConvertToStringCore(obj, culture, out value); + } + + internal readonly static BindParser ConvertToString = ConvertToStringCore; + + private static bool ConvertToStringCore(object obj, CultureInfo culture, out string value) + { + // We expect the input to already be a string. + value = (string)obj; + return true; + } + + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToBool(object obj, CultureInfo culture, out bool value) + { + return ConvertToBoolCore(obj, culture, out value); + } + + /// + /// Attempts to convert a value to a nullable . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToNullableBool(object obj, CultureInfo culture, out bool? value) + { + return ConvertToNullableBoolCore(obj, culture, out value); + } + + internal static BindParser ConvertToBool = ConvertToBoolCore; + internal static BindParser ConvertToNullableBool = ConvertToNullableBoolCore; + + private static bool ConvertToBoolCore(object obj, CultureInfo culture, out bool value) + { + // We expect the input to already be a bool. + value = (bool)obj; + return true; + } + + private static bool ConvertToNullableBoolCore(object obj, CultureInfo culture, out bool? value) + { + // We expect the input to already be a bool. + value = (bool?)obj; + return true; + } + + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToInt(object obj, CultureInfo culture, out int value) + { + return ConvertToIntCore(obj, culture, out value); + } + + /// + /// Attempts to convert a value to a nullable . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToNullableInt(object obj, CultureInfo culture, out int? value) + { + return ConvertToNullableIntCore(obj, culture, out value); + } + + internal static BindParser ConvertToInt = ConvertToIntCore; + internal static BindParser ConvertToNullableInt = ConvertToNullableIntCore; + + private static bool ConvertToIntCore(object obj, CultureInfo culture, out int value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return false; + } + + if (!int.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + private static bool ConvertToNullableIntCore(object obj, CultureInfo culture, out int? value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return true; + } + + if (!int.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToLong(object obj, CultureInfo culture, out long value) + { + return ConvertToLongCore(obj, culture, out value); + } + + /// + /// Attempts to convert a value to a nullable . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToNullableLong(object obj, CultureInfo culture, out long? value) + { + return ConvertToNullableLongCore(obj, culture, out value); + } + + internal static BindParser ConvertToLong = ConvertToLongCore; + internal static BindParser ConvertToNullableLong = ConvertToNullableLongCore; + + private static bool ConvertToLongCore(object obj, CultureInfo culture, out long value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return false; + } + + if (!long.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + private static bool ConvertToNullableLongCore(object obj, CultureInfo culture, out long? value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return true; + } + + if (!long.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToFloat(object obj, CultureInfo culture, out float value) + { + return ConvertToFloatCore(obj, culture, out value); + } + + /// + /// Attempts to convert a value to a nullable . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToNullableFloat(object obj, CultureInfo culture, out float? value) + { + return ConvertToNullableFloatCore(obj, culture, out value); + } + + internal static BindParser ConvertToFloat = ConvertToFloatCore; + internal static BindParser ConvertToNullableFloat = ConvertToNullableFloatCore; + + private static bool ConvertToFloatCore(object obj, CultureInfo culture, out float value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return false; + } + + if (!float.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + if (float.IsInfinity(converted) || float.IsNaN(converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + private static bool ConvertToNullableFloatCore(object obj, CultureInfo culture, out float? value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return true; + } + + if (!float.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + if (float.IsInfinity(converted) || float.IsNaN(converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToDouble(object obj, CultureInfo culture, out double value) + { + return ConvertToDoubleCore(obj, culture, out value); + } + + /// + /// Attempts to convert a value to a nullable . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToNullableDouble(object obj, CultureInfo culture, out double? value) + { + return ConvertToNullableDoubleCore(obj, culture, out value); + } + + internal static BindParser ConvertToDoubleDelegate = ConvertToDoubleCore; + internal static BindParser ConvertToNullableDoubleDelegate = ConvertToNullableDoubleCore; + + private static bool ConvertToDoubleCore(object obj, CultureInfo culture, out double value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return false; + } + + if (!double.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + if (double.IsInfinity(converted) || double.IsNaN(converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + private static bool ConvertToNullableDoubleCore(object obj, CultureInfo culture, out double? value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return true; + } + + if (!double.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + if (double.IsInfinity(converted) || double.IsNaN(converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToDecimal(object obj, CultureInfo culture, out decimal value) + { + return ConvertToDecimalCore(obj, culture, out value); + } + + /// + /// Attempts to convert a value to a nullable . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToNullableDecimal(object obj, CultureInfo culture, out decimal? value) + { + return ConvertToNullableDecimalCore(obj, culture, out value); + } + + internal static BindParser ConvertToDecimal = ConvertToDecimalCore; + internal static BindParser ConvertToNullableDecimal = ConvertToNullableDecimalCore; + + private static bool ConvertToDecimalCore(object obj, CultureInfo culture, out decimal value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return false; + } + + if (!decimal.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + private static bool ConvertToNullableDecimalCore(object obj, CultureInfo culture, out decimal? value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return true; + } + + if (!decimal.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToDateTime(object obj, CultureInfo culture, out DateTime value) + { + return ConvertToDateTimeCore(obj, culture, out value); + } + + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The format string to use in conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToDateTime(object obj, CultureInfo culture, string format, out DateTime value) + { + return ConvertToDateTimeCore(obj, culture, format, out value); + } + + /// + /// Attempts to convert a value to a nullable . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToNullableDateTime(object obj, CultureInfo culture, out DateTime? value) + { + return ConvertToNullableDateTimeCore(obj, culture, out value); + } + + /// + /// Attempts to convert a value to a nullable . + /// + /// The object to convert. + /// The to use for conversion. + /// The format string to use in conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToNullableDateTime(object obj, CultureInfo culture, string format, out DateTime? value) + { + return ConvertToNullableDateTimeCore(obj, culture, format, out value); + } + + internal static BindParser ConvertToDateTime = ConvertToDateTimeCore; + internal static BindParserWithFormat ConvertToDateTimeWithFormat = ConvertToDateTimeCore; + internal static BindParser ConvertToNullableDateTime = ConvertToNullableDateTimeCore; + internal static BindParserWithFormat ConvertToNullableDateTimeWithFormat = ConvertToNullableDateTimeCore; + + private static bool ConvertToDateTimeCore(object obj, CultureInfo culture, out DateTime value) + { + return ConvertToDateTimeCore(obj, culture, format: null, out value); + } + + private static bool ConvertToDateTimeCore(object obj, CultureInfo culture, string format, out DateTime value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return false; + } + + if (format != null && DateTime.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted)) + { + value = converted; + return true; + } + else if (format == null && DateTime.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted)) + { + value = converted; + return true; + } + + value = default; + return false; + } + + private static bool ConvertToNullableDateTimeCore(object obj, CultureInfo culture, out DateTime? value) + { + return ConvertToNullableDateTimeCore(obj, culture, format: null, out value); + } + + private static bool ConvertToNullableDateTimeCore(object obj, CultureInfo culture, string format, out DateTime? value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return true; + } + + if (format != null && DateTime.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted)) + { + value = converted; + return true; + } + else if (format == null && DateTime.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted)) + { + value = converted; + return true; + } + + value = default; + return false; + } + + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToDateTimeOffset(object obj, CultureInfo culture, out DateTimeOffset value) + { + return ConvertToDateTimeOffsetCore(obj, culture, out value); + } + + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The format string to use in conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToDateTimeOffset(object obj, CultureInfo culture, string format, out DateTimeOffset value) + { + return ConvertToDateTimeOffsetCore(obj, culture, format, out value); + } + + /// + /// Attempts to convert a value to a nullable . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToNullableDateTimeOffset(object obj, CultureInfo culture, out DateTimeOffset? value) + { + return ConvertToNullableDateTimeOffsetCore(obj, culture, out value); + } + + /// + /// Attempts to convert a value to a nullable . + /// + /// The object to convert. + /// The to use for conversion. + /// The format string to use in conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToNullableDateTimeOffset(object obj, CultureInfo culture, string format, out DateTimeOffset? value) + { + return ConvertToNullableDateTimeOffsetCore(obj, culture, format, out value); + } + + internal static BindParser ConvertToDateTimeOffset = ConvertToDateTimeOffsetCore; + internal static BindParserWithFormat ConvertToDateTimeOffsetWithFormat = ConvertToDateTimeOffsetCore; + internal static BindParser ConvertToNullableDateTimeOffset = ConvertToNullableDateTimeOffsetCore; + internal static BindParserWithFormat ConvertToNullableDateTimeOffsetWithFormat = ConvertToNullableDateTimeOffsetCore; + + private static bool ConvertToDateTimeOffsetCore(object obj, CultureInfo culture, out DateTimeOffset value) + { + return ConvertToDateTimeOffsetCore(obj, culture, format: null, out value); + } + + private static bool ConvertToDateTimeOffsetCore(object obj, CultureInfo culture, string format, out DateTimeOffset value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return false; + } + + if (format != null && DateTimeOffset.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted)) + { + value = converted; + return true; + } + else if (format == null && DateTimeOffset.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted)) + { + value = converted; + return true; + } + + value = default; + return false; + } + + private static bool ConvertToNullableDateTimeOffsetCore(object obj, CultureInfo culture, out DateTimeOffset? value) + { + return ConvertToNullableDateTimeOffsetCore(obj, culture, format: null, out value); + } + + private static bool ConvertToNullableDateTimeOffsetCore(object obj, CultureInfo culture, string format, out DateTimeOffset? value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return true; + } + + if (format != null && DateTimeOffset.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted)) + { + value = converted; + return true; + } + else if (format == null && DateTimeOffset.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted)) + { + value = converted; + return true; + } + + value = default; + return false; + } + + private static bool ConvertToEnum(object obj, CultureInfo culture, out T value) where T : struct, Enum + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return true; + } + + if (!Enum.TryParse(text, out var converted)) + { + value = default; + return false; + } + + if (!Enum.IsDefined(typeof(T), converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + private static bool ConvertToNullableEnum(object obj, CultureInfo culture, out T? value) where T : struct, Enum + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return true; + } + + if (!Enum.TryParse(text, out var converted)) + { + value = default; + return false; + } + + if (!Enum.IsDefined(typeof(T), converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + /// + /// Attempts to convert a value to a value of type . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertTo(object obj, CultureInfo culture, out T value) + { + var converter = ParserDelegateCache.Get(); + return converter(obj, culture, out value); + } + + private static class FormatterDelegateCache + { + private readonly static ConcurrentDictionary _cache = new ConcurrentDictionary(); + + private static MethodInfo _formatEnumValue; + private static MethodInfo _formatNullableEnumValue; + + public static BindFormatter Get() + { + if (!_cache.TryGetValue(typeof(T), out var formattter)) + { + // We need to replicate all of the primitive cases that we handle here so that they will behave the same way. + // The result will be cached. + if (typeof(T) == typeof(string)) + { + formattter = (BindFormatter)FormatStringValueCore; + } + else if (typeof(T) == typeof(bool)) + { + formattter = (BindFormatter)FormatBoolValueCore; + } + else if (typeof(T) == typeof(bool?)) + { + formattter = (BindFormatter)FormatNullableBoolValueCore; + } + else if (typeof(T) == typeof(int)) + { + formattter = (BindFormatter)FormatIntValueCore; + } + else if (typeof(T) == typeof(int?)) + { + formattter = (BindFormatter)FormatNullableIntValueCore; + } + else if (typeof(T) == typeof(long)) + { + formattter = (BindFormatter)FormatLongValueCore; + } + else if (typeof(T) == typeof(long?)) + { + formattter = (BindFormatter)FormatNullableLongValueCore; + } + else if (typeof(T) == typeof(float)) + { + formattter = (BindFormatter)FormatFloatValueCore; + } + else if (typeof(T) == typeof(float?)) + { + formattter = (BindFormatter)FormatNullableFloatValueCore; + } + else if (typeof(T) == typeof(double)) + { + formattter = (BindFormatter)FormatDoubleValueCore; + } + else if (typeof(T) == typeof(double?)) + { + formattter = (BindFormatter)FormatNullableDoubleValueCore; + } + else if (typeof(T) == typeof(decimal)) + { + formattter = (BindFormatter)FormatDecimalValueCore; + } + else if (typeof(T) == typeof(decimal?)) + { + formattter = (BindFormatter)FormatNullableDecimalValueCore; + } + else if (typeof(T) == typeof(DateTime)) + { + formattter = (BindFormatter)FormatDateTimeValueCore; + } + else if (typeof(T) == typeof(DateTime?)) + { + formattter = (BindFormatter)FormatNullableDateTimeValueCore; + } + else if (typeof(T) == typeof(DateTimeOffset)) + { + formattter = (BindFormatter)FormatDateTimeOffsetValueCore; + } + else if (typeof(T) == typeof(DateTimeOffset?)) + { + formattter = (BindFormatter)FormatNullableDateTimeOffsetValueCore; + } + else if (typeof(T).IsEnum) + { + // We have to deal invoke this dynamically to work around the type constraint on Enum.TryParse. + var method = _formatEnumValue ??= typeof(BindConverter).GetMethod(nameof(FormatEnumValueCore), BindingFlags.NonPublic | BindingFlags.Static); + formattter = method.MakeGenericMethod(typeof(T)).CreateDelegate(typeof(BindFormatter), target: null); + } + else if (Nullable.GetUnderlyingType(typeof(T)) is Type innerType && innerType.IsEnum) + { + // We have to deal invoke this dynamically to work around the type constraint on Enum.TryParse. + var method = _formatNullableEnumValue ??= typeof(BindConverter).GetMethod(nameof(FormatNullableEnumValueCore), BindingFlags.NonPublic | BindingFlags.Static); + formattter = method.MakeGenericMethod(innerType).CreateDelegate(typeof(BindFormatter), target: null); + } + else + { + formattter = MakeTypeConverterFormatter(); + } + + _cache.TryAdd(typeof(T), formattter); + } + + return (BindFormatter)formattter; + } + + private static BindFormatter MakeTypeConverterFormatter() + { + var typeConverter = TypeDescriptor.GetConverter(typeof(T)); + if (typeConverter == null || !typeConverter.CanConvertTo(typeof(string))) + { + throw new InvalidOperationException( + $"The type '{typeof(T).FullName}' does not have an associated {typeof(TypeConverter).Name} that supports " + + $"conversion to a string. " + + $"Apply '{typeof(TypeConverterAttribute).Name}' to the type to register a converter."); + } + + return FormatWithTypeConverter; + + string FormatWithTypeConverter(T value, CultureInfo culture) + { + // We intentionally close-over the TypeConverter to cache it. The TypeDescriptor infrastructure is slow. + return typeConverter.ConvertToString(context: null, culture ?? CultureInfo.CurrentCulture, value); + } + } + } + + internal static class ParserDelegateCache + { + private readonly static ConcurrentDictionary _cache = new ConcurrentDictionary(); + + private static MethodInfo _convertToEnum; + private static MethodInfo _convertToNullableEnum; + + public static BindParser Get() + { + if (!_cache.TryGetValue(typeof(T), out var parser)) + { + // We need to replicate all of the primitive cases that we handle here so that they will behave the same way. + // The result will be cached. + if (typeof(T) == typeof(string)) + { + parser = ConvertToString; + } + else if (typeof(T) == typeof(bool)) + { + parser = ConvertToBool; + } + else if (typeof(T) == typeof(bool?)) + { + parser = ConvertToNullableBool; + } + else if (typeof(T) == typeof(int)) + { + parser = ConvertToInt; + } + else if (typeof(T) == typeof(int?)) + { + parser = ConvertToNullableInt; + } + else if (typeof(T) == typeof(long)) + { + parser = ConvertToLong; + } + else if (typeof(T) == typeof(long?)) + { + parser = ConvertToNullableLong; + } + else if (typeof(T) == typeof(float)) + { + parser = ConvertToFloat; + } + else if (typeof(T) == typeof(float?)) + { + parser = ConvertToNullableFloat; + } + else if (typeof(T) == typeof(double)) + { + parser = ConvertToDoubleDelegate; + } + else if (typeof(T) == typeof(double?)) + { + parser = ConvertToNullableDoubleDelegate; + } + else if (typeof(T) == typeof(decimal)) + { + parser = ConvertToDecimal; + } + else if (typeof(T) == typeof(decimal?)) + { + parser = ConvertToNullableDecimal; + } + else if (typeof(T) == typeof(DateTime)) + { + parser = ConvertToDateTime; + } + else if (typeof(T) == typeof(DateTime?)) + { + parser = ConvertToNullableDateTime; + } + else if (typeof(T) == typeof(DateTimeOffset)) + { + parser = ConvertToDateTime; + } + else if (typeof(T) == typeof(DateTimeOffset?)) + { + parser = ConvertToNullableDateTime; + } + else if (typeof(T).IsEnum) + { + // We have to deal invoke this dynamically to work around the type constraint on Enum.TryParse. + var method = _convertToEnum ??= typeof(BindConverter).GetMethod(nameof(ConvertToEnum), BindingFlags.NonPublic | BindingFlags.Static); + parser = method.MakeGenericMethod(typeof(T)).CreateDelegate(typeof(BindParser), target: null); + } + else if (Nullable.GetUnderlyingType(typeof(T)) is Type innerType && innerType.IsEnum) + { + // We have to deal invoke this dynamically to work around the type constraint on Enum.TryParse. + var method = _convertToNullableEnum ??= typeof(BindConverter).GetMethod(nameof(ConvertToNullableEnum), BindingFlags.NonPublic | BindingFlags.Static); + parser = method.MakeGenericMethod(innerType).CreateDelegate(typeof(BindParser), target: null); + } + else + { + parser = MakeTypeConverterConverter(); + } + + _cache.TryAdd(typeof(T), parser); + } + + return (BindParser)parser; + } + + private static BindParser MakeTypeConverterConverter() + { + var typeConverter = TypeDescriptor.GetConverter(typeof(T)); + if (typeConverter == null || !typeConverter.CanConvertFrom(typeof(string))) + { + throw new InvalidOperationException( + $"The type '{typeof(T).FullName}' does not have an associated {typeof(TypeConverter).Name} that supports " + + $"conversion from a string. " + + $"Apply '{typeof(TypeConverterAttribute).Name}' to the type to register a converter."); + } + + return ConvertWithTypeConverter; + + bool ConvertWithTypeConverter(object obj, CultureInfo culture, out T value) + { + // We intentionally close-over the TypeConverter to cache it. The TypeDescriptor infrastructure is slow. + var converted = typeConverter.ConvertFrom(context: null, culture ?? CultureInfo.CurrentCulture, obj); + if (converted == null) + { + value = default; + return true; + } + + value = (T)converted; + return true; + } + } + } + } +} diff --git a/src/Components/Components/src/EventCallbackFactoryBinderExtensions.cs b/src/Components/Components/src/EventCallbackFactoryBinderExtensions.cs index 0f8a6d547e..a007c47f09 100644 --- a/src/Components/Components/src/EventCallbackFactoryBinderExtensions.cs +++ b/src/Components/Components/src/EventCallbackFactoryBinderExtensions.cs @@ -2,10 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Concurrent; -using System.ComponentModel; using System.Globalization; -using System.Reflection; +using static Microsoft.AspNetCore.Components.BindConverter; namespace Microsoft.AspNetCore.Components { @@ -24,406 +22,6 @@ namespace Microsoft.AspNetCore.Components // For now we're not necessarily handling this correctly since we parse the same way for number and text. public static class EventCallbackFactoryBinderExtensions { - private delegate bool BindConverter(object obj, CultureInfo culture, out T value); - private delegate bool BindConverterWithFormat(object obj, CultureInfo culture, string format, out T value); - - // Perf: conversion delegates are written as static funcs so we can prevent - // allocations for these simple cases. - private readonly static BindConverter ConvertToString = ConvertToStringCore; - - private static bool ConvertToStringCore(object obj, CultureInfo culture, out string value) - { - // We expect the input to already be a string. - value = (string)obj; - return true; - } - - private static BindConverter ConvertToBool = ConvertToBoolCore; - private static BindConverter ConvertToNullableBool = ConvertToNullableBoolCore; - - private static bool ConvertToBoolCore(object obj, CultureInfo culture, out bool value) - { - // We expect the input to already be a bool. - value = (bool)obj; - return true; - } - - private static bool ConvertToNullableBoolCore(object obj, CultureInfo culture, out bool? value) - { - // We expect the input to already be a bool. - value = (bool?)obj; - return true; - } - - private static BindConverter ConvertToInt = ConvertToIntCore; - private static BindConverter ConvertToNullableInt = ConvertToNullableIntCore; - - private static bool ConvertToIntCore(object obj, CultureInfo culture, out int value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return false; - } - - if (!int.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) - { - value = default; - return false; - } - - value = converted; - return true; - } - - private static bool ConvertToNullableIntCore(object obj, CultureInfo culture, out int? value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return true; - } - - if (!int.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) - { - value = default; - return false; - } - - value = converted; - return true; - } - - private static BindConverter ConvertToLong = ConvertToLongCore; - private static BindConverter ConvertToNullableLong = ConvertToNullableLongCore; - - private static bool ConvertToLongCore(object obj, CultureInfo culture, out long value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return false; - } - - if (!long.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) - { - value = default; - return false; - } - - value = converted; - return true; - } - - private static bool ConvertToNullableLongCore(object obj, CultureInfo culture, out long? value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return true; - } - - if (!long.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) - { - value = default; - return false; - } - - value = converted; - return true; - } - - private static BindConverter ConvertToFloat = ConvertToFloatCore; - private static BindConverter ConvertToNullableFloat = ConvertToNullableFloatCore; - - private static bool ConvertToFloatCore(object obj, CultureInfo culture, out float value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return false; - } - - if (!float.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) - { - value = default; - return false; - } - - value = converted; - return true; - } - - private static bool ConvertToNullableFloatCore(object obj, CultureInfo culture, out float? value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return true; - } - - if (!float.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) - { - value = default; - return false; - } - - value = converted; - return true; - } - - private static BindConverter ConvertToDouble = ConvertToDoubleCore; - private static BindConverter ConvertToNullableDouble = ConvertToNullableDoubleCore; - - private static bool ConvertToDoubleCore(object obj, CultureInfo culture, out double value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return false; - } - - if (!double.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) - { - value = default; - return false; - } - - value = converted; - return true; - } - - private static bool ConvertToNullableDoubleCore(object obj, CultureInfo culture, out double? value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return true; - } - - if (!double.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) - { - value = default; - return false; - } - - value = converted; - return true; - } - - private static BindConverter ConvertToDecimal = ConvertToDecimalCore; - private static BindConverter ConvertToNullableDecimal = ConvertToNullableDecimalCore; - - private static bool ConvertToDecimalCore(object obj, CultureInfo culture, out decimal value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return false; - } - - if (!decimal.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) - { - value = default; - return false; - } - - value = converted; - return true; - } - - private static bool ConvertToNullableDecimalCore(object obj, CultureInfo culture, out decimal? value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return true; - } - - if (!decimal.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) - { - value = default; - return false; - } - - value = converted; - return true; - } - - private static BindConverter ConvertToDateTime = ConvertToDateTimeCore; - private static BindConverterWithFormat ConvertToDateTimeWithFormat = ConvertToDateTimeCore; - private static BindConverter ConvertToNullableDateTime = ConvertToNullableDateTimeCore; - private static BindConverterWithFormat ConvertToNullableDateTimeWithFormat = ConvertToNullableDateTimeCore; - - private static bool ConvertToDateTimeCore(object obj, CultureInfo culture, out DateTime value) - { - return ConvertToDateTimeCore(obj, culture, format: null, out value); - } - - private static bool ConvertToDateTimeCore(object obj, CultureInfo culture, string format, out DateTime value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return false; - } - - if (format != null && DateTime.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted)) - { - value = converted; - return true; - } - else if (format == null && DateTime.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted)) - { - value = converted; - return true; - } - - value = default; - return false; - } - - private static bool ConvertToNullableDateTimeCore(object obj, CultureInfo culture, out DateTime? value) - { - return ConvertToNullableDateTimeCore(obj, culture, format: null, out value); - } - - private static bool ConvertToNullableDateTimeCore(object obj, CultureInfo culture, string format, out DateTime? value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return true; - } - - if (format != null && DateTime.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted)) - { - value = converted; - return true; - } - else if (format == null && DateTime.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted)) - { - value = converted; - return true; - } - - value = default; - return false; - } - - private static BindConverter ConvertToDateTimeOffset = ConvertToDateTimeOffsetCore; - private static BindConverterWithFormat ConvertToDateTimeOffsetWithFormat = ConvertToDateTimeOffsetCore; - private static BindConverter ConvertToNullableDateTimeOffset = ConvertToNullableDateTimeOffsetCore; - private static BindConverterWithFormat ConvertToNullableDateTimeOffsetWithFormat = ConvertToNullableDateTimeOffsetCore; - - private static bool ConvertToDateTimeOffsetCore(object obj, CultureInfo culture, out DateTimeOffset value) - { - return ConvertToDateTimeOffsetCore(obj, culture, format: null, out value); - } - - private static bool ConvertToDateTimeOffsetCore(object obj, CultureInfo culture, string format, out DateTimeOffset value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return false; - } - - if (format != null && DateTimeOffset.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted)) - { - value = converted; - return true; - } - else if (format == null && DateTimeOffset.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted)) - { - value = converted; - return true; - } - - value = default; - return false; - } - - private static bool ConvertToNullableDateTimeOffsetCore(object obj, CultureInfo culture, out DateTimeOffset? value) - { - return ConvertToNullableDateTimeOffsetCore(obj, culture, format: null, out value); - } - - private static bool ConvertToNullableDateTimeOffsetCore(object obj, CultureInfo culture, string format, out DateTimeOffset? value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return true; - } - - if (format != null && DateTimeOffset.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted)) - { - value = converted; - return true; - } - else if (format == null && DateTimeOffset.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted)) - { - value = converted; - return true; - } - - value = default; - return false; - } - - private static bool ConvertToEnum(object obj, CultureInfo culture, out T value) where T : struct, Enum - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return true; - } - - if (!Enum.TryParse(text, out var converted)) - { - value = default; - return false; - } - - value = converted; - return true; - } - - private static bool ConvertToNullableEnum(object obj, CultureInfo culture, out T? value) where T : struct, Enum - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return true; - } - - if (!Enum.TryParse(text, out var converted)) - { - value = default; - return false; - } - - value = converted; - return true; - } - /// /// For internal use only. /// @@ -611,7 +209,7 @@ namespace Microsoft.AspNetCore.Components double existingValue, CultureInfo culture = null) { - return CreateBinderCore(factory, receiver, setter, culture, ConvertToDouble); + return CreateBinderCore(factory, receiver, setter, culture, ConvertToDoubleDelegate); } /// @@ -630,7 +228,7 @@ namespace Microsoft.AspNetCore.Components double? existingValue, CultureInfo culture = null) { - return CreateBinderCore(factory, receiver, setter, culture, ConvertToNullableDouble); + return CreateBinderCore(factory, receiver, setter, culture, ConvertToNullableDoubleDelegate); } /// @@ -687,7 +285,7 @@ namespace Microsoft.AspNetCore.Components DateTime existingValue, CultureInfo culture = null) { - return CreateBinderCore(factory, receiver, setter, culture, format: null, ConvertToDateTimeWithFormat); + return CreateBinderCore(factory, receiver, setter, culture, ConvertToDateTime); } /// @@ -727,7 +325,7 @@ namespace Microsoft.AspNetCore.Components DateTime? existingValue, CultureInfo culture = null) { - return CreateBinderCore(factory, receiver, setter, culture, format: null, ConvertToNullableDateTimeWithFormat); + return CreateBinderCore(factory, receiver, setter, culture, ConvertToNullableDateTime); } /// @@ -767,7 +365,7 @@ namespace Microsoft.AspNetCore.Components DateTimeOffset existingValue, CultureInfo culture = null) { - return CreateBinderCore(factory, receiver, setter, culture, format: null, ConvertToDateTimeOffsetWithFormat); + return CreateBinderCore(factory, receiver, setter, culture, ConvertToDateTimeOffset); } /// @@ -807,7 +405,7 @@ namespace Microsoft.AspNetCore.Components DateTimeOffset? existingValue, CultureInfo culture = null) { - return CreateBinderCore(factory, receiver, setter, culture, format: null, ConvertToNullableDateTimeOffsetWithFormat); + return CreateBinderCore(factory, receiver, setter, culture, ConvertToNullableDateTimeOffset); } /// @@ -848,7 +446,7 @@ namespace Microsoft.AspNetCore.Components T existingValue, CultureInfo culture = null) { - return CreateBinderCore(factory, receiver, setter, culture, BinderConverterCache.Get()); + return CreateBinderCore(factory, receiver, setter, culture, ParserDelegateCache.Get()); } private static EventCallback CreateBinderCore( @@ -856,7 +454,7 @@ namespace Microsoft.AspNetCore.Components object receiver, Action setter, CultureInfo culture, - BindConverter converter) + BindConverter.BindParser converter) { Action callback = e => { @@ -900,7 +498,7 @@ namespace Microsoft.AspNetCore.Components Action setter, CultureInfo culture, string format, - BindConverterWithFormat converter) + BindConverter.BindParserWithFormat converter) { Action callback = e => { @@ -937,147 +535,5 @@ namespace Microsoft.AspNetCore.Components }; return factory.Create(receiver, callback); } - - // We can't rely on generics + static to cache here unfortunately. That would require us to overload - // CreateBinder on T : struct AND T : class, which is not allowed. - private static class BinderConverterCache - { - private readonly static ConcurrentDictionary _cache = new ConcurrentDictionary(); - - private static MethodInfo _convertToEnum; - private static MethodInfo _convertToNullableEnum; - - public static BindConverter Get() - { - if (!_cache.TryGetValue(typeof(T), out var converter)) - { - // We need to replicate all of the primitive cases that we handle here so that they will behave the same way. - // The result will be cached. - if (typeof(T) == typeof(string)) - { - converter = ConvertToString; - } - else if (typeof(T) == typeof(bool)) - { - converter = ConvertToBool; - } - else if (typeof(T) == typeof(bool?)) - { - converter = ConvertToNullableBool; - } - else if (typeof(T) == typeof(int)) - { - converter = ConvertToInt; - } - else if (typeof(T) == typeof(int?)) - { - converter = ConvertToNullableInt; - } - else if (typeof(T) == typeof(long)) - { - converter = ConvertToLong; - } - else if (typeof(T) == typeof(long?)) - { - converter = ConvertToNullableLong; - } - else if (typeof(T) == typeof(float)) - { - converter = ConvertToFloat; - } - else if (typeof(T) == typeof(float?)) - { - converter = ConvertToNullableFloat; - } - else if (typeof(T) == typeof(double)) - { - converter = ConvertToDouble; - } - else if (typeof(T) == typeof(double?)) - { - converter = ConvertToNullableDouble; - } - else if (typeof(T) == typeof(decimal)) - { - converter = ConvertToDecimal; - } - else if (typeof(T) == typeof(decimal?)) - { - converter = ConvertToNullableDecimal; - } - else if (typeof(T) == typeof(DateTime)) - { - converter = ConvertToDateTime; - } - else if (typeof(T) == typeof(DateTime?)) - { - converter = ConvertToNullableDateTime; - } - else if (typeof(T) == typeof(DateTimeOffset)) - { - converter = ConvertToDateTimeOffset; - } - else if (typeof(T) == typeof(DateTimeOffset?)) - { - converter = ConvertToNullableDateTimeOffset; - } - else if (typeof(T).IsEnum) - { - // We have to deal invoke this dynamically to work around the type constraint on Enum.TryParse. - var method = _convertToEnum ??= typeof(EventCallbackFactoryBinderExtensions).GetMethod(nameof(ConvertToEnum), BindingFlags.NonPublic | BindingFlags.Static); - converter = method.MakeGenericMethod(typeof(T)).CreateDelegate(typeof(BindConverter), target: null); - } - else if (Nullable.GetUnderlyingType(typeof(T)) is Type innerType && innerType.IsEnum) - { - // We have to deal invoke this dynamically to work around the type constraint on Enum.TryParse. - var method = _convertToNullableEnum ??= typeof(EventCallbackFactoryBinderExtensions).GetMethod(nameof(ConvertToNullableEnum), BindingFlags.NonPublic | BindingFlags.Static); - converter = method.MakeGenericMethod(innerType).CreateDelegate(typeof(BindConverter), target: null); - } - else - { - converter = MakeTypeConverterConverter(); - } - - _cache.TryAdd(typeof(T), converter); - } - - return (BindConverter)converter; - } - - private static BindConverter MakeTypeConverterConverter() - { - var typeConverter = TypeDescriptor.GetConverter(typeof(T)); - if (typeConverter == null || !typeConverter.CanConvertFrom(typeof(string))) - { - throw new InvalidOperationException( - $"The type '{typeof(T).FullName}' does not have an associated {typeof(TypeConverter).Name} that supports " + - $"conversion from a string. " + - $"Apply '{typeof(TypeConverterAttribute).Name}' to the type to register a converter."); - } - - return ConvertWithTypeConverter; - - bool ConvertWithTypeConverter(object obj, CultureInfo culture, out T value) - { - var text = (string)obj; - if (string.IsNullOrEmpty(text)) - { - value = default; - return true; - } - - // We intentionally close-over the TypeConverter to cache it. The TypeDescriptor infrastructure is slow. - var converted = typeConverter.ConvertFromString(context: null, culture ?? CultureInfo.CurrentCulture, text); - if (converted == null) - { - value = default; - return false; - } - - value = (T)converted; - return true; - } - } - } } } diff --git a/src/Components/Components/src/Forms/InputComponents/InputCheckbox.cs b/src/Components/Components/src/Forms/InputComponents/InputCheckbox.cs index df84c8bdaa..981287ee8d 100644 --- a/src/Components/Components/src/Forms/InputComponents/InputCheckbox.cs +++ b/src/Components/Components/src/Forms/InputComponents/InputCheckbox.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Components.Forms builder.AddMultipleAttributes(1, AdditionalAttributes); builder.AddAttribute(2, "type", "checkbox"); builder.AddAttribute(3, "class", CssClass); - builder.AddAttribute(4, "checked", BindMethods.GetValue(CurrentValue)); + builder.AddAttribute(4, "checked", BindConverter.FormatValue(CurrentValue)); builder.AddAttribute(5, "onchange", EventCallback.Factory.CreateBinder(this, __value => CurrentValue = __value, CurrentValue)); builder.CloseElement(); } diff --git a/src/Components/Components/src/Forms/InputComponents/InputDate.cs b/src/Components/Components/src/Forms/InputComponents/InputDate.cs index 0a79bbc15d..f080af908d 100644 --- a/src/Components/Components/src/Forms/InputComponents/InputDate.cs +++ b/src/Components/Components/src/Forms/InputComponents/InputDate.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Components.Forms builder.AddMultipleAttributes(1, AdditionalAttributes); builder.AddAttribute(2, "type", "date"); builder.AddAttribute(3, "class", CssClass); - builder.AddAttribute(4, "value", BindMethods.GetValue(CurrentValueAsString)); + builder.AddAttribute(4, "value", BindConverter.FormatValue(CurrentValueAsString)); builder.AddAttribute(5, "onchange", EventCallback.Factory.CreateBinder(this, __value => CurrentValueAsString = __value, CurrentValueAsString)); builder.CloseElement(); } @@ -38,9 +38,9 @@ namespace Microsoft.AspNetCore.Components.Forms switch (value) { case DateTime dateTimeValue: - return dateTimeValue.ToString(DateFormat, CultureInfo.InvariantCulture); + return BindConverter.FormatValue(dateTimeValue, DateFormat, CultureInfo.InvariantCulture); case DateTimeOffset dateTimeOffsetValue: - return dateTimeOffsetValue.ToString(DateFormat, CultureInfo.InvariantCulture); + return BindConverter.FormatValue(dateTimeOffsetValue, DateFormat, CultureInfo.InvariantCulture); default: return string.Empty; // Handles null for Nullable, etc. } @@ -81,7 +81,7 @@ namespace Microsoft.AspNetCore.Components.Forms static bool TryParseDateTime(string value, out T result) { - var success = DateTime.TryParseExact(value, DateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out var parsedValue); + var success = BindConverter.TryConvertToDateTime(value, CultureInfo.InvariantCulture, DateFormat, out var parsedValue); if (success) { result = (T)(object)parsedValue; @@ -96,7 +96,7 @@ namespace Microsoft.AspNetCore.Components.Forms static bool TryParseDateTimeOffset(string value, out T result) { - var success = DateTimeOffset.TryParseExact(value, DateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out var parsedValue); + var success = BindConverter.TryConvertToDateTimeOffset(value, CultureInfo.InvariantCulture, DateFormat, out var parsedValue); if (success) { result = (T)(object)parsedValue; diff --git a/src/Components/Components/src/Forms/InputComponents/InputNumber.cs b/src/Components/Components/src/Forms/InputComponents/InputNumber.cs index 044f4aac3d..c5a222f6ff 100644 --- a/src/Components/Components/src/Forms/InputComponents/InputNumber.cs +++ b/src/Components/Components/src/Forms/InputComponents/InputNumber.cs @@ -13,38 +13,18 @@ namespace Microsoft.AspNetCore.Components.Forms /// public class InputNumber : InputBase { - delegate bool Parser(string value, out T result); - private static Parser _parser; private static string _stepAttributeValue; // Null by default, so only allows whole numbers as per HTML spec - // Determine the parsing logic once per T and cache it, so we don't have to consider all the possible types on each parse static InputNumber() { // Unwrap Nullable, because InputBase already deals with the Nullable aspect // of it for us. We will only get asked to parse the T for nonempty inputs. var targetType = Nullable.GetUnderlyingType(typeof(T)) ?? typeof(T); - - if (targetType == typeof(int)) + if (targetType == typeof(int) || + targetType == typeof(float) || + targetType == typeof(double) || + targetType == typeof(decimal)) { - _parser = TryParseInt; - } - else if (targetType == typeof(long)) - { - _parser = TryParseLong; - } - else if (targetType == typeof(float)) - { - _parser = TryParseFloat; - _stepAttributeValue = "any"; - } - else if (targetType == typeof(double)) - { - _parser = TryParseDouble; - _stepAttributeValue = "any"; - } - else if (targetType == typeof(decimal)) - { - _parser = TryParseDecimal; _stepAttributeValue = "any"; } else @@ -62,11 +42,11 @@ namespace Microsoft.AspNetCore.Components.Forms protected override void BuildRenderTree(RenderTreeBuilder builder) { builder.OpenElement(0, "input"); - builder.AddAttribute(1, "step", _stepAttributeValue); // Before the splat so the user can override + builder.AddAttribute(1, "step", _stepAttributeValue); builder.AddMultipleAttributes(2, AdditionalAttributes); builder.AddAttribute(3, "type", "number"); builder.AddAttribute(4, "class", CssClass); - builder.AddAttribute(5, "value", BindMethods.GetValue(CurrentValueAsString)); + builder.AddAttribute(5, "value", BindConverter.FormatValue(CurrentValueAsString)); builder.AddAttribute(6, "onchange", EventCallback.Factory.CreateBinder(this, __value => CurrentValueAsString = __value, CurrentValueAsString)); builder.CloseElement(); } @@ -74,7 +54,7 @@ namespace Microsoft.AspNetCore.Components.Forms /// protected override bool TryParseValueFromString(string value, out T result, out string validationErrorMessage) { - if (_parser(value, out result)) + if (BindConverter.TryConvertTo(value, CultureInfo.InvariantCulture, out result)) { validationErrorMessage = null; return true; @@ -100,98 +80,23 @@ namespace Microsoft.AspNetCore.Components.Forms return null; case int @int: - return @int.ToString(CultureInfo.InvariantCulture); + return BindConverter.FormatValue(@int, CultureInfo.InvariantCulture); case long @long: - return @long.ToString(CultureInfo.InvariantCulture); + return BindConverter.FormatValue(@long, CultureInfo.InvariantCulture); case float @float: - return @float.ToString(CultureInfo.InvariantCulture); + return BindConverter.FormatValue(@float, CultureInfo.InvariantCulture); case double @double: - return @double.ToString(CultureInfo.InvariantCulture); + return BindConverter.FormatValue(@double, CultureInfo.InvariantCulture); case decimal @decimal: - return @decimal.ToString(CultureInfo.InvariantCulture); + return BindConverter.FormatValue(@decimal, CultureInfo.InvariantCulture); default: throw new InvalidOperationException($"Unsupported type {value.GetType()}"); } } - - static bool TryParseInt(string value, out T result) - { - var success = int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedValue); - if (success) - { - result = (T)(object)parsedValue; - return true; - } - else - { - result = default; - return false; - } - } - - static bool TryParseLong(string value, out T result) - { - var success = long.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedValue); - if (success) - { - result = (T)(object)parsedValue; - return true; - } - else - { - result = default; - return false; - } - } - - static bool TryParseFloat(string value, out T result) - { - var success = float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var parsedValue); - if (success && !float.IsInfinity(parsedValue)) - { - result = (T)(object)parsedValue; - return true; - } - else - { - result = default; - return false; - } - } - - static bool TryParseDouble(string value, out T result) - { - var success = double.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var parsedValue); - if (success && !double.IsInfinity(parsedValue)) - { - result = (T)(object)parsedValue; - return true; - } - else - { - result = default; - return false; - } - } - - static bool TryParseDecimal(string value, out T result) - { - var success = decimal.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var parsedValue); - if (success) - { - result = (T)(object)parsedValue; - return true; - } - else - { - result = default; - return false; - } - } } } diff --git a/src/Components/Components/src/Forms/InputComponents/InputSelect.cs b/src/Components/Components/src/Forms/InputComponents/InputSelect.cs index 6705ce9320..fda1822afe 100644 --- a/src/Components/Components/src/Forms/InputComponents/InputSelect.cs +++ b/src/Components/Components/src/Forms/InputComponents/InputSelect.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Globalization; using Microsoft.AspNetCore.Components.RenderTree; namespace Microsoft.AspNetCore.Components.Forms @@ -22,7 +23,7 @@ namespace Microsoft.AspNetCore.Components.Forms builder.OpenElement(0, "select"); builder.AddMultipleAttributes(1, AdditionalAttributes); builder.AddAttribute(2, "class", CssClass); - builder.AddAttribute(3, "value", BindMethods.GetValue(CurrentValueAsString)); + builder.AddAttribute(3, "value", BindConverter.FormatValue(CurrentValueAsString)); builder.AddAttribute(4, "onchange", EventCallback.Factory.CreateBinder(this, __value => CurrentValueAsString = __value, CurrentValueAsString)); builder.AddContent(5, ChildContent); builder.CloseElement(); @@ -39,14 +40,14 @@ namespace Microsoft.AspNetCore.Components.Forms } else if (typeof(T).IsEnum) { - // There's no non-generic Enum.TryParse (https://github.com/dotnet/corefx/issues/692) - try + var success = BindConverter.TryConvertTo(value, CultureInfo.CurrentCulture, out var parsedValue); + if (success) { - result = (T)Enum.Parse(typeof(T), value); + result = parsedValue; validationErrorMessage = null; return true; } - catch (ArgumentException) + else { result = default; validationErrorMessage = $"The {FieldIdentifier.FieldName} field is not valid."; diff --git a/src/Components/Components/src/Forms/InputComponents/InputText.cs b/src/Components/Components/src/Forms/InputComponents/InputText.cs index ffb7004601..94c09c4694 100644 --- a/src/Components/Components/src/Forms/InputComponents/InputText.cs +++ b/src/Components/Components/src/Forms/InputComponents/InputText.cs @@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Components.Forms builder.OpenElement(0, "input"); builder.AddMultipleAttributes(1, AdditionalAttributes); builder.AddAttribute(2, "class", CssClass); - builder.AddAttribute(3, "value", BindMethods.GetValue(CurrentValue)); + builder.AddAttribute(3, "value", BindConverter.FormatValue(CurrentValue)); builder.AddAttribute(4, "onchange", EventCallback.Factory.CreateBinder(this, __value => CurrentValueAsString = __value, CurrentValueAsString)); builder.CloseElement(); } diff --git a/src/Components/Components/src/Forms/InputComponents/InputTextArea.cs b/src/Components/Components/src/Forms/InputComponents/InputTextArea.cs index ed676d6404..ba61d95896 100644 --- a/src/Components/Components/src/Forms/InputComponents/InputTextArea.cs +++ b/src/Components/Components/src/Forms/InputComponents/InputTextArea.cs @@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Components.Forms builder.OpenElement(0, "textarea"); builder.AddMultipleAttributes(1, AdditionalAttributes); builder.AddAttribute(2, "class", CssClass); - builder.AddAttribute(3, "value", BindMethods.GetValue(CurrentValue)); + builder.AddAttribute(3, "value", BindConverter.FormatValue(CurrentValue)); builder.AddAttribute(4, "onchange", EventCallback.Factory.CreateBinder(this, __value => CurrentValueAsString = __value, CurrentValueAsString)); builder.CloseElement(); } diff --git a/src/Components/Components/test/BindConverterTest.cs b/src/Components/Components/test/BindConverterTest.cs new file mode 100644 index 0000000000..c6fe1275cc --- /dev/null +++ b/src/Components/Components/test/BindConverterTest.cs @@ -0,0 +1,307 @@ +// 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.ComponentModel; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using Xunit; + +namespace Microsoft.AspNetCore.Components +{ + // This is some basic coverage, it's not in depth because there are many many APIs here + // and they mostly call through to CoreFx. We don't want to test the globalization details + // of .NET in detail where we can avoid it. + // + // Instead there's a sampling of things that have somewhat unique behavior or semantics. + public class BindConverterTest + { + [Fact] + public void FormatValue_Bool() + { + // Arrange + var value = true; + var expected = true; + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_Bool_Generic() + { + // Arrange + var value = true; + var expected = true; + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_NullableBool() + { + // Arrange + var value = (bool?)true; + var expected = true; + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_NullableBool_Generic() + { + // Arrange + var value = true; + var expected = true; + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_NullableBoolNull() + { + // Arrange + var value = (bool?)null; + var expected = (bool?)null; + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_NullableBoolNull_Generic() + { + // Arrange + var value = (bool?)null; + var expected = (bool?)null; + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_Int() + { + // Arrange + var value = 17; + var expected = "17"; + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_Int_Generic() + { + // Arrange + var value = 17; + var expected = "17"; + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_NullableInt() + { + // Arrange + var value = (int?)17; + var expected = "17"; + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_NullableInt_Generic() + { + // Arrange + var value = 17; + var expected = "17"; + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_DateTime() + { + // Arrange + var value = DateTime.Now; + var expected = value.ToString(CultureInfo.CurrentCulture); + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_DateTime_Format() + { + // Arrange + var value = DateTime.Now; + var expected = value.ToString("MM-yyyy", CultureInfo.InvariantCulture); + + // Act + var actual = BindConverter.FormatValue(value, "MM-yyyy", CultureInfo.InvariantCulture); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_Enum() + { + // Arrange + var value = SomeLetters.A; + var expected = value.ToString(); + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_Enum_OutOfRange() + { + // Arrange + var value = SomeLetters.A + 3; + var expected = value.ToString(); + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + [Fact] + public void FormatValue_NullableEnum() + { + // Arrange + var value = (SomeLetters?)null; + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Null(actual); + } + + [Fact] + public void FormatValue_TypeConverter() + { + // Arrange + var value = new Person() + { + Name = "Glenn", + Age = 47, + }; + + var expected = JsonSerializer.Serialize(value); + + // Act + var actual = BindConverter.FormatValue(value); + + // Assert + Assert.Equal(expected, actual); + } + + private enum SomeLetters + { + A, + B, + C, + Q, + } + + [TypeConverter(typeof(PersonConverter))] + private class Person + { + public string Name { get; set; } + + public int Age { get; set; } + } + + private class PersonConverter : TypeConverter + { + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + if (sourceType == typeof(string)) + { + return true; + } + + return base.CanConvertFrom(context, sourceType); + } + + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + if (value is string text) + { + return JsonSerializer.Deserialize(text); + } + + return base.ConvertFrom(context, culture, value); + } + + public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) + { + if (destinationType == typeof(string)) + { + return true; + } + + return base.CanConvertTo(context, destinationType); + } + + public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + if (destinationType == typeof(string)) + { + return JsonSerializer.Serialize((Person)value); + } + + return base.ConvertTo(context, culture, value, destinationType); + } + } + } +} From 7d050e803f6b3a51a1f976cb9c2cd230131563f9 Mon Sep 17 00:00:00 2001 From: "Carlos J. Aliaga" Date: Sun, 14 Jul 2019 15:11:50 +0200 Subject: [PATCH 13/76] Fixed RequestHeader to allow working with KeyValuePair. #12114 (#12157) --- .../FunctionalTests/RequestHeaderTests.cs | 22 ++++++++++++++++++- .../RequestProcessing/RequestHeaders.cs | 5 ++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/Servers/HttpSys/test/FunctionalTests/RequestHeaderTests.cs b/src/Servers/HttpSys/test/FunctionalTests/RequestHeaderTests.cs index 39e237eb5e..aa0829c6fa 100644 --- a/src/Servers/HttpSys/test/FunctionalTests/RequestHeaderTests.cs +++ b/src/Servers/HttpSys/test/FunctionalTests/RequestHeaderTests.cs @@ -2,6 +2,7 @@ // 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.Net.Http; using System.Net.Sockets; using System.Text; @@ -57,7 +58,26 @@ namespace Microsoft.AspNetCore.Server.HttpSys await SendRequestAsync(address, "Custom-Header", customValues); } } - + + [ConditionalFact] + public async Task RequestHeaders_ServerAddsCustomHeaders_Success() + { + string address; + using (Utilities.CreateHttpServer(out address, httpContext => + { + var requestHeaders = httpContext.Request.Headers; + var header = KeyValuePair.Create("Custom-Header", new StringValues("custom")); + requestHeaders.Add(header); + + Assert.True(requestHeaders.Contains(header)); + return Task.FromResult(0); + })) + { + string response = await SendRequestAsync(address); + Assert.Equal(string.Empty, response); + } + } + private async Task SendRequestAsync(string uri) { using (HttpClient client = new HttpClient()) diff --git a/src/Shared/HttpSys/RequestProcessing/RequestHeaders.cs b/src/Shared/HttpSys/RequestProcessing/RequestHeaders.cs index 0f87c3565a..a89f2a934a 100644 --- a/src/Shared/HttpSys/RequestProcessing/RequestHeaders.cs +++ b/src/Shared/HttpSys/RequestProcessing/RequestHeaders.cs @@ -110,7 +110,7 @@ namespace Microsoft.AspNetCore.HttpSys.Internal void ICollection>.Add(KeyValuePair item) { - ((IDictionary)this).Add(item.Key, item.Value); + ((IDictionary)this).Add(item.Key,item.Value); } void ICollection>.Clear() @@ -124,8 +124,7 @@ namespace Microsoft.AspNetCore.HttpSys.Internal bool ICollection>.Contains(KeyValuePair item) { - object value; - return ((IDictionary)this).TryGetValue(item.Key, out value) && Object.Equals(value, item.Value); + return ((IDictionary)this).TryGetValue(item.Key, out var value) && Equals(value, item.Value); } void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) From b29993e389a8df97d60b9f54acc54f0e72c63555 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 14 Jul 2019 11:29:06 -0700 Subject: [PATCH 14/76] [master] Update dependencies from 3 repositories (#12105) * Update dependencies from https://github.com/dotnet/roslyn build 20190713.2 - Microsoft.Net.Compilers.Toolset - 3.3.0-beta2-19363-02 * Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20190713.2 - Microsoft.EntityFrameworkCore.Tools - 3.0.0-preview8.19363.2 - Microsoft.EntityFrameworkCore.SqlServer - 3.0.0-preview8.19363.2 - dotnet-ef - 3.0.0-preview8.19363.2 - Microsoft.EntityFrameworkCore - 3.0.0-preview8.19363.2 - Microsoft.EntityFrameworkCore.InMemory - 3.0.0-preview8.19363.2 - Microsoft.EntityFrameworkCore.Relational - 3.0.0-preview8.19363.2 - Microsoft.EntityFrameworkCore.Sqlite - 3.0.0-preview8.19363.2 Dependency coherency updates - Microsoft.AspNetCore.Analyzer.Testing - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.ActivatorUtilities.Sources - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Caching.Abstractions - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Caching.Memory - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Caching.SqlServer - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Caching.StackExchangeRedis - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Abstractions - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.AzureKeyVault - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Binder - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.CommandLine - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.EnvironmentVariables - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.FileExtensions - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Ini - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Json - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.KeyPerFile - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.UserSecrets - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Xml - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.DependencyInjection.Abstractions - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.DependencyInjection - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.DiagnosticAdapter - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Diagnostics.HealthChecks - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileProviders.Abstractions - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileProviders.Composite - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileProviders.Embedded - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileProviders.Physical - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileSystemGlobbing - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Hosting.Abstractions - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Hosting - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.HostFactoryResolver.Sources - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Http - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Localization.Abstractions - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Localization - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Abstractions - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.AzureAppServices - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Configuration - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Console - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Debug - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.EventSource - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.EventLog - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.TraceSource - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Testing - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.ObjectPool - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Options.ConfigurationExtensions - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Options.DataAnnotations - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Options - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.ParameterDefaultValue.Sources - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Primitives - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.TypeNameHelper.Sources - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.ValueStopwatch.Sources - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.WebEncoders - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Internal.Extensions.Refs - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.JSInterop - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Mono.WebAssembly.Interop - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Bcl.AsyncInterfaces - 1.0.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.CSharp - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Win32.Registry - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Win32.SystemEvents - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.ComponentModel.Annotations - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Diagnostics.EventLog - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Drawing.Common - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.IO.Pipelines - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Net.Http.WinHttpHandler - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Net.WebSockets.WebSocketProtocol - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Reflection.Metadata - 1.7.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Runtime.CompilerServices.Unsafe - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Security.Cryptography.Cng - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Security.Cryptography.Pkcs - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Security.Cryptography.Xml - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Security.Permissions - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Security.Principal.Windows - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.ServiceProcess.ServiceController - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Text.Encodings.Web - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Text.Json - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Threading.Channels - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - System.Windows.Extensions - 4.6.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.DependencyModel - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Ref - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - NETStandard.Library.Ref - 2.1.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.Platforms - 3.0.0-preview8.19362.11 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27912-15 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Internal.AspNetCore.Analyzers - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.AspNetCore.Testing - 3.0.0-preview8.19363.1 (parent: Microsoft.EntityFrameworkCore) * Update dependencies from https://github.com/aspnet/AspNetCore-Tooling build 20190713.2 - Microsoft.NET.Sdk.Razor - 3.0.0-preview8.19363.2 - Microsoft.CodeAnalysis.Razor - 3.0.0-preview8.19363.2 - Microsoft.AspNetCore.Razor.Language - 3.0.0-preview8.19363.2 - Microsoft.AspNetCore.Mvc.Razor.Extensions - 3.0.0-preview8.19363.2 * !fixup! Avoid new CS8618, "Non-nullable event ... is unititialized" errors --- eng/Version.Details.xml | 400 +++++++++--------- eng/Versions.props | 200 ++++----- .../src/Startup/StartupAnalyzer.Events.cs | 6 +- 3 files changed, 303 insertions(+), 303 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index fb70b43094..7c2054f46d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -13,408 +13,408 @@ https://github.com/aspnet/Blazor 7e2a0091dd81c0cb17ceb7bdc4d67aed67dbec66 - + https://github.com/aspnet/AspNetCore-Tooling - a23fdc5348f411e8fcc29761fb03cf74b1c4f970 + 3c7ffaaf04d25cb5c7eb87f758deb270ac5c1812 - + https://github.com/aspnet/AspNetCore-Tooling - a23fdc5348f411e8fcc29761fb03cf74b1c4f970 + 3c7ffaaf04d25cb5c7eb87f758deb270ac5c1812 - + https://github.com/aspnet/AspNetCore-Tooling - a23fdc5348f411e8fcc29761fb03cf74b1c4f970 + 3c7ffaaf04d25cb5c7eb87f758deb270ac5c1812 - + https://github.com/aspnet/AspNetCore-Tooling - a23fdc5348f411e8fcc29761fb03cf74b1c4f970 + 3c7ffaaf04d25cb5c7eb87f758deb270ac5c1812 - + https://github.com/aspnet/EntityFrameworkCore - c916044ea14b17159b7c2cb5f5848bf43f15efc7 + 82ccf383ec4f05b8dbac6ef2ffc3e8d3f569dde4 - + https://github.com/aspnet/EntityFrameworkCore - c916044ea14b17159b7c2cb5f5848bf43f15efc7 + 82ccf383ec4f05b8dbac6ef2ffc3e8d3f569dde4 - + https://github.com/aspnet/EntityFrameworkCore - c916044ea14b17159b7c2cb5f5848bf43f15efc7 + 82ccf383ec4f05b8dbac6ef2ffc3e8d3f569dde4 - + https://github.com/aspnet/EntityFrameworkCore - c916044ea14b17159b7c2cb5f5848bf43f15efc7 + 82ccf383ec4f05b8dbac6ef2ffc3e8d3f569dde4 - + https://github.com/aspnet/EntityFrameworkCore - c916044ea14b17159b7c2cb5f5848bf43f15efc7 + 82ccf383ec4f05b8dbac6ef2ffc3e8d3f569dde4 - + https://github.com/aspnet/EntityFrameworkCore - c916044ea14b17159b7c2cb5f5848bf43f15efc7 + 82ccf383ec4f05b8dbac6ef2ffc3e8d3f569dde4 - + https://github.com/aspnet/EntityFrameworkCore - c916044ea14b17159b7c2cb5f5848bf43f15efc7 + 82ccf383ec4f05b8dbac6ef2ffc3e8d3f569dde4 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 https://github.com/dotnet/corefx a28176b5ec68b6da1472934fe9493790d1665cae - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/dotnet/core-setup - 3ca720b8a2dc8f711a4762729d5c6a223ecc523a + a7d2e0d27b2a6be92b620de7c321a29fe42fca53 - + https://github.com/dotnet/core-setup - 3ca720b8a2dc8f711a4762729d5c6a223ecc523a + a7d2e0d27b2a6be92b620de7c321a29fe42fca53 - + https://github.com/dotnet/core-setup - 3ca720b8a2dc8f711a4762729d5c6a223ecc523a + a7d2e0d27b2a6be92b620de7c321a29fe42fca53 - + https://github.com/dotnet/core-setup - 3ca720b8a2dc8f711a4762729d5c6a223ecc523a + a7d2e0d27b2a6be92b620de7c321a29fe42fca53 - + https://github.com/dotnet/corefx - a393ffee970c6d962c5830bb1c6fa4c3a3e268a6 + 1841042b99062de13dc80098cede9413be569238 - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 https://github.com/dotnet/arcade @@ -428,13 +428,13 @@ https://github.com/dotnet/arcade a65d0966dc28861394ce78cfdcb9d5dff370957c - + https://github.com/aspnet/Extensions - 340377c1b06f9eb34d018f84bea69119fb622093 + 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 - + https://github.com/dotnet/roslyn - 17aaaf42dfcf86952acf0c7f788887623e7f4095 + 342275182023200bcd42b3d9919e984039577b44 diff --git a/eng/Versions.props b/eng/Versions.props index 41af8c2290..fbc615988d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -52,115 +52,115 @@ 1.0.0-beta.19356.1 - 3.3.0-beta2-19359-05 + 3.3.0-beta2-19363-02 - 3.0.0-preview8-27911-04 - 3.0.0-preview8-27911-04 - 3.0.0-preview8-27911-04 - 2.1.0-preview8-27911-04 + 3.0.0-preview8-27912-15 + 3.0.0-preview8-27912-15 + 3.0.0-preview8-27912-15 + 2.1.0-preview8-27912-15 - 1.0.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 + 1.0.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 4.7.0-preview6.19264.9 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 1.7.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 - 4.6.0-preview8.19361.1 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 1.7.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 + 4.6.0-preview8.19362.11 - 3.0.0-preview8.19361.1 + 3.0.0-preview8.19362.11 0.10.0-preview8.19355.1 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 + 3.0.0-preview8.19363.1 - 3.0.0-preview8.19361.7 - 3.0.0-preview8.19361.7 - 3.0.0-preview8.19361.7 - 3.0.0-preview8.19361.7 - 3.0.0-preview8.19361.7 - 3.0.0-preview8.19361.7 - 3.0.0-preview8.19361.7 + 3.0.0-preview8.19363.2 + 3.0.0-preview8.19363.2 + 3.0.0-preview8.19363.2 + 3.0.0-preview8.19363.2 + 3.0.0-preview8.19363.2 + 3.0.0-preview8.19363.2 + 3.0.0-preview8.19363.2 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 - 3.0.0-preview8.19361.5 + 3.0.0-preview8.19363.2 + 3.0.0-preview8.19363.2 + 3.0.0-preview8.19363.2 + 3.0.0-preview8.19363.2 - + https://github.com/dotnet/core-setup - a7d2e0d27b2a6be92b620de7c321a29fe42fca53 + 36ad04d936c4613c1b1599b899071d411fe5c9b1 - + https://github.com/dotnet/core-setup - a7d2e0d27b2a6be92b620de7c321a29fe42fca53 + 36ad04d936c4613c1b1599b899071d411fe5c9b1 - + https://github.com/dotnet/corefx - 1841042b99062de13dc80098cede9413be569238 + 750e954f0c82accded6ca7ac5a3b0c053de647a5 - + https://github.com/aspnet/Extensions - 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 + 12af68f063eb57dc1a55bf690d4a533e42a76376 https://github.com/dotnet/arcade @@ -428,9 +428,9 @@ https://github.com/dotnet/arcade a65d0966dc28861394ce78cfdcb9d5dff370957c - + https://github.com/aspnet/Extensions - 1f86bd8470b72ed2c55174f86d38c3c7eedc49c3 + 12af68f063eb57dc1a55bf690d4a533e42a76376 https://github.com/dotnet/roslyn diff --git a/eng/Versions.props b/eng/Versions.props index fbc615988d..ac617452b0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -54,113 +54,113 @@ 3.3.0-beta2-19363-02 - 3.0.0-preview8-27912-15 - 3.0.0-preview8-27912-15 - 3.0.0-preview8-27912-15 - 2.1.0-preview8-27912-15 + 3.0.0-preview8-27913-09 + 3.0.0-preview8-27913-09 + 3.0.0-preview8-27913-09 + 2.1.0-preview8-27913-09 - 1.0.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 + 1.0.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 4.7.0-preview6.19264.9 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 1.7.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 - 4.6.0-preview8.19362.11 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 1.7.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 + 4.6.0-preview8.19363.4 - 3.0.0-preview8.19362.11 + 3.0.0-preview8.19363.4 0.10.0-preview8.19355.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 - 3.0.0-preview8.19363.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.1 - 3.0.0-preview8.19363.2 - 3.0.0-preview8.19363.2 - 3.0.0-preview8.19363.2 - 3.0.0-preview8.19363.2 - 3.0.0-preview8.19363.2 - 3.0.0-preview8.19363.2 - 3.0.0-preview8.19363.2 + 3.0.0-preview8.19364.2 + 3.0.0-preview8.19364.2 + 3.0.0-preview8.19364.2 + 3.0.0-preview8.19364.2 + 3.0.0-preview8.19364.2 + 3.0.0-preview8.19364.2 + 3.0.0-preview8.19364.2 - 3.0.0-preview8.19363.2 - 3.0.0-preview8.19363.2 - 3.0.0-preview8.19363.2 - 3.0.0-preview8.19363.2 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 - + https://github.com/dotnet/core-setup - 36ad04d936c4613c1b1599b899071d411fe5c9b1 + 2bb2dcaeffb1dfeda077354449868ddac254bc3d - + https://github.com/dotnet/core-setup - 36ad04d936c4613c1b1599b899071d411fe5c9b1 + 2bb2dcaeffb1dfeda077354449868ddac254bc3d - + https://github.com/dotnet/corefx - 750e954f0c82accded6ca7ac5a3b0c053de647a5 + c14b80faff694bae4e085bad221e2e83410e5f33 - + https://github.com/aspnet/Extensions - 12af68f063eb57dc1a55bf690d4a533e42a76376 + d6b33c2155694591d5338a731c5b337757a4b668 https://github.com/dotnet/arcade @@ -428,9 +428,9 @@ https://github.com/dotnet/arcade a65d0966dc28861394ce78cfdcb9d5dff370957c - + https://github.com/aspnet/Extensions - 12af68f063eb57dc1a55bf690d4a533e42a76376 + d6b33c2155694591d5338a731c5b337757a4b668 https://github.com/dotnet/roslyn diff --git a/eng/Versions.props b/eng/Versions.props index ac617452b0..de0b018c66 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -54,108 +54,108 @@ 3.3.0-beta2-19363-02 - 3.0.0-preview8-27913-09 - 3.0.0-preview8-27913-09 - 3.0.0-preview8-27913-09 - 2.1.0-preview8-27913-09 + 3.0.0-preview8-27914-05 + 3.0.0-preview8-27914-05 + 3.0.0-preview8-27914-05 + 2.1.0-preview8-27914-05 - 1.0.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 + 1.0.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 4.7.0-preview6.19264.9 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 1.7.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 - 4.6.0-preview8.19363.4 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 1.7.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 + 4.6.0-preview8.19364.1 - 3.0.0-preview8.19363.4 + 3.0.0-preview8.19364.1 0.10.0-preview8.19355.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 - 3.0.0-preview8.19364.1 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 + 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.2 - 3.0.0-preview8.19364.2 - 3.0.0-preview8.19364.2 - 3.0.0-preview8.19364.2 - 3.0.0-preview8.19364.2 - 3.0.0-preview8.19364.2 - 3.0.0-preview8.19364.2 + 3.0.0-preview8.19364.4 + 3.0.0-preview8.19364.4 + 3.0.0-preview8.19364.4 + 3.0.0-preview8.19364.4 + 3.0.0-preview8.19364.4 + 3.0.0-preview8.19364.4 + 3.0.0-preview8.19364.4 3.0.0-preview8.19364.3 3.0.0-preview8.19364.3 From 753e98c96d34911c37f533038973fe3de03c41e4 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Sun, 24 Mar 2019 14:53:08 -0700 Subject: [PATCH 17/76] Refactor of Startup analyzer code --- ...tor.cs => BuildServiceProviderAnalzyer.cs} | 29 ++-- .../src/Startup/ConfigureMethodAnalysis.cs | 18 -- .../src/Startup/MiddlewareAnalysis.cs | 46 +---- .../src/Startup/MiddlewareAnalyzer.cs | 48 ++++++ .../src/Startup/MvcOptionsAnalysis.cs | 45 ----- ...esMethodAnalysis.cs => OptionsAnalysis.cs} | 11 +- .../src/Startup/OptionsAnalyzer.cs | 43 +++++ .../Mvc.Analyzers/src/Startup/OptionsFacts.cs | 27 +++ .../Mvc.Analyzers/src/Startup/OptionsItem.cs | 22 +++ .../src/Startup/ServicesAnalysis.cs | 45 +---- .../src/Startup/ServicesAnalyzer.cs | 43 +++++ .../src/Startup/StartupAnalysis.cs | 56 +++++++ .../src/Startup/StartupAnalysisBuilder.cs | 71 ++++++++ .../src/Startup/StartupAnalysisContext.cs | 22 --- .../Startup/StartupAnalyzer.Diagnostics.cs | 51 ++++-- .../src/Startup/StartupAnalyzer.Events.cs | 33 +++- .../src/Startup/StartupAnalzyer.cs | 157 ++++++------------ .../src/Startup/StartupComputedAnalysis.cs | 17 -- .../src/Startup/StartupDiagnosticValidator.cs | 9 - .../Mvc.Analyzers/src/Startup/StartupFacts.cs | 36 +++- .../src/Startup/StartupSymbols.cs | 11 +- .../src/Startup/UseMvcAnalyzer.cs | 55 ++++++ .../src/Startup/UseMvcDiagnosticValidator.cs | 51 ------ .../Mvc.Analyzers/test/StartupAnalyzerTest.cs | 43 ++--- .../AddResponseTypeAttributeCodeFixAction.cs | 2 +- 25 files changed, 571 insertions(+), 420 deletions(-) rename src/Mvc/Mvc.Analyzers/src/Startup/{BuildServiceProviderValidator.cs => BuildServiceProviderAnalzyer.cs} (52%) delete mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/ConfigureMethodAnalysis.cs create mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/MiddlewareAnalyzer.cs delete mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/MvcOptionsAnalysis.cs rename src/Mvc/Mvc.Analyzers/src/Startup/{ConfigureServicesMethodAnalysis.cs => OptionsAnalysis.cs} (53%) create mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/OptionsAnalyzer.cs create mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/OptionsFacts.cs create mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/OptionsItem.cs create mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/ServicesAnalyzer.cs create mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalysis.cs create mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalysisBuilder.cs delete mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalysisContext.cs delete mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/StartupComputedAnalysis.cs delete mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/StartupDiagnosticValidator.cs create mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/UseMvcAnalyzer.cs delete mode 100644 src/Mvc/Mvc.Analyzers/src/Startup/UseMvcDiagnosticValidator.cs diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/BuildServiceProviderValidator.cs b/src/Mvc/Mvc.Analyzers/src/Startup/BuildServiceProviderAnalzyer.cs similarity index 52% rename from src/Mvc/Mvc.Analyzers/src/Startup/BuildServiceProviderValidator.cs rename to src/Mvc/Mvc.Analyzers/src/Startup/BuildServiceProviderAnalzyer.cs index ef6d430eee..edd78751b9 100644 --- a/src/Mvc/Mvc.Analyzers/src/Startup/BuildServiceProviderValidator.cs +++ b/src/Mvc/Mvc.Analyzers/src/Startup/BuildServiceProviderAnalzyer.cs @@ -1,41 +1,42 @@ // 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.Concurrent; -using System.Linq; +using System.Diagnostics; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; namespace Microsoft.AspNetCore.Analyzers { - internal class BuildServiceProviderValidator : StartupDiagnosticValidator + internal class BuildServiceProviderValidator { - public static BuildServiceProviderValidator CreateAndInitialize(CompilationAnalysisContext context, ConcurrentBag analyses) + private readonly StartupAnalysis _context; + + public BuildServiceProviderValidator(StartupAnalysis context) { - if (analyses == null) - { - throw new ArgumentNullException(nameof(analyses)); - } + _context = context; + } - var validator = new BuildServiceProviderValidator(); + public void AnalyzeSymbol(SymbolAnalysisContext context) + { + Debug.Assert(context.Symbol.Kind == SymbolKind.NamedType); + Debug.Assert(StartupFacts.IsStartupClass(_context.StartupSymbols, (INamedTypeSymbol)context.Symbol)); - foreach (var serviceAnalysis in analyses.OfType()) + var type = (INamedTypeSymbol)context.Symbol; + + foreach (var serviceAnalysis in _context.GetRelatedAnalyses(type)) { foreach (var serviceItem in serviceAnalysis.Services) { if (serviceItem.UseMethod.Name == "BuildServiceProvider") { context.ReportDiagnostic(Diagnostic.Create( - StartupAnalzyer.BuildServiceProviderShouldNotCalledInConfigureServicesMethod, + StartupAnalzyer.Diagnostics.BuildServiceProviderShouldNotCalledInConfigureServicesMethod, serviceItem.Operation.Syntax.GetLocation(), serviceItem.UseMethod.Name, serviceAnalysis.ConfigureServicesMethod.Name)); } } } - - return validator; } } } diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/ConfigureMethodAnalysis.cs b/src/Mvc/Mvc.Analyzers/src/Startup/ConfigureMethodAnalysis.cs deleted file mode 100644 index 394dd23bff..0000000000 --- a/src/Mvc/Mvc.Analyzers/src/Startup/ConfigureMethodAnalysis.cs +++ /dev/null @@ -1,18 +0,0 @@ -// 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.CodeAnalysis; - -namespace Microsoft.AspNetCore.Analyzers -{ - internal abstract class ConfigureMethodAnalysis : StartupComputedAnalysis - { - protected ConfigureMethodAnalysis(IMethodSymbol configureMethod) - : base(configureMethod.ContainingType) - { - ConfigureMethod = configureMethod; - } - - public IMethodSymbol ConfigureMethod { get; } - } -} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/MiddlewareAnalysis.cs b/src/Mvc/Mvc.Analyzers/src/Startup/MiddlewareAnalysis.cs index 874dc30ea6..789dbcc352 100644 --- a/src/Mvc/Mvc.Analyzers/src/Startup/MiddlewareAnalysis.cs +++ b/src/Mvc/Mvc.Analyzers/src/Startup/MiddlewareAnalysis.cs @@ -1,53 +1,23 @@ // 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.Immutable; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Operations; namespace Microsoft.AspNetCore.Analyzers { - internal class MiddlewareAnalysis : ConfigureMethodAnalysis + internal class MiddlewareAnalysis { - public static MiddlewareAnalysis CreateAndInitialize(StartupAnalysisContext context) + public MiddlewareAnalysis(IMethodSymbol configureMethod, ImmutableArray middleware) { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - - var symbols = context.StartupSymbols; - var analysis = new MiddlewareAnalysis((IMethodSymbol)context.OperationBlockStartAnalysisContext.OwningSymbol); - - var middleware = ImmutableArray.CreateBuilder(); - - context.OperationBlockStartAnalysisContext.RegisterOperationAction(context => - { - // We're looking for usage of extension methods, so we need to look at the 'this' parameter - // rather than invocation.Instance. - if (context.Operation is IInvocationOperation invocation && - invocation.Instance == null && - invocation.Arguments.Length >= 1 && - invocation.Arguments[0].Parameter?.Type == symbols.IApplicationBuilder) - { - middleware.Add(new MiddlewareItem(invocation)); - } - }, OperationKind.Invocation); - - context.OperationBlockStartAnalysisContext.RegisterOperationBlockEndAction(context => - { - analysis.Middleware = middleware.ToImmutable(); - }); - - return analysis; + ConfigureMethod = configureMethod; + Middleware = middleware; } - public MiddlewareAnalysis(IMethodSymbol configureMethod) - : base(configureMethod) - { - } + public INamedTypeSymbol StartupType => ConfigureMethod.ContainingType; - public ImmutableArray Middleware { get; private set; } = ImmutableArray.Empty; + public IMethodSymbol ConfigureMethod { get; } + + public ImmutableArray Middleware { get; } } } diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/MiddlewareAnalyzer.cs b/src/Mvc/Mvc.Analyzers/src/Startup/MiddlewareAnalyzer.cs new file mode 100644 index 0000000000..0a8deb5dc4 --- /dev/null +++ b/src/Mvc/Mvc.Analyzers/src/Startup/MiddlewareAnalyzer.cs @@ -0,0 +1,48 @@ +// 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.Collections.Immutable; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Operations; + +namespace Microsoft.AspNetCore.Analyzers +{ + internal class MiddlewareAnalyzer + { + private readonly StartupAnalysisBuilder _context; + + public MiddlewareAnalyzer(StartupAnalysisBuilder context) + { + _context = context; + } + + public void AnalyzeConfigureMethod(OperationBlockStartAnalysisContext context) + { + var configureMethod = (IMethodSymbol)context.OwningSymbol; + var middleware = ImmutableArray.CreateBuilder(); + + // Note: this is a simple source-order implementation. We don't attempt perform data flow + // analysis in order to determine the actual order in which middleware are ordered. + // + // This can currently be confused by things like Map(...) + context.RegisterOperationAction(context => + { + // We're looking for usage of extension methods, so we need to look at the 'this' parameter + // rather than invocation.Instance. + if (context.Operation is IInvocationOperation invocation && + invocation.Instance == null && + invocation.Arguments.Length >= 1 && + invocation.Arguments[0].Parameter?.Type == _context.StartupSymbols.IApplicationBuilder) + { + middleware.Add(new MiddlewareItem(invocation)); + } + }, OperationKind.Invocation); + + context.RegisterOperationBlockEndAction(context => + { + _context.ReportAnalysis(new MiddlewareAnalysis(configureMethod, middleware.ToImmutable())); + }); + } + } +} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/MvcOptionsAnalysis.cs b/src/Mvc/Mvc.Analyzers/src/Startup/MvcOptionsAnalysis.cs deleted file mode 100644 index d5dd63375b..0000000000 --- a/src/Mvc/Mvc.Analyzers/src/Startup/MvcOptionsAnalysis.cs +++ /dev/null @@ -1,45 +0,0 @@ -// 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.Mvc.Analyzers; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Operations; - -namespace Microsoft.AspNetCore.Analyzers -{ - internal class MvcOptionsAnalysis : ConfigureServicesMethodAnalysis - { - public static MvcOptionsAnalysis CreateAndInitialize(StartupAnalysisContext context) - { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - - var analysis = new MvcOptionsAnalysis((IMethodSymbol)context.OperationBlockStartAnalysisContext.OwningSymbol); - - context.OperationBlockStartAnalysisContext.RegisterOperationAction(context => - { - if (context.Operation is ISimpleAssignmentOperation operation && - operation.Value.ConstantValue.HasValue && - operation.Target is IPropertyReferenceOperation property && - property.Member?.Name == SymbolNames.EnableEndpointRoutingProperty) - { - analysis.EndpointRoutingEnabled = operation.Value.ConstantValue.Value as bool?; - } - - }, OperationKind.SimpleAssignment); - - return analysis; - } - - public MvcOptionsAnalysis(IMethodSymbol configureServicesMethod) - : base(configureServicesMethod) - { - } - - public bool? EndpointRoutingEnabled { get; private set; } - } -} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/ConfigureServicesMethodAnalysis.cs b/src/Mvc/Mvc.Analyzers/src/Startup/OptionsAnalysis.cs similarity index 53% rename from src/Mvc/Mvc.Analyzers/src/Startup/ConfigureServicesMethodAnalysis.cs rename to src/Mvc/Mvc.Analyzers/src/Startup/OptionsAnalysis.cs index ebe773474b..08f0e11e95 100644 --- a/src/Mvc/Mvc.Analyzers/src/Startup/ConfigureServicesMethodAnalysis.cs +++ b/src/Mvc/Mvc.Analyzers/src/Startup/OptionsAnalysis.cs @@ -1,18 +1,23 @@ // 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.Collections.Immutable; using Microsoft.CodeAnalysis; namespace Microsoft.AspNetCore.Analyzers { - internal abstract class ConfigureServicesMethodAnalysis : StartupComputedAnalysis + internal class OptionsAnalysis { - protected ConfigureServicesMethodAnalysis(IMethodSymbol configureServicesMethod) - : base(configureServicesMethod.ContainingType) + public OptionsAnalysis(IMethodSymbol configureServicesMethod, ImmutableArray options) { ConfigureServicesMethod = configureServicesMethod; + Options = options; } + public INamedTypeSymbol StartupType => ConfigureServicesMethod.ContainingType; + public IMethodSymbol ConfigureServicesMethod { get; } + + public ImmutableArray Options { get; } } } diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/OptionsAnalyzer.cs b/src/Mvc/Mvc.Analyzers/src/Startup/OptionsAnalyzer.cs new file mode 100644 index 0000000000..a6649c0194 --- /dev/null +++ b/src/Mvc/Mvc.Analyzers/src/Startup/OptionsAnalyzer.cs @@ -0,0 +1,43 @@ +// 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.Collections.Immutable; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Operations; + +namespace Microsoft.AspNetCore.Analyzers +{ + internal class OptionsAnalyzer + { + private readonly StartupAnalysisBuilder _context; + + public OptionsAnalyzer(StartupAnalysisBuilder context) + { + _context = context; + } + + public void AnalyzeConfigureServices(OperationBlockStartAnalysisContext context) + { + var configureServicesMethod = (IMethodSymbol)context.OwningSymbol; + var options = ImmutableArray.CreateBuilder(); + context.RegisterOperationAction(context => + { + if (context.Operation is ISimpleAssignmentOperation operation && + operation.Value.ConstantValue.HasValue && + operation.Target is IPropertyReferenceOperation property && + property.Property?.ContainingType?.Name != null && + property.Property.ContainingType.Name.EndsWith("Options")) + { + options.Add(new OptionsItem(property.Property, operation.Value.ConstantValue.Value)); + } + + }, OperationKind.SimpleAssignment); + + context.RegisterOperationBlockEndAction(context => + { + _context.ReportAnalysis(new OptionsAnalysis(configureServicesMethod, options.ToImmutable())); + }); + } + } +} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/OptionsFacts.cs b/src/Mvc/Mvc.Analyzers/src/Startup/OptionsFacts.cs new file mode 100644 index 0000000000..da95216f73 --- /dev/null +++ b/src/Mvc/Mvc.Analyzers/src/Startup/OptionsFacts.cs @@ -0,0 +1,27 @@ +// 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.Mvc.Analyzers; +using Microsoft.CodeAnalysis; + +namespace Microsoft.AspNetCore.Analyzers +{ + internal static class OptionsFacts + { + public static bool IsEndpointRoutingExplicitlyDisabled(OptionsAnalysis analysis) + { + for (var i = 0; i < analysis.Options.Length; i++) + { + var item = analysis.Options[i]; + if (string.Equals(item.OptionsType.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat), SymbolNames.MvcOptions) && + string.Equals(item.Property.Name, SymbolNames.EnableEndpointRoutingProperty, StringComparison.Ordinal)) + { + return item.ConstantValue as bool? == false; + } + } + + return false; + } + } +} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/OptionsItem.cs b/src/Mvc/Mvc.Analyzers/src/Startup/OptionsItem.cs new file mode 100644 index 0000000000..d39850339f --- /dev/null +++ b/src/Mvc/Mvc.Analyzers/src/Startup/OptionsItem.cs @@ -0,0 +1,22 @@ +// 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.CodeAnalysis; + +namespace Microsoft.AspNetCore.Analyzers +{ + internal class OptionsItem + { + public OptionsItem(IPropertySymbol property, object constantValue) + { + Property = property; + ConstantValue = constantValue; + } + + public INamedTypeSymbol OptionsType => Property.ContainingType; + + public IPropertySymbol Property { get; } + + public object ConstantValue { get; } + } +} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/ServicesAnalysis.cs b/src/Mvc/Mvc.Analyzers/src/Startup/ServicesAnalysis.cs index c0499c9bf9..2cb58ca5d5 100644 --- a/src/Mvc/Mvc.Analyzers/src/Startup/ServicesAnalysis.cs +++ b/src/Mvc/Mvc.Analyzers/src/Startup/ServicesAnalysis.cs @@ -1,52 +1,23 @@ // 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.Immutable; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Operations; namespace Microsoft.AspNetCore.Analyzers { - internal class ServicesAnalysis : ConfigureServicesMethodAnalysis + internal class ServicesAnalysis { - public static ServicesAnalysis CreateAndInitialize(StartupAnalysisContext context) + public ServicesAnalysis(IMethodSymbol configureServicesMethod, ImmutableArray services) { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - - var symbols = context.StartupSymbols; - var analysis = new ServicesAnalysis((IMethodSymbol)context.OperationBlockStartAnalysisContext.OwningSymbol); - - var services = ImmutableArray.CreateBuilder(); - context.OperationBlockStartAnalysisContext.RegisterOperationAction(context => - { - // We're looking for usage of extension methods, so we need to look at the 'this' parameter - // rather than invocation.Instance. - if (context.Operation is IInvocationOperation invocation && - invocation.Instance == null && - invocation.Arguments.Length >= 1 && - invocation.Arguments[0].Parameter?.Type == symbols.IServiceCollection) - { - services.Add(new ServicesItem(invocation)); - } - }, OperationKind.Invocation); - - context.OperationBlockStartAnalysisContext.RegisterOperationBlockEndAction(context => - { - analysis.Services = services.ToImmutable(); - }); - - return analysis; + ConfigureServicesMethod = configureServicesMethod; + Services = services; } - public ServicesAnalysis(IMethodSymbol configureServicesMethod) - : base(configureServicesMethod) - { - } + public INamedTypeSymbol StartupType => ConfigureServicesMethod.ContainingType; - public ImmutableArray Services { get; private set; } = ImmutableArray.Empty; + public IMethodSymbol ConfigureServicesMethod { get; } + + public ImmutableArray Services { get; } } } diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/ServicesAnalyzer.cs b/src/Mvc/Mvc.Analyzers/src/Startup/ServicesAnalyzer.cs new file mode 100644 index 0000000000..dc79cf4727 --- /dev/null +++ b/src/Mvc/Mvc.Analyzers/src/Startup/ServicesAnalyzer.cs @@ -0,0 +1,43 @@ +// 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.Collections.Immutable; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Operations; + +namespace Microsoft.AspNetCore.Analyzers +{ + internal class ServicesAnalyzer + { + private readonly StartupAnalysisBuilder _context; + + public ServicesAnalyzer(StartupAnalysisBuilder context) + { + _context = context; + } + + public void AnalyzeConfigureServices(OperationBlockStartAnalysisContext context) + { + var configureServicesMethod = (IMethodSymbol)context.OwningSymbol; + var services = ImmutableArray.CreateBuilder(); + context.RegisterOperationAction(context => + { + // We're looking for usage of extension methods, so we need to look at the 'this' parameter + // rather than invocation.Instance. + if (context.Operation is IInvocationOperation invocation && + invocation.Instance == null && + invocation.Arguments.Length >= 1 && + invocation.Arguments[0].Parameter?.Type == _context.StartupSymbols.IServiceCollection) + { + services.Add(new ServicesItem(invocation)); + } + }, OperationKind.Invocation); + + context.RegisterOperationBlockEndAction(context => + { + _context.ReportAnalysis(new ServicesAnalysis(configureServicesMethod, services.ToImmutable())); + }); + } + } +} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalysis.cs b/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalysis.cs new file mode 100644 index 0000000000..9ddc03e04e --- /dev/null +++ b/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalysis.cs @@ -0,0 +1,56 @@ +// 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.Collections.Immutable; +using Microsoft.CodeAnalysis; + +namespace Microsoft.AspNetCore.Analyzers +{ + internal class StartupAnalysis + { + private ImmutableDictionary> _analysesByType; + + public StartupAnalysis( + StartupSymbols startupSymbols, + ImmutableDictionary> analysesByType) + { + StartupSymbols = startupSymbols; + _analysesByType = analysesByType; + } + + public StartupSymbols StartupSymbols { get; } + + public T? GetRelatedSingletonAnalysis(INamedTypeSymbol type) where T : class + { + if (_analysesByType.TryGetValue(type, out var list)) + { + for (var i = 0; i < list.Length; i++) + { + if (list[i] is T item) + { + return item; + } + } + } + + return null; + } + + public ImmutableArray GetRelatedAnalyses(INamedTypeSymbol type) where T : class + { + var items = ImmutableArray.CreateBuilder(); + if (_analysesByType.TryGetValue(type, out var list)) + { + for (var i = 0; i < list.Length; i++) + { + if (list[i] is T item) + { + items.Add(item); + } + } + } + + return items.ToImmutable(); + } + } +} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalysisBuilder.cs b/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalysisBuilder.cs new file mode 100644 index 0000000000..e5b1217dd7 --- /dev/null +++ b/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalysisBuilder.cs @@ -0,0 +1,71 @@ +// 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.Collections.Generic; +using System.Collections.Immutable; +using Microsoft.CodeAnalysis; + +namespace Microsoft.AspNetCore.Analyzers +{ + internal class StartupAnalysisBuilder + { + private readonly Dictionary> _analysesByType; + private readonly StartupAnalzyer _analyzer; + private readonly object _lock; + + public StartupAnalysisBuilder(StartupAnalzyer analyzer, StartupSymbols startupSymbols) + { + _analyzer = analyzer; + StartupSymbols = startupSymbols; + + _analysesByType = new Dictionary>(); + _lock = new object(); + } + + public StartupSymbols StartupSymbols { get; } + + public StartupAnalysis Build() + { + lock (_lock) + { + return new StartupAnalysis( + StartupSymbols, + _analysesByType.ToImmutableDictionary( + k => k.Key, + v => v.Value.ToImmutableArray())); + } + } + + public void ReportAnalysis(ServicesAnalysis analysis) + { + ReportAnalysisCore(analysis.StartupType, analysis); + _analyzer.OnServicesAnalysisCompleted(analysis); + } + + public void ReportAnalysis(OptionsAnalysis analysis) + { + ReportAnalysisCore(analysis.StartupType, analysis); + _analyzer.OnOptionsAnalysisCompleted(analysis); + } + + public void ReportAnalysis(MiddlewareAnalysis analysis) + { + ReportAnalysisCore(analysis.StartupType, analysis); + _analyzer.OnMiddlewareAnalysisCompleted(analysis); + } + + private void ReportAnalysisCore(INamedTypeSymbol type, object analysis) + { + lock (_lock) + { + if (!_analysesByType.TryGetValue(type, out var list)) + { + list = new List(); + _analysesByType.Add(type, list); + } + + list.Add(analysis); + } + } + } +} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalysisContext.cs b/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalysisContext.cs deleted file mode 100644 index 12dc164ba9..0000000000 --- a/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalysisContext.cs +++ /dev/null @@ -1,22 +0,0 @@ -// 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.CodeAnalysis.Diagnostics; - -namespace Microsoft.AspNetCore.Analyzers -{ - internal class StartupAnalysisContext - { -#pragma warning disable RS1012 // Start action has no registered actions. - public StartupAnalysisContext(OperationBlockStartAnalysisContext operationBlockStartAnalysisContext, StartupSymbols startupSymbols) - { - OperationBlockStartAnalysisContext = operationBlockStartAnalysisContext; - StartupSymbols = startupSymbols; - } - - public OperationBlockStartAnalysisContext OperationBlockStartAnalysisContext { get; } - - public StartupSymbols StartupSymbols { get; } -#pragma warning restore RS1012 // Start action has no registered actions. - } -} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalyzer.Diagnostics.cs b/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalyzer.Diagnostics.cs index 1a3432ff42..0a04924177 100644 --- a/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalyzer.Diagnostics.cs +++ b/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalyzer.Diagnostics.cs @@ -1,6 +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.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; @@ -8,23 +9,39 @@ namespace Microsoft.AspNetCore.Analyzers { public partial class StartupAnalzyer : DiagnosticAnalyzer { - internal readonly static DiagnosticDescriptor UnsupportedUseMvcWithEndpointRouting = new DiagnosticDescriptor( - "MVC1005", - "Cannot use UseMvc with Endpoint Routing.", - "Using '{0}' to configure MVC is not supported while using Endpoint Routing. To continue using '{0}', please set 'MvcOptions.EnableEndpointRouting = false' inside '{1}'.", - "Usage", - DiagnosticSeverity.Warning, - isEnabledByDefault: true, - helpLinkUri: "https://aka.ms/YJggeFn"); + internal static class Diagnostics + { + public static readonly ImmutableArray SupportedDiagnostics; - internal readonly static DiagnosticDescriptor BuildServiceProviderShouldNotCalledInConfigureServicesMethod = new DiagnosticDescriptor( - "MVC1007", - "Do not call 'IServiceCollection.BuildServiceProvider' in 'ConfigureServices'", - "Calling 'BuildServiceProvider' from application code results in an additional copy of singleton services being created. Consider alternatives such as dependency injecting services as parameters to 'Configure'.", - "Design", - DiagnosticSeverity.Warning, - isEnabledByDefault: true, - helpLinkUri: "https://aka.ms/AA5k895" - ); + static Diagnostics() + { + SupportedDiagnostics = ImmutableArray.Create(new[] + { + // ASP + BuildServiceProviderShouldNotCalledInConfigureServicesMethod, + + // MVC + UnsupportedUseMvcWithEndpointRouting, + }); + } + + internal readonly static DiagnosticDescriptor BuildServiceProviderShouldNotCalledInConfigureServicesMethod = new DiagnosticDescriptor( + "ASP0000", + "Do not call 'IServiceCollection.BuildServiceProvider' in 'ConfigureServices'", + "Calling 'BuildServiceProvider' from application code results in an additional copy of singleton services being created. Consider alternatives such as dependency injecting services as parameters to 'Configure'.", + "Design", + DiagnosticSeverity.Warning, + isEnabledByDefault: true, + helpLinkUri: "https://aka.ms/AA5k895"); + + internal readonly static DiagnosticDescriptor UnsupportedUseMvcWithEndpointRouting = new DiagnosticDescriptor( + "MVC1005", + "Cannot use UseMvc with Endpoint Routing.", + "Using '{0}' to configure MVC is not supported while using Endpoint Routing. To continue using '{0}', please set 'MvcOptions.EnableEndpointRounting = false' inside '{1}'.", + "Usage", + DiagnosticSeverity.Warning, + isEnabledByDefault: true, + helpLinkUri: "https://aka.ms/YJggeFn"); + } } } diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalyzer.Events.cs b/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalyzer.Events.cs index 0a8c0dcde5..9e2a554948 100644 --- a/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalyzer.Events.cs +++ b/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalyzer.Events.cs @@ -7,27 +7,42 @@ using Microsoft.CodeAnalysis.Diagnostics; namespace Microsoft.AspNetCore.Analyzers { + // Events for testability. Allows us to unit test the data we gather from analysis. public partial class StartupAnalzyer : DiagnosticAnalyzer { - internal event EventHandler? AnalysisStarted; - - private void OnAnalysisStarted(StartupComputedAnalysis analysis) - { - AnalysisStarted?.Invoke(this, analysis); - } - internal event EventHandler? ConfigureServicesMethodFound; - private void OnConfigureServicesMethodFound(IMethodSymbol method) + internal void OnConfigureServicesMethodFound(IMethodSymbol method) { ConfigureServicesMethodFound?.Invoke(this, method); } + internal event EventHandler? ServicesAnalysisCompleted; + + internal void OnServicesAnalysisCompleted(ServicesAnalysis analysis) + { + ServicesAnalysisCompleted?.Invoke(this, analysis); + } + + internal event EventHandler? OptionsAnalysisCompleted; + + internal void OnOptionsAnalysisCompleted(OptionsAnalysis analysis) + { + OptionsAnalysisCompleted?.Invoke(this, analysis); + } + internal event EventHandler? ConfigureMethodFound; - private void OnConfigureMethodFound(IMethodSymbol method) + internal void OnConfigureMethodFound(IMethodSymbol method) { ConfigureMethodFound?.Invoke(this, method); } + + internal event EventHandler? MiddlewareAnalysisCompleted; + + internal void OnMiddlewareAnalysisCompleted(MiddlewareAnalysis analysis) + { + MiddlewareAnalysisCompleted?.Invoke(this, analysis); + } } } diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalzyer.cs b/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalzyer.cs index 17c6bb7a74..3cbb83c180 100644 --- a/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalzyer.cs +++ b/src/Mvc/Mvc.Analyzers/src/Startup/StartupAnalzyer.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Concurrent; using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; @@ -12,46 +11,16 @@ namespace Microsoft.AspNetCore.Analyzers [DiagnosticAnalyzer(LanguageNames.CSharp)] public partial class StartupAnalzyer : DiagnosticAnalyzer { -#pragma warning disable RS1008 // Avoid storing per-compilation data into the fields of a diagnostic analyzer. - private readonly static Func[] ConfigureServicesMethodAnalysisFactories = new Func[] - { - ServicesAnalysis.CreateAndInitialize, - MvcOptionsAnalysis.CreateAndInitialize, - }; - - private readonly static Func[] ConfigureMethodAnalysisFactories = new Func[] - { - MiddlewareAnalysis.CreateAndInitialize, - }; - - private readonly static Func, StartupDiagnosticValidator>[] DiagnosticValidatorFactories = new Func, StartupDiagnosticValidator>[] - { - UseMvcDiagnosticValidator.CreateAndInitialize, - BuildServiceProviderValidator.CreateAndInitialize - }; - -#pragma warning restore RS1008 // Avoid storing per-compilation data into the fields of a diagnostic analyzer. - - public StartupAnalzyer() - { - SupportedDiagnostics = ImmutableArray.Create(new[] - { - UnsupportedUseMvcWithEndpointRouting, - BuildServiceProviderShouldNotCalledInConfigureServicesMethod - }); - - // By default the analyzer will only run for files ending with Startup.cs - // Can be overriden for unit testing other file names - // Analzyer only runs for C# so limiting to *.cs file is fine - StartupFilePredicate = path => path.EndsWith("Startup.cs", StringComparison.OrdinalIgnoreCase); - } - - internal Func StartupFilePredicate { get; set; } - - public override ImmutableArray SupportedDiagnostics { get; } + public override ImmutableArray SupportedDiagnostics => Diagnostics.SupportedDiagnostics; public override void Initialize(AnalysisContext context) { + if (context == null) + { + throw new ArgumentNullException(nameof(context)); + } + + context.EnableConcurrentExecution(); context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None); context.RegisterCompilationStartAction(OnCompilationStart); } @@ -61,91 +30,61 @@ namespace Microsoft.AspNetCore.Analyzers var symbols = new StartupSymbols(context.Compilation); // Don't run analyzer if ASP.NET Core types cannot be found - if (symbols.IServiceCollection == null || symbols.IApplicationBuilder == null) + if (!symbols.HasRequiredSymbols) { return; } - // This analyzer is a general-purpose framework that functions by: - // 1. Discovering Startup methods (ConfigureServices, Configure) - // 2. Launching additional analyses of these Startup methods and collecting results - // 3. Running a final pass to add diagnostics based on computed state - var analyses = new ConcurrentBag(); - - context.RegisterOperationBlockStartAction(context => + context.RegisterSymbolStartAction(context => { - AnalyzeStartupMethods(context, symbols, analyses); - }); - - // Run after analyses have had a chance to finish to add diagnostics. - context.RegisterCompilationEndAction(analysisContext => - { - RunAnalysis(analysisContext, analyses); - }); - } - - private static void RunAnalysis(CompilationAnalysisContext analysisContext, ConcurrentBag analyses) - { - for (var i = 0; i < DiagnosticValidatorFactories.Length; i++) - { - var validator = DiagnosticValidatorFactories[i].Invoke(analysisContext, analyses); - } - } - - private void AnalyzeStartupMethods(OperationBlockStartAnalysisContext context, StartupSymbols symbols, ConcurrentBag analyses) - { - if (!IsStartupFile(context)) - { - return; - } - - if (context.OwningSymbol.Kind != SymbolKind.Method) - { - return; - } - - var startupAnalysisContext = new StartupAnalysisContext(context, symbols); - - var method = (IMethodSymbol)context.OwningSymbol; - if (StartupFacts.IsConfigureServices(symbols, method)) - { - for (var i = 0; i < ConfigureServicesMethodAnalysisFactories.Length; i++) + var type = (INamedTypeSymbol)context.Symbol; + if (!StartupFacts.IsStartupClass(symbols, type)) { - var analysis = ConfigureServicesMethodAnalysisFactories[i].Invoke(startupAnalysisContext); - analyses.Add(analysis); - - OnAnalysisStarted(analysis); + // Not a startup class, nothing to do. + return; } - OnConfigureServicesMethodFound(method); - } + // This analyzer fans out a bunch of jobs. The context will capture the results of doing analysis + // on the startup code, so that other analyzers that run later can examine them. + var builder = new StartupAnalysisBuilder(this, symbols); - if (StartupFacts.IsConfigure(symbols, method)) - { - for (var i = 0; i < ConfigureMethodAnalysisFactories.Length; i++) + var services = new ServicesAnalyzer(builder); + var options = new OptionsAnalyzer(builder); + var middleware = new MiddlewareAnalyzer(builder); + + context.RegisterOperationBlockStartAction(context => { - var analysis = ConfigureMethodAnalysisFactories[i].Invoke(startupAnalysisContext); - analyses.Add(analysis); + if (context.OwningSymbol.Kind != SymbolKind.Method) + { + return; + } - OnAnalysisStarted(analysis); - } + var method = (IMethodSymbol)context.OwningSymbol; + if (StartupFacts.IsConfigureServices(symbols, method)) + { + OnConfigureServicesMethodFound(method); - OnConfigureMethodFound(method); - } - } -#pragma warning disable RS1012 // Start action has no registered actions. - private bool IsStartupFile(OperationBlockStartAnalysisContext context) - { - foreach (var location in context.OwningSymbol.Locations) - { - if (location.IsInSource && StartupFilePredicate(location.SourceTree.FilePath)) + services.AnalyzeConfigureServices(context); + options.AnalyzeConfigureServices(context); + } + + if (StartupFacts.IsConfigure(symbols, method)) + { + OnConfigureMethodFound(method); + + middleware.AnalyzeConfigureMethod(context); + } + }); + + // Run after analyses have had a chance to finish to add diagnostics. + context.RegisterSymbolEndAction(context => { - return true; - } - } + var analysis = builder.Build(); + new UseMvcAnalyzer(analysis).AnalyzeSymbol(context); + new BuildServiceProviderValidator(analysis).AnalyzeSymbol(context); + }); - return false; + }, SymbolKind.NamedType); } -#pragma warning restore RS1012 // Start action has no registered actions. } } diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/StartupComputedAnalysis.cs b/src/Mvc/Mvc.Analyzers/src/Startup/StartupComputedAnalysis.cs deleted file mode 100644 index 0bd9efb687..0000000000 --- a/src/Mvc/Mvc.Analyzers/src/Startup/StartupComputedAnalysis.cs +++ /dev/null @@ -1,17 +0,0 @@ -// 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.CodeAnalysis; - -namespace Microsoft.AspNetCore.Analyzers -{ - internal abstract class StartupComputedAnalysis - { - protected StartupComputedAnalysis(INamedTypeSymbol enclosingType) - { - EnclosingType = enclosingType; - } - - public INamedTypeSymbol EnclosingType { get; } - } -} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/StartupDiagnosticValidator.cs b/src/Mvc/Mvc.Analyzers/src/Startup/StartupDiagnosticValidator.cs deleted file mode 100644 index 56e6dcda7e..0000000000 --- a/src/Mvc/Mvc.Analyzers/src/Startup/StartupDiagnosticValidator.cs +++ /dev/null @@ -1,9 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Analyzers -{ - internal abstract class StartupDiagnosticValidator - { - } -} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/StartupFacts.cs b/src/Mvc/Mvc.Analyzers/src/Startup/StartupFacts.cs index 4fc93ad6b6..ba13dc63be 100644 --- a/src/Mvc/Mvc.Analyzers/src/Startup/StartupFacts.cs +++ b/src/Mvc/Mvc.Analyzers/src/Startup/StartupFacts.cs @@ -2,13 +2,41 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Mvc.Analyzers; using Microsoft.CodeAnalysis; namespace Microsoft.AspNetCore.Analyzers { internal static class StartupFacts { + public static bool IsStartupClass(StartupSymbols symbols, INamedTypeSymbol type) + { + if (symbols == null) + { + throw new ArgumentNullException(nameof(symbols)); + } + + if (type == null) + { + throw new ArgumentNullException(nameof(type)); + } + + // It's not good enough to just look for ConfigureServices or Configure as a hueristic. + // ConfigureServices might not appear in trivial cases, and Configure might be named ConfigureDevelopment + // or something similar. + // + // Since we already are analyzing the symbol it should be cheap to do a quick pass over the members. + var members = type.GetMembers(); + for (var i = 0; i < members.Length; i++) + { + if (members[i] is IMethodSymbol method && (IsConfigureServices(symbols, method) || IsConfigure(symbols, method))) + { + return true; + } + } + + return false; + } + public static bool IsConfigureServices(StartupSymbols symbols, IMethodSymbol symbol) { if (symbol == null) @@ -21,7 +49,7 @@ namespace Microsoft.AspNetCore.Analyzers return false; } - if (!string.Equals(symbol.Name, SymbolNames.ConfigureServicesMethod, StringComparison.Ordinal)) + if (!string.Equals(symbol.Name, "ConfigureServices", StringComparison.Ordinal)) { return false; } @@ -51,7 +79,7 @@ namespace Microsoft.AspNetCore.Analyzers return false; } - if (symbol.Name == null || !symbol.Name.StartsWith(SymbolNames.ConfigureMethod, StringComparison.Ordinal)) + if (symbol.Name == null || !symbol.Name.StartsWith("Configure", StringComparison.Ordinal)) { return false; } @@ -59,7 +87,7 @@ namespace Microsoft.AspNetCore.Analyzers // IApplicationBuilder can appear in any parameter for (var i = 0; i < symbol.Parameters.Length; i++) { - if (symbol.Parameters[i].Type == symbols.IApplicationBuilder) + if (symbol.Parameters[i].Type == symbols.IApplicationBuilder) { return true; } diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/StartupSymbols.cs b/src/Mvc/Mvc.Analyzers/src/Startup/StartupSymbols.cs index 5595cd1a6d..f528c9fa48 100644 --- a/src/Mvc/Mvc.Analyzers/src/Startup/StartupSymbols.cs +++ b/src/Mvc/Mvc.Analyzers/src/Startup/StartupSymbols.cs @@ -1,7 +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 Microsoft.AspNetCore.Mvc.Analyzers; using Microsoft.CodeAnalysis; namespace Microsoft.AspNetCore.Analyzers @@ -10,15 +9,15 @@ namespace Microsoft.AspNetCore.Analyzers { public StartupSymbols(Compilation compilation) { - IApplicationBuilder = compilation.GetTypeByMetadataName(SymbolNames.IApplicationBuilder); - IServiceCollection = compilation.GetTypeByMetadataName(SymbolNames.IServiceCollection); - MvcOptions = compilation.GetTypeByMetadataName(SymbolNames.MvcOptions); + IApplicationBuilder = compilation.GetTypeByMetadataName("Microsoft.AspNetCore.Builder.IApplicationBuilder"); + IServiceCollection = compilation.GetTypeByMetadataName("Microsoft.Extensions.DependencyInjection.IServiceCollection"); + MvcOptions = compilation.GetTypeByMetadataName("Microsoft.AspNetCore.Mvc.MvcOptions"); } + public bool HasRequiredSymbols => IApplicationBuilder != null && IServiceCollection != null; + public INamedTypeSymbol IApplicationBuilder { get; } - public INamedTypeSymbol IServiceCollection { get; } - public INamedTypeSymbol MvcOptions { get; } } } diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/UseMvcAnalyzer.cs b/src/Mvc/Mvc.Analyzers/src/Startup/UseMvcAnalyzer.cs new file mode 100644 index 0000000000..4cbb702ad1 --- /dev/null +++ b/src/Mvc/Mvc.Analyzers/src/Startup/UseMvcAnalyzer.cs @@ -0,0 +1,55 @@ +// 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.Diagnostics; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Diagnostics; + +namespace Microsoft.AspNetCore.Analyzers +{ + internal class UseMvcAnalyzer + { + private readonly StartupAnalysis _context; + + public UseMvcAnalyzer(StartupAnalysis context) + { + _context = context; + } + + public void AnalyzeSymbol(SymbolAnalysisContext context) + { + Debug.Assert(context.Symbol.Kind == SymbolKind.NamedType); + Debug.Assert(StartupFacts.IsStartupClass(_context.StartupSymbols, (INamedTypeSymbol)context.Symbol)); + + var type = (INamedTypeSymbol)context.Symbol; + + var optionsAnalysis = _context.GetRelatedSingletonAnalysis(type); + if (optionsAnalysis == null) + { + return; + } + + // Find the middleware analysis foreach of the Configure methods defined by this class and validate. + // + // Note that this doesn't attempt to handle inheritance scenarios. + foreach (var middlewareAnalysis in _context.GetRelatedAnalyses(type)) + { + foreach (var middlewareItem in middlewareAnalysis.Middleware) + { + if (middlewareItem.UseMethod.Name == "UseMvc" || middlewareItem.UseMethod.Name == "UseMvcWithDefaultRoute") + { + // Report a diagnostic if it's unclear that the user turned off Endpoint Routing. + if (!OptionsFacts.IsEndpointRoutingExplicitlyDisabled(optionsAnalysis)) + { + context.ReportDiagnostic(Diagnostic.Create( + StartupAnalzyer.Diagnostics.UnsupportedUseMvcWithEndpointRouting, + middlewareItem.Operation.Syntax.GetLocation(), + middlewareItem.UseMethod.Name, + optionsAnalysis.ConfigureServicesMethod.Name)); + } + } + } + } + } + } +} diff --git a/src/Mvc/Mvc.Analyzers/src/Startup/UseMvcDiagnosticValidator.cs b/src/Mvc/Mvc.Analyzers/src/Startup/UseMvcDiagnosticValidator.cs deleted file mode 100644 index 96464f274e..0000000000 --- a/src/Mvc/Mvc.Analyzers/src/Startup/UseMvcDiagnosticValidator.cs +++ /dev/null @@ -1,51 +0,0 @@ -// 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.Concurrent; -using System.Linq; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; - -namespace Microsoft.AspNetCore.Analyzers -{ - internal class UseMvcDiagnosticValidator : StartupDiagnosticValidator - { - public static UseMvcDiagnosticValidator CreateAndInitialize(CompilationAnalysisContext context, ConcurrentBag analyses) - { - if (analyses == null) - { - throw new ArgumentNullException(nameof(analyses)); - } - - var validator = new UseMvcDiagnosticValidator(); - - foreach (var mvcOptionsAnalysis in analyses.OfType()) - { - // Each analysis of the options is one-per-class (in user code). Find the middleware analysis foreach of the Configure methods - // defined by this class and validate. - // - // Note that this doesn't attempt to handle inheritance scenarios. - foreach (var middlewareAnalsysis in analyses.OfType().Where(m => m.EnclosingType == mvcOptionsAnalysis.EnclosingType)) - { - foreach (var middlewareItem in middlewareAnalsysis.Middleware) - { - if ((middlewareItem.UseMethod.Name == "UseMvc" || middlewareItem.UseMethod.Name == "UseMvcWithDefaultRoute") && - - // Report a diagnostic if it's unclear that the user turned off Endpoint Routing. - (mvcOptionsAnalysis.EndpointRoutingEnabled == true || mvcOptionsAnalysis.EndpointRoutingEnabled == null)) - { - context.ReportDiagnostic(Diagnostic.Create( - StartupAnalzyer.UnsupportedUseMvcWithEndpointRouting, - middlewareItem.Operation.Syntax.GetLocation(), - middlewareItem.UseMethod.Name, - mvcOptionsAnalysis.ConfigureServicesMethod.Name)); - } - } - } - } - - return validator; - } - } -} diff --git a/src/Mvc/Mvc.Analyzers/test/StartupAnalyzerTest.cs b/src/Mvc/Mvc.Analyzers/test/StartupAnalyzerTest.cs index 16c7af384d..ef76ab0ff0 100644 --- a/src/Mvc/Mvc.Analyzers/test/StartupAnalyzerTest.cs +++ b/src/Mvc/Mvc.Analyzers/test/StartupAnalyzerTest.cs @@ -17,14 +17,15 @@ namespace Microsoft.AspNetCore.Analyzers public StartupAnalyzerTest() { StartupAnalyzer = new StartupAnalzyer(); - StartupAnalyzer.StartupFilePredicate = path => path.Equals("Test.cs", StringComparison.Ordinal); Runner = new MvcDiagnosticAnalyzerRunner(StartupAnalyzer); - Analyses = new ConcurrentBag(); + Analyses = new ConcurrentBag(); ConfigureServicesMethods = new ConcurrentBag(); ConfigureMethods = new ConcurrentBag(); - StartupAnalyzer.AnalysisStarted += (sender, analysis) => Analyses.Add(analysis); + StartupAnalyzer.ServicesAnalysisCompleted += (sender, analysis) => Analyses.Add(analysis); + StartupAnalyzer.OptionsAnalysisCompleted += (sender, analysis) => Analyses.Add(analysis); + StartupAnalyzer.MiddlewareAnalysisCompleted += (sender, analysis) => Analyses.Add(analysis); StartupAnalyzer.ConfigureServicesMethodFound += (sender, method) => ConfigureServicesMethods.Add(method); StartupAnalyzer.ConfigureMethodFound += (sender, method) => ConfigureMethods.Add(method); } @@ -33,7 +34,7 @@ namespace Microsoft.AspNetCore.Analyzers private MvcDiagnosticAnalyzerRunner Runner { get; } - private ConcurrentBag Analyses { get; } + private ConcurrentBag Analyses { get; } private ConcurrentBag ConfigureServicesMethods { get; } @@ -87,8 +88,8 @@ namespace Microsoft.AspNetCore.Analyzers var diagnostics = await Runner.GetDiagnosticsAsync(source.Source); // Assert - var mvcOptionsAnalysis = Assert.Single(Analyses.OfType()); - Assert.False(mvcOptionsAnalysis.EndpointRoutingEnabled); + var optionsAnalysis = Assert.Single(Analyses.OfType()); + Assert.True(OptionsFacts.IsEndpointRoutingExplicitlyDisabled(optionsAnalysis)); var middlewareAnalysis = Assert.Single(Analyses.OfType()); var middleware = Assert.Single(middlewareAnalysis.Middleware); @@ -107,8 +108,8 @@ namespace Microsoft.AspNetCore.Analyzers var diagnostics = await Runner.GetDiagnosticsAsync(source.Source); // Assert - var mvcOptionsAnalysis = Assert.Single(Analyses.OfType()); - Assert.False(mvcOptionsAnalysis.EndpointRoutingEnabled); + var optionsAnalysis = Assert.Single(Analyses.OfType()); + Assert.True(OptionsFacts.IsEndpointRoutingExplicitlyDisabled(optionsAnalysis)); var middlewareAnalysis = Assert.Single(Analyses.OfType()); var middleware = Assert.Single(middlewareAnalysis.Middleware); @@ -130,8 +131,8 @@ namespace Microsoft.AspNetCore.Analyzers var diagnostics = await Runner.GetDiagnosticsAsync(source.Source); // Assert - var mvcOptionsAnalysis = Assert.Single(Analyses.OfType()); - Assert.Null(mvcOptionsAnalysis.EndpointRoutingEnabled); + var optionsAnalysis = Assert.Single(Analyses.OfType()); + Assert.False(OptionsFacts.IsEndpointRoutingExplicitlyDisabled(optionsAnalysis)); var middlewareAnalysis = Assert.Single(Analyses.OfType()); var middleware = Assert.Single(middlewareAnalysis.Middleware); @@ -141,7 +142,7 @@ namespace Microsoft.AspNetCore.Analyzers diagnostics, diagnostic => { - Assert.Same(StartupAnalzyer.UnsupportedUseMvcWithEndpointRouting, diagnostic.Descriptor); + Assert.Same(StartupAnalzyer.Diagnostics.UnsupportedUseMvcWithEndpointRouting, diagnostic.Descriptor); AnalyzerAssert.DiagnosticLocation(source.DefaultMarkerLocation, diagnostic.Location); }); } @@ -156,8 +157,8 @@ namespace Microsoft.AspNetCore.Analyzers var diagnostics = await Runner.GetDiagnosticsAsync(source.Source); // Assert - var mvcOptionsAnalysis = Assert.Single(Analyses.OfType()); - Assert.Null(mvcOptionsAnalysis.EndpointRoutingEnabled); + var optionsAnalysis = Assert.Single(Analyses.OfType()); + Assert.False(OptionsFacts.IsEndpointRoutingExplicitlyDisabled(optionsAnalysis)); var middlewareAnalysis = Assert.Single(Analyses.OfType()); @@ -173,7 +174,7 @@ namespace Microsoft.AspNetCore.Analyzers diagnostics, diagnostic => { - Assert.Same(StartupAnalzyer.UnsupportedUseMvcWithEndpointRouting, diagnostic.Descriptor); + Assert.Same(StartupAnalzyer.Diagnostics.UnsupportedUseMvcWithEndpointRouting, diagnostic.Descriptor); AnalyzerAssert.DiagnosticLocation(source.DefaultMarkerLocation, diagnostic.Location); }); } @@ -188,27 +189,28 @@ namespace Microsoft.AspNetCore.Analyzers var diagnostics = await Runner.GetDiagnosticsAsync(source.Source); // Assert - var mvcOptionsAnalysis = Assert.Single(Analyses.OfType()); - Assert.Null(mvcOptionsAnalysis.EndpointRoutingEnabled); + var optionsAnalysis = Assert.Single(Analyses.OfType()); + Assert.False(OptionsFacts.IsEndpointRoutingExplicitlyDisabled(optionsAnalysis)); Assert.Collection( diagnostics, diagnostic => { - Assert.Same(StartupAnalzyer.UnsupportedUseMvcWithEndpointRouting, diagnostic.Descriptor); + Assert.Same(StartupAnalzyer.Diagnostics.UnsupportedUseMvcWithEndpointRouting, diagnostic.Descriptor); AnalyzerAssert.DiagnosticLocation(source.MarkerLocations["MM1"], diagnostic.Location); }, diagnostic => { - Assert.Same(StartupAnalzyer.UnsupportedUseMvcWithEndpointRouting, diagnostic.Descriptor); + Assert.Same(StartupAnalzyer.Diagnostics.UnsupportedUseMvcWithEndpointRouting, diagnostic.Descriptor); AnalyzerAssert.DiagnosticLocation(source.MarkerLocations["MM2"], diagnostic.Location); }, diagnostic => { - Assert.Same(StartupAnalzyer.UnsupportedUseMvcWithEndpointRouting, diagnostic.Descriptor); + Assert.Same(StartupAnalzyer.Diagnostics.UnsupportedUseMvcWithEndpointRouting, diagnostic.Descriptor); AnalyzerAssert.DiagnosticLocation(source.MarkerLocations["MM3"], diagnostic.Location); }); } + [Fact] public async Task StartupAnalyzer_ServicesAnalysis_CallBuildServiceProvider() { @@ -224,10 +226,11 @@ namespace Microsoft.AspNetCore.Analyzers Assert.Collection(diagnostics, diagnostic => { - Assert.Same(StartupAnalzyer.BuildServiceProviderShouldNotCalledInConfigureServicesMethod, diagnostic.Descriptor); + Assert.Same(StartupAnalzyer.Diagnostics.BuildServiceProviderShouldNotCalledInConfigureServicesMethod, diagnostic.Descriptor); AnalyzerAssert.DiagnosticLocation(source.MarkerLocations["MM1"], diagnostic.Location); }); } + private TestSource ReadSource(string fileName) { return MvcTestSource.Read(nameof(StartupAnalyzerTest), fileName); diff --git a/src/Mvc/Mvc.Api.Analyzers/src/AddResponseTypeAttributeCodeFixAction.cs b/src/Mvc/Mvc.Api.Analyzers/src/AddResponseTypeAttributeCodeFixAction.cs index 0e23036cce..1f4c91bfad 100644 --- a/src/Mvc/Mvc.Api.Analyzers/src/AddResponseTypeAttributeCodeFixAction.cs +++ b/src/Mvc/Mvc.Api.Analyzers/src/AddResponseTypeAttributeCodeFixAction.cs @@ -205,7 +205,7 @@ namespace Microsoft.AspNetCore.Mvc.Api.Analyzers SyntaxFactory.ParseName(ApiSymbolNames.ProducesResponseTypeAttribute) .WithAdditionalAnnotations(Simplifier.Annotation), SyntaxFactory.AttributeArgumentList().AddArguments( - + SyntaxFactory.AttributeArgument(statusCodeSyntax))); } From 76408c97295739512721eedb3696bc31bbe1a731 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2019 15:10:15 +0000 Subject: [PATCH 18/76] [master] Update dependencies from aspnet/Blazor aspnet/EntityFrameworkCore (#12185) * Update dependencies from https://github.com/aspnet/Blazor build 20190715.1 - Microsoft.AspNetCore.Blazor.Mono - 0.10.0-preview8.19365.1 * Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20190715.1 - Microsoft.EntityFrameworkCore.Tools - 3.0.0-preview8.19365.1 - Microsoft.EntityFrameworkCore.SqlServer - 3.0.0-preview8.19365.1 - dotnet-ef - 3.0.0-preview8.19365.1 - Microsoft.EntityFrameworkCore - 3.0.0-preview8.19365.1 - Microsoft.EntityFrameworkCore.InMemory - 3.0.0-preview8.19365.1 - Microsoft.EntityFrameworkCore.Relational - 3.0.0-preview8.19365.1 - Microsoft.EntityFrameworkCore.Sqlite - 3.0.0-preview8.19365.1 --- eng/Version.Details.xml | 32 ++++++++++++++++---------------- eng/Versions.props | 16 ++++++++-------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 517e35b6b9..04e75898b3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -9,9 +9,9 @@ --> - + https://github.com/aspnet/Blazor - 7e2a0091dd81c0cb17ceb7bdc4d67aed67dbec66 + 9045a3861427fc95575c07bd0455c98731567969 https://github.com/aspnet/AspNetCore-Tooling @@ -29,33 +29,33 @@ https://github.com/aspnet/AspNetCore-Tooling 688c9a840fb973b0cfe80ddd886f0bd0fc6a7611 - + https://github.com/aspnet/EntityFrameworkCore - 82397922d2549d9572b431594b989a5a6afe9977 + a343995d82f067c6012403f23781b7ea8d23931b - + https://github.com/aspnet/EntityFrameworkCore - 82397922d2549d9572b431594b989a5a6afe9977 + a343995d82f067c6012403f23781b7ea8d23931b - + https://github.com/aspnet/EntityFrameworkCore - 82397922d2549d9572b431594b989a5a6afe9977 + a343995d82f067c6012403f23781b7ea8d23931b - + https://github.com/aspnet/EntityFrameworkCore - 82397922d2549d9572b431594b989a5a6afe9977 + a343995d82f067c6012403f23781b7ea8d23931b - + https://github.com/aspnet/EntityFrameworkCore - 82397922d2549d9572b431594b989a5a6afe9977 + a343995d82f067c6012403f23781b7ea8d23931b - + https://github.com/aspnet/EntityFrameworkCore - 82397922d2549d9572b431594b989a5a6afe9977 + a343995d82f067c6012403f23781b7ea8d23931b - + https://github.com/aspnet/EntityFrameworkCore - 82397922d2549d9572b431594b989a5a6afe9977 + a343995d82f067c6012403f23781b7ea8d23931b https://github.com/aspnet/Extensions diff --git a/eng/Versions.props b/eng/Versions.props index de0b018c66..cb91c450ef 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -85,7 +85,7 @@ 3.0.0-preview8.19364.1 - 0.10.0-preview8.19355.1 + 0.10.0-preview8.19365.1 3.0.0-preview8.19364.3 3.0.0-preview8.19364.3 @@ -149,13 +149,13 @@ 3.0.0-preview8.19364.3 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.4 - 3.0.0-preview8.19364.4 - 3.0.0-preview8.19364.4 - 3.0.0-preview8.19364.4 - 3.0.0-preview8.19364.4 - 3.0.0-preview8.19364.4 - 3.0.0-preview8.19364.4 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 3.0.0-preview8.19364.3 3.0.0-preview8.19364.3 From 01261b5f2ce9cc70461e20014edf28035fa4fd91 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2019 16:45:48 +0000 Subject: [PATCH 19/76] Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20190715.2 (#12191) - Microsoft.EntityFrameworkCore.Tools - 3.0.0-preview8.19365.2 - Microsoft.EntityFrameworkCore.SqlServer - 3.0.0-preview8.19365.2 - dotnet-ef - 3.0.0-preview8.19365.2 - Microsoft.EntityFrameworkCore - 3.0.0-preview8.19365.2 - Microsoft.EntityFrameworkCore.InMemory - 3.0.0-preview8.19365.2 - Microsoft.EntityFrameworkCore.Relational - 3.0.0-preview8.19365.2 - Microsoft.EntityFrameworkCore.Sqlite - 3.0.0-preview8.19365.2 Dependency coherency updates - Microsoft.AspNetCore.Analyzer.Testing - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.ActivatorUtilities.Sources - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Caching.Abstractions - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Caching.Memory - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Caching.SqlServer - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Caching.StackExchangeRedis - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Abstractions - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.AzureKeyVault - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Binder - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.CommandLine - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.EnvironmentVariables - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.FileExtensions - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Ini - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Json - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.KeyPerFile - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.UserSecrets - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration.Xml - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Configuration - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.DependencyInjection.Abstractions - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.DependencyInjection - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.DiagnosticAdapter - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Diagnostics.HealthChecks - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileProviders.Abstractions - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileProviders.Composite - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileProviders.Embedded - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileProviders.Physical - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.FileSystemGlobbing - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Hosting.Abstractions - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Hosting - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.HostFactoryResolver.Sources - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Http - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Localization.Abstractions - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Localization - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Abstractions - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.AzureAppServices - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Configuration - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Console - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Debug - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.EventSource - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.EventLog - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.TraceSource - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Logging.Testing - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.ObjectPool - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Options.ConfigurationExtensions - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Options.DataAnnotations - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Options - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.ParameterDefaultValue.Sources - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.Primitives - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.TypeNameHelper.Sources - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.ValueStopwatch.Sources - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.WebEncoders - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Internal.Extensions.Refs - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.JSInterop - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Mono.WebAssembly.Interop - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.Extensions.DependencyModel - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Ref - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - NETStandard.Library.Ref - 2.1.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0-preview8-27914-06 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Internal.AspNetCore.Analyzers - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) - Microsoft.AspNetCore.Testing - 3.0.0-preview8.19365.1 (parent: Microsoft.EntityFrameworkCore) --- eng/Version.Details.xml | 280 ++++++++++++++++++++-------------------- eng/Versions.props | 144 ++++++++++----------- 2 files changed, 212 insertions(+), 212 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 04e75898b3..69452ee231 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -29,269 +29,269 @@ https://github.com/aspnet/AspNetCore-Tooling 688c9a840fb973b0cfe80ddd886f0bd0fc6a7611 - + https://github.com/aspnet/EntityFrameworkCore - a343995d82f067c6012403f23781b7ea8d23931b + 04eb9ef0032c3f5681f52b7e754b2b5da81738a5 - + https://github.com/aspnet/EntityFrameworkCore - a343995d82f067c6012403f23781b7ea8d23931b + 04eb9ef0032c3f5681f52b7e754b2b5da81738a5 - + https://github.com/aspnet/EntityFrameworkCore - a343995d82f067c6012403f23781b7ea8d23931b + 04eb9ef0032c3f5681f52b7e754b2b5da81738a5 - + https://github.com/aspnet/EntityFrameworkCore - a343995d82f067c6012403f23781b7ea8d23931b + 04eb9ef0032c3f5681f52b7e754b2b5da81738a5 - + https://github.com/aspnet/EntityFrameworkCore - a343995d82f067c6012403f23781b7ea8d23931b + 04eb9ef0032c3f5681f52b7e754b2b5da81738a5 - + https://github.com/aspnet/EntityFrameworkCore - a343995d82f067c6012403f23781b7ea8d23931b + 04eb9ef0032c3f5681f52b7e754b2b5da81738a5 - + https://github.com/aspnet/EntityFrameworkCore - a343995d82f067c6012403f23781b7ea8d23931b + 04eb9ef0032c3f5681f52b7e754b2b5da81738a5 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 https://github.com/dotnet/corefx @@ -385,11 +385,11 @@ https://github.com/dotnet/corefx c14b80faff694bae4e085bad221e2e83410e5f33 - + https://github.com/dotnet/core-setup 2bb2dcaeffb1dfeda077354449868ddac254bc3d - + https://github.com/dotnet/core-setup 2bb2dcaeffb1dfeda077354449868ddac254bc3d @@ -397,11 +397,11 @@ Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime. All Runtime.$rid packages should have the same version. --> - + https://github.com/dotnet/core-setup 2bb2dcaeffb1dfeda077354449868ddac254bc3d - + https://github.com/dotnet/core-setup 2bb2dcaeffb1dfeda077354449868ddac254bc3d @@ -412,9 +412,9 @@ https://github.com/dotnet/corefx c14b80faff694bae4e085bad221e2e83410e5f33 - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 https://github.com/dotnet/arcade @@ -428,9 +428,9 @@ https://github.com/dotnet/arcade a65d0966dc28861394ce78cfdcb9d5dff370957c - + https://github.com/aspnet/Extensions - d6b33c2155694591d5338a731c5b337757a4b668 + 8bf6089b4491bc4387cdfec64ab56e7cc39030f8 https://github.com/dotnet/roslyn diff --git a/eng/Versions.props b/eng/Versions.props index cb91c450ef..df0077a0a3 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -54,10 +54,10 @@ 3.3.0-beta2-19363-02 - 3.0.0-preview8-27914-05 - 3.0.0-preview8-27914-05 - 3.0.0-preview8-27914-05 - 2.1.0-preview8-27914-05 + 3.0.0-preview8-27914-06 + 3.0.0-preview8-27914-06 + 3.0.0-preview8-27914-06 + 2.1.0-preview8-27914-06 1.0.0-preview8.19364.1 4.6.0-preview8.19364.1 @@ -87,75 +87,75 @@ 0.10.0-preview8.19365.1 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 - 3.0.0-preview8.19364.3 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.1 - 3.0.0-preview8.19365.1 - 3.0.0-preview8.19365.1 - 3.0.0-preview8.19365.1 - 3.0.0-preview8.19365.1 - 3.0.0-preview8.19365.1 - 3.0.0-preview8.19365.1 - 3.0.0-preview8.19365.1 + 3.0.0-preview8.19365.2 + 3.0.0-preview8.19365.2 + 3.0.0-preview8.19365.2 + 3.0.0-preview8.19365.2 + 3.0.0-preview8.19365.2 + 3.0.0-preview8.19365.2 + 3.0.0-preview8.19365.2 3.0.0-preview8.19364.3 3.0.0-preview8.19364.3 From deb51b83f43138570ea86dc17608c45c027deba7 Mon Sep 17 00:00:00 2001 From: "Carlos J. Aliaga" Date: Mon, 15 Jul 2019 18:53:04 +0200 Subject: [PATCH 20/76] _maxRentedBufferSize up to 1MB (#12143) --- src/Http/WebUtilities/src/FileBufferingReadStream.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Http/WebUtilities/src/FileBufferingReadStream.cs b/src/Http/WebUtilities/src/FileBufferingReadStream.cs index ddbeeb81e6..00a16eabcb 100644 --- a/src/Http/WebUtilities/src/FileBufferingReadStream.cs +++ b/src/Http/WebUtilities/src/FileBufferingReadStream.cs @@ -71,7 +71,7 @@ namespace Microsoft.AspNetCore.WebUtilities } _bytePool = bytePool; - if (memoryThreshold < _maxRentedBufferSize) + if (memoryThreshold <= _maxRentedBufferSize) { _rentedBuffer = bytePool.Rent(memoryThreshold); _buffer = new MemoryStream(_rentedBuffer); @@ -115,7 +115,7 @@ namespace Microsoft.AspNetCore.WebUtilities } _bytePool = bytePool; - if (memoryThreshold < _maxRentedBufferSize) + if (memoryThreshold <= _maxRentedBufferSize) { _rentedBuffer = bytePool.Rent(memoryThreshold); _buffer = new MemoryStream(_rentedBuffer); From 8f4214c8c0ae4c87bd315f306a6c43a7909b9cdd Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Jul 2019 11:17:52 -0700 Subject: [PATCH 21/76] UrlEncode/Decode email/password codes by default (#12109) --- .../Areas/Identity/Pages/V3/Account/ConfirmEmail.cshtml.cs | 3 +++ .../Identity/Pages/V3/Account/ConfirmEmailChange.cshtml.cs | 3 +++ .../Areas/Identity/Pages/V3/Account/ExternalLogin.cshtml.cs | 3 +++ .../Areas/Identity/Pages/V3/Account/ForgotPassword.cshtml.cs | 3 +++ .../Areas/Identity/Pages/V3/Account/Manage/Email.cshtml.cs | 4 ++++ .../src/Areas/Identity/Pages/V3/Account/Register.cshtml.cs | 3 +++ .../Identity/Pages/V3/Account/RegisterConfirmation.cshtml.cs | 3 +++ .../Areas/Identity/Pages/V3/Account/ResetPassword.cshtml.cs | 5 +++-- .../Areas/Identity/Pages/V4/Account/ConfirmEmail.cshtml.cs | 3 +++ .../Identity/Pages/V4/Account/ConfirmEmailChange.cshtml.cs | 3 +++ .../Areas/Identity/Pages/V4/Account/ExternalLogin.cshtml.cs | 3 +++ .../Areas/Identity/Pages/V4/Account/ForgotPassword.cshtml.cs | 3 +++ .../Areas/Identity/Pages/V4/Account/Manage/Email.cshtml.cs | 3 +++ .../src/Areas/Identity/Pages/V4/Account/Register.cshtml.cs | 3 +++ .../Identity/Pages/V4/Account/RegisterConfirmation.cshtml.cs | 3 +++ .../Areas/Identity/Pages/V4/Account/ResetPassword.cshtml.cs | 4 +++- 16 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ConfirmEmail.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ConfirmEmail.cshtml.cs index 4477c39fa4..b5e4541257 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ConfirmEmail.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ConfirmEmail.cshtml.cs @@ -2,10 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal { @@ -53,6 +55,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal return NotFound($"Unable to load user with ID '{userId}'."); } + code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code)); var result = await _userManager.ConfirmEmailAsync(user, code); StatusMessage = result.Succeeded ? "Thank you for confirming your email." : "Error confirming your email."; return Page(); diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ConfirmEmailChange.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ConfirmEmailChange.cshtml.cs index ee24b30fd1..2548788be3 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ConfirmEmailChange.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ConfirmEmailChange.cshtml.cs @@ -2,10 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal @@ -56,6 +58,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal return NotFound($"Unable to load user with ID '{userId}'."); } + code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code)); var result = await _userManager.ChangeEmailAsync(user, email, code); if (!result.Succeeded) { diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ExternalLogin.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ExternalLogin.cshtml.cs index aee48019f4..84f0a17611 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ExternalLogin.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ExternalLogin.cshtml.cs @@ -4,6 +4,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.Security.Claims; +using System.Text; using System.Text.Encodings.Web; using System.Threading; using System.Threading.Tasks; @@ -11,6 +12,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal @@ -204,6 +206,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal await _signInManager.SignInAsync(user, isPersistent: false); var userId = await _userManager.GetUserIdAsync(user); var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); + code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code)); var callbackUrl = Url.Page( "/Account/ConfirmEmail", pageHandler: null, diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ForgotPassword.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ForgotPassword.cshtml.cs index 3ed080fa9f..f7aebe850b 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ForgotPassword.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ForgotPassword.cshtml.cs @@ -3,12 +3,14 @@ using System; using System.ComponentModel.DataAnnotations; +using System.Text; using System.Text.Encodings.Web; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal @@ -75,6 +77,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal // For more information on how to enable account confirmation and password reset please // visit https://go.microsoft.com/fwlink/?LinkID=532713 var code = await _userManager.GeneratePasswordResetTokenAsync(user); + code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code)); var callbackUrl = Url.Page( "/Account/ResetPassword", pageHandler: null, diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Manage/Email.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Manage/Email.cshtml.cs index 0ff0ca11bf..009c22e9d0 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Manage/Email.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Manage/Email.cshtml.cs @@ -2,12 +2,15 @@ // 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.ComponentModel.DataAnnotations; +using System.Text; using System.Text.Encodings.Web; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Manage.Internal { @@ -134,6 +137,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Manage.Internal { var userId = await _userManager.GetUserIdAsync(user); var code = await _userManager.GenerateChangeEmailTokenAsync(user, Input.NewEmail); + code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code)); var callbackUrl = Url.Page( "/Account/ConfirmEmailChange", pageHandler: null, diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Register.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Register.cshtml.cs index 68407af5a1..83f63c15e5 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Register.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Register.cshtml.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Text; using System.Text.Encodings.Web; using System.Threading; using System.Threading.Tasks; @@ -13,6 +14,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal @@ -141,6 +143,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal var userId = await _userManager.GetUserIdAsync(user); var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); + code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code)); var callbackUrl = Url.Page( "/Account/ConfirmEmail", pageHandler: null, diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/RegisterConfirmation.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/RegisterConfirmation.cshtml.cs index c361bf7a26..55dea06371 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/RegisterConfirmation.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/RegisterConfirmation.cshtml.cs @@ -2,11 +2,13 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal @@ -75,6 +77,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal { var userId = await _userManager.GetUserIdAsync(user); var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); + code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code)); EmailConfirmationUrl = Url.Page( "/Account/ConfirmEmail", pageHandler: null, diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ResetPassword.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ResetPassword.cshtml.cs index 848a401609..4fbba0c919 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ResetPassword.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ResetPassword.cshtml.cs @@ -3,10 +3,12 @@ using System; using System.ComponentModel.DataAnnotations; +using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal { @@ -63,7 +65,6 @@ namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal /// [Required] public string Code { get; set; } - } /// @@ -98,7 +99,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal { Input = new InputModel { - Code = code + Code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code)) }; return Page(); } diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ConfirmEmail.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ConfirmEmail.cshtml.cs index ff143f81d2..0468f52dbf 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ConfirmEmail.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ConfirmEmail.cshtml.cs @@ -2,10 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal { @@ -53,6 +55,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal return NotFound($"Unable to load user with ID '{userId}'."); } + code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code)); var result = await _userManager.ConfirmEmailAsync(user, code); StatusMessage = result.Succeeded ? "Thank you for confirming your email." : "Error confirming your email."; return Page(); diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ConfirmEmailChange.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ConfirmEmailChange.cshtml.cs index ea28d658da..e0c2bc4cb3 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ConfirmEmailChange.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ConfirmEmailChange.cshtml.cs @@ -2,10 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal { @@ -55,6 +57,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal return NotFound($"Unable to load user with ID '{userId}'."); } + code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code)); var result = await _userManager.ChangeEmailAsync(user, email, code); if (!result.Succeeded) { diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ExternalLogin.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ExternalLogin.cshtml.cs index 42c2d2ba53..f075e5fe9c 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ExternalLogin.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ExternalLogin.cshtml.cs @@ -4,6 +4,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.Security.Claims; +using System.Text; using System.Text.Encodings.Web; using System.Threading; using System.Threading.Tasks; @@ -11,6 +12,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -204,6 +206,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal await _signInManager.SignInAsync(user, isPersistent: false); var userId = await _userManager.GetUserIdAsync(user); var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); + code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code)); var callbackUrl = Url.Page( "/Account/ConfirmEmail", pageHandler: null, diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ForgotPassword.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ForgotPassword.cshtml.cs index 30e329bd39..b2b67e24c9 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ForgotPassword.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ForgotPassword.cshtml.cs @@ -3,12 +3,14 @@ using System; using System.ComponentModel.DataAnnotations; +using System.Text; using System.Text.Encodings.Web; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal { @@ -74,6 +76,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal // For more information on how to enable account confirmation and password reset please // visit https://go.microsoft.com/fwlink/?LinkID=532713 var code = await _userManager.GeneratePasswordResetTokenAsync(user); + code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code)); var callbackUrl = Url.Page( "/Account/ResetPassword", pageHandler: null, diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/Email.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/Email.cshtml.cs index 533e2a1e6e..8ac54389c1 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/Email.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/Email.cshtml.cs @@ -3,11 +3,13 @@ using System; using System.ComponentModel.DataAnnotations; +using System.Text; using System.Text.Encodings.Web; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Manage.Internal { @@ -134,6 +136,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Manage.Internal { var userId = await _userManager.GetUserIdAsync(user); var code = await _userManager.GenerateChangeEmailTokenAsync(user, Input.NewEmail); + code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code)); var callbackUrl = Url.Page( "/Account/ConfirmEmailChange", pageHandler: null, diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Register.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Register.cshtml.cs index 165bcc0256..f1eeb92f8e 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Register.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Register.cshtml.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Text; using System.Text.Encodings.Web; using System.Threading; using System.Threading.Tasks; @@ -13,6 +14,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal @@ -140,6 +142,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal var userId = await _userManager.GetUserIdAsync(user); var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); + code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code)); var callbackUrl = Url.Page( "/Account/ConfirmEmail", pageHandler: null, diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/RegisterConfirmation.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/RegisterConfirmation.cshtml.cs index ab07bb4574..639ccd6726 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/RegisterConfirmation.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/RegisterConfirmation.cshtml.cs @@ -2,11 +2,13 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal @@ -75,6 +77,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal { var userId = await _userManager.GetUserIdAsync(user); var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); + code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code)); EmailConfirmationUrl = Url.Page( "/Account/ConfirmEmail", pageHandler: null, diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ResetPassword.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ResetPassword.cshtml.cs index bbc5c7cba3..b9d42559c5 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ResetPassword.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ResetPassword.cshtml.cs @@ -3,10 +3,12 @@ using System; using System.ComponentModel.DataAnnotations; +using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal { @@ -98,7 +100,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal { Input = new InputModel { - Code = code + Code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code)) }; return Page(); } From 25db4331cf400d173d6c2f604ffca26291281e3b Mon Sep 17 00:00:00 2001 From: TeBeCo Date: Mon, 15 Jul 2019 20:20:18 +0200 Subject: [PATCH 22/76] using System.Text.Json for SignalRSamples as JsonTextWriter is a "synchronous IDisposable" ending end throwing when calling /deployment with AllowSynchronousIO turned off (#12165) Thanks for finding and fixing this :) --- .../SignalRSamples/SignalRSamples.csproj | 1 - src/SignalR/samples/SignalRSamples/Startup.cs | 23 ++++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/SignalR/samples/SignalRSamples/SignalRSamples.csproj b/src/SignalR/samples/SignalRSamples/SignalRSamples.csproj index 45adb3b3cd..64b4d62744 100644 --- a/src/SignalR/samples/SignalRSamples/SignalRSamples.csproj +++ b/src/SignalR/samples/SignalRSamples/SignalRSamples.csproj @@ -19,7 +19,6 @@ - diff --git a/src/SignalR/samples/SignalRSamples/Startup.cs b/src/SignalR/samples/SignalRSamples/Startup.cs index ba8cf35786..b82743e678 100644 --- a/src/SignalR/samples/SignalRSamples/Startup.cs +++ b/src/SignalR/samples/SignalRSamples/Startup.cs @@ -9,8 +9,8 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using SignalRSamples.ConnectionHandlers; using SignalRSamples.Hubs; @@ -18,6 +18,9 @@ namespace SignalRSamples { public class Startup { + + private readonly JsonWriterOptions _jsonWriterOptions = new JsonWriterOptions { Indented = true }; + // This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) @@ -57,20 +60,19 @@ namespace SignalRSamples endpoints.MapConnectionHandler("/chat"); - endpoints.MapGet("/deployment", context => + endpoints.MapGet("/deployment", async context => { var attributes = Assembly.GetAssembly(typeof(Startup)).GetCustomAttributes(); context.Response.ContentType = "application/json"; - using (var textWriter = new StreamWriter(context.Response.Body)) - using (var writer = new JsonTextWriter(textWriter)) + await using (var writer = new Utf8JsonWriter(context.Response.BodyWriter, _jsonWriterOptions)) { - var json = new JObject(); + writer.WriteStartObject(); var commitHash = string.Empty; foreach (var attribute in attributes) { - json.Add(attribute.Key, attribute.Value); + writer.WriteString(attribute.Key, attribute.Value); if (string.Equals(attribute.Key, "CommitHash")) { @@ -80,13 +82,12 @@ namespace SignalRSamples if (!string.IsNullOrEmpty(commitHash)) { - json.Add("GitHubUrl", $"https://github.com/aspnet/SignalR/commit/{commitHash}"); + writer.WriteString("GitHubUrl", $"https://github.com/aspnet/SignalR/commit/{commitHash}"); } - json.WriteTo(writer); + writer.WriteEndObject(); + await writer.FlushAsync(); } - - return Task.CompletedTask; }); }); } From 4c07e1e6adf21740cd3ae8886fae2d2c97e16c39 Mon Sep 17 00:00:00 2001 From: Artak <34246760+mkArtakMSFT@users.noreply.github.com> Date: Mon, 15 Jul 2019 11:21:11 -0700 Subject: [PATCH 23/76] Updated dependencies (#12177) * Updated dependencies * pull lodash up directly --- src/Components/test/E2ETest/yarn.lock | 99 ++-- .../CORS/test/FunctionalTests/yarn.lock | 28 +- src/Middleware/SpaServices/src/yarn.lock | 18 +- .../clients/ts/FunctionalTests/package.json | 3 + .../clients/ts/FunctionalTests/yarn.lock | 164 +++---- src/SignalR/clients/ts/common/yarn.lock | 462 ++++++++++-------- 6 files changed, 424 insertions(+), 350 deletions(-) diff --git a/src/Components/test/E2ETest/yarn.lock b/src/Components/test/E2ETest/yarn.lock index de1c0d6edb..6f2b1cc3e3 100644 --- a/src/Components/test/E2ETest/yarn.lock +++ b/src/Components/test/E2ETest/yarn.lock @@ -3,9 +3,9 @@ ajv@^6.5.5: - version "6.10.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" - integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" @@ -25,11 +25,11 @@ assert-plus@1.0.0, assert-plus@^1.0.0: integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= async@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" - integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== + version "2.6.3" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== dependencies: - lodash "^4.17.11" + lodash "^4.17.14" asynckit@^0.4.0: version "0.4.0" @@ -72,16 +72,16 @@ caseless@~0.12.0: integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" - integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" commander@^2.19.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" - integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -214,9 +214,9 @@ http-signature@~1.2.0: sshpk "^1.7.0" inherits@^2.0.3, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== is-typedarray@~1.0.0: version "1.0.0" @@ -268,22 +268,22 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -lodash@^4.17.11: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== +lodash@^4.17.11, lodash@^4.17.14: + version "4.17.14" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" + integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== -mime-db@~1.38.0: - version "1.38.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad" - integrity sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg== +mime-db@1.40.0: + version "1.40.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" + integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.22" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.22.tgz#fe6b355a190926ab7698c9a0556a11199b2199bd" - integrity sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog== + version "2.1.24" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" + integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== dependencies: - mime-db "~1.38.0" + mime-db "1.40.0" minimist@0.0.8: version "0.0.8" @@ -303,9 +303,9 @@ mkdirp@^0.5.1: minimist "0.0.8" ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== nice-try@^1.0.4: version "1.0.5" @@ -340,9 +340,9 @@ performance-now@^2.1.0: integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== progress@2.0.3: version "2.0.3" @@ -350,9 +350,9 @@ progress@2.0.3: integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== psl@^1.1.24: - version "1.1.31" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" - integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== + version "1.2.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6" + integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA== punycode@^1.4.1: version "1.4.1" @@ -383,9 +383,9 @@ readable-stream@^2.3.5: util-deprecate "~1.0.1" readable-stream@^3.1.1: - version "3.2.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.2.0.tgz#de17f229864c120a9f56945756e4f32c4045245d" - integrity sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw== + version "3.4.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" + integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== dependencies: inherits "^2.0.3" string_decoder "^1.1.1" @@ -417,7 +417,12 @@ request@2.88.0: tunnel-agent "^0.6.0" uuid "^3.3.2" -safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" + integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== @@ -428,9 +433,9 @@ safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== selenium-standalone@^6.15.4: - version "6.15.6" - resolved "https://registry.yarnpkg.com/selenium-standalone/-/selenium-standalone-6.15.6.tgz#55cc610e405dd74e312c77f3ac7336795ca2cd0c" - integrity sha512-iQJbjJyGY4+n9voj+QIxkjEKmk9csPL91pxjqYyX5/1jjJDw7ce0ZuTnLeNaFmFdjY/nAwcoMRvqpDPmmmyr5A== + version "6.16.0" + resolved "https://registry.yarnpkg.com/selenium-standalone/-/selenium-standalone-6.16.0.tgz#ffcf02665c58ff7a7472427ae819ba79c15967ac" + integrity sha512-tl7HFH2FOxJD1is7Pzzsl0pY4vuePSdSWiJdPn+6ETBkpeJDiuzou8hBjvWYWpD+eIVcOrmy3L0R3GzkdHLzDw== dependencies: async "^2.6.2" commander "^2.19.0" @@ -447,9 +452,9 @@ selenium-standalone@^6.15.4: yauzl "^2.10.0" semver@^5.5.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + version "5.7.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== shebang-command@^1.2.0: version "1.2.0" diff --git a/src/Middleware/CORS/test/FunctionalTests/yarn.lock b/src/Middleware/CORS/test/FunctionalTests/yarn.lock index 962ed85d20..5d9ae3cc2a 100644 --- a/src/Middleware/CORS/test/FunctionalTests/yarn.lock +++ b/src/Middleware/CORS/test/FunctionalTests/yarn.lock @@ -59,9 +59,9 @@ agent-base@^4.3.0: es6-promisify "^5.0.0" ajv@^6.5.5: - version "6.10.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.1.tgz#ebf8d3af22552df9dd049bfbe50cc2390e823593" - integrity sha512-w1YQaVGNC6t2UCPjEawK/vo/dG8OOrVtUmhBT1uJJYxbl5kU2Tj3v6LGqBcsysN1yhuCStJCCA3GqdvKY8sqXQ== + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" @@ -200,11 +200,11 @@ async-limiter@~1.0.0: integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== async@^2.1.4: - version "2.6.2" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" - integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== + version "2.6.3" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== dependencies: - lodash "^4.17.11" + lodash "^4.17.14" asynckit@^0.4.0: version "0.4.0" @@ -2194,10 +2194,10 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@^4.17.11, lodash@^4.17.4: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== +lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.4: + version "4.17.14" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" + integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== loose-envify@^1.0.0: version "1.4.0" @@ -3225,9 +3225,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" - integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== + version "3.0.5" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" + integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" diff --git a/src/Middleware/SpaServices/src/yarn.lock b/src/Middleware/SpaServices/src/yarn.lock index c976c2f8fe..0d0d2e986b 100644 --- a/src/Middleware/SpaServices/src/yarn.lock +++ b/src/Middleware/SpaServices/src/yarn.lock @@ -184,9 +184,9 @@ ajv-keywords@^3.1.0: integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== ajv@^6.1.0: - version "6.10.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.1.tgz#ebf8d3af22552df9dd049bfbe50cc2390e823593" - integrity sha512-w1YQaVGNC6t2UCPjEawK/vo/dG8OOrVtUmhBT1uJJYxbl5kU2Tj3v6LGqBcsysN1yhuCStJCCA3GqdvKY8sqXQ== + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" @@ -2684,9 +2684,9 @@ typedarray@^0.0.6: integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= typescript@^3.0.1: - version "3.5.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.2.tgz#a09e1dc69bc9551cadf17dba10ee42cf55e5d56c" - integrity sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA== + version "3.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" + integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== union-value@^1.0.0: version "1.0.1" @@ -2789,9 +2789,9 @@ watchpack@^1.5.0: neo-async "^2.5.0" webpack-cli@^3.1.0: - version "3.3.5" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.5.tgz#f4d1238a66a2843d9cebf189835ea22142e72767" - integrity sha512-w0j/s42c5UhchwTmV/45MLQnTVwRoaUTu9fM5LuyOd/8lFoCNCELDogFoecx5NzRUndO0yD/gF2b02XKMnmAWQ== + version "3.3.6" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.6.tgz#2c8c399a2642133f8d736a359007a052e060032c" + integrity sha512-0vEa83M7kJtxK/jUhlpZ27WHIOndz5mghWL2O53kiDoA9DIxSKnfqB92LoqEn77cT4f3H2cZm1BMEat/6AZz3A== dependencies: chalk "2.4.2" cross-spawn "6.0.5" diff --git a/src/SignalR/clients/ts/FunctionalTests/package.json b/src/SignalR/clients/ts/FunctionalTests/package.json index 84c01aacb9..cbf6183851 100644 --- a/src/SignalR/clients/ts/FunctionalTests/package.json +++ b/src/SignalR/clients/ts/FunctionalTests/package.json @@ -51,6 +51,9 @@ "test:sauce": "yarn run pretest && ts-node --project ./scripts/tsconfig.json ./scripts/run-tests.ts --sauce", "sauce": "yarn run test:sauce" }, + "resolutions": { + "lodash": ">=4.7.14" + }, "author": "", "license": "Apache-2.0" } diff --git a/src/SignalR/clients/ts/FunctionalTests/yarn.lock b/src/SignalR/clients/ts/FunctionalTests/yarn.lock index 986fbff7db..8fb80c73b9 100644 --- a/src/SignalR/clients/ts/FunctionalTests/yarn.lock +++ b/src/SignalR/clients/ts/FunctionalTests/yarn.lock @@ -34,9 +34,9 @@ "@types/node" "*" "@types/node@*": - version "12.0.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.4.tgz#46832183115c904410c275e34cf9403992999c32" - integrity sha512-j8YL2C0fXq7IONwl/Ud5Kt0PeXw22zGERt+HSSnwbKOJVsAGkEz3sFCYwaF9IOuoG1HOtE0vKCj6sXF7Q0+Vaw== + version "12.6.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.2.tgz#a5ccec6abb6060d5f20d256fb03ed743e9774999" + integrity sha512-gojym4tX0FWeV2gsW4Xmzo5wxGjXGm550oVUII7f7G5o4BV6c7DBdiG1RRQd+y1bvqRyYtPfMK85UM95vsapqQ== "@types/node@^9.6.28": version "9.6.49" @@ -76,17 +76,17 @@ after@0.8.2: resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= -agent-base@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" - integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== +agent-base@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" + integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== dependencies: es6-promisify "^5.0.0" ajv@^6.5.5: - version "6.10.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" - integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" @@ -232,11 +232,11 @@ async@2.0.1: lodash "^4.8.0" async@^2.0.0, async@^2.1.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" - integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== + version "2.6.3" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== dependencies: - lodash "^4.17.11" + lodash "^4.17.14" asynckit@^0.4.0: version "0.4.0" @@ -483,9 +483,9 @@ chokidar@^2.0.3: fsevents "^1.2.7" chownr@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + version "1.1.2" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.2.tgz#a18f1e0b269c8a6a5d3c86eb298beb14c3dd7bf6" + integrity sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A== circular-json@^0.5.5: version "0.5.9" @@ -822,9 +822,9 @@ ent@~2.2.0: integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= es6-promise@^4.0.3, es6-promise@^4.2.4: - version "4.2.6" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f" - integrity sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q== + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== es6-promisify@^5.0.0: version "5.0.0" @@ -963,9 +963,9 @@ finalhandler@1.1.2: unpipe "~1.0.0" flatted@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" - integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + version "2.0.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" + integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== follow-redirects@^1.0.0: version "1.7.0" @@ -1079,9 +1079,9 @@ glob@^7.0.0, glob@^7.1.1, glob@^7.1.3: path-is-absolute "^1.0.0" graceful-fs@^4.1.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + version "4.2.0" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" + integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== har-schema@^2.0.0: version "2.0.0" @@ -1186,11 +1186,11 @@ http-signature@~1.2.0: sshpk "^1.7.0" https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== + version "2.2.2" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz#271ea8e90f836ac9f119daccd39c19ff7dfb0793" + integrity sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg== dependencies: - agent-base "^4.1.0" + agent-base "^4.3.0" debug "^3.1.0" iconv-lite@0.4.24, iconv-lite@^0.4.4: @@ -1225,7 +1225,12 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.3, inherits@^2.0.3, inherits@~2.0.3: +inherits@2, inherits@^2.0.3, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inherits@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= @@ -1348,7 +1353,7 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: +is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== @@ -1590,10 +1595,10 @@ lazystream@^1.0.0: dependencies: readable-stream "^2.0.5" -lodash@4.17.11, lodash@^4.16.6, lodash@^4.17.11, lodash@^4.17.5, lodash@^4.5.0, lodash@^4.6.1, lodash@^4.8.0: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== +lodash@4.17.11, lodash@>=4.7.14, lodash@^4.16.6, lodash@^4.17.14, lodash@^4.17.5, lodash@^4.5.0, lodash@^4.6.1, lodash@^4.8.0: + version "4.17.14" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" + integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== log-symbols@^2.1.0: version "2.2.0" @@ -1675,9 +1680,9 @@ mime-types@^2.1.12, mime-types@~2.1.19, mime-types@~2.1.24: mime-db "1.40.0" mime@^2.3.1: - version "2.4.3" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.3.tgz#229687331e86f68924e6cb59e1cdd937f18275fe" - integrity sha512-QgrPRJfE+riq5TPZMcHZOtm8c6K/yYrMbKIoRfapfiGLxS8OTeIfRhUGW5LU7MlRa52KOAGCfUNruqLrIBvWZw== + version "2.4.4" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5" + integrity sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA== minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" @@ -1717,9 +1722,9 @@ minizlib@^1.2.1: minipass "^2.2.1" mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" @@ -1737,9 +1742,9 @@ ms@2.0.0: integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== msgpack5@^4.0.2: version "4.2.1" @@ -1829,9 +1834,9 @@ npm-bundled@^1.0.1: integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== npm-packlist@^1.1.6: - version "1.4.1" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" - integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw== + version "1.4.4" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.4.tgz#866224233850ac534b63d1a6e76050092b5d2f44" + integrity sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" @@ -1991,9 +1996,9 @@ posix-character-classes@^0.1.0: integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== pseudomap@^1.0.2: version "1.0.2" @@ -2001,9 +2006,9 @@ pseudomap@^1.0.2: integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= psl@^1.1.24: - version "1.1.32" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.32.tgz#3f132717cf2f9c169724b2b6caf373cf694198db" - integrity sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g== + version "1.2.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6" + integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA== punycode@^1.4.1: version "1.4.1" @@ -2180,7 +2185,12 @@ rxjs@^6.3.3: dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" + integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== @@ -2230,20 +2240,10 @@ set-blocking@~2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -2484,9 +2484,9 @@ tar-stream@^1.5.0: xtend "^4.0.0" tar@^4: - version "4.4.9" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.9.tgz#058fbb152f6fc45733e84585a40c39e59302e1b3" - integrity sha512-xisFa7Q2i3HOgfn+nmnWLGHD6Tm23hxjkx6wwGmgxkJFr6wxwXnJOdJYcZjL453PSdF0+bemO03+flAzkIdLBQ== + version "4.4.10" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.10.tgz#946b2810b9a5e0b26140cf78bea6b0b0d689eba1" + integrity sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA== dependencies: chownr "^1.1.1" fs-minipass "^1.2.5" @@ -2578,9 +2578,9 @@ tsconfig@^7.0.0: strip-json-comments "^2.0.0" tslib@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== tunnel-agent@^0.6.0: version "0.6.0" @@ -2613,14 +2613,14 @@ ultron@~1.1.0: integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== dependencies: arr-union "^3.1.0" get-value "^2.0.6" is-extendable "^0.1.1" - set-value "^0.4.3" + set-value "^2.0.1" unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" @@ -2778,9 +2778,9 @@ xmlhttprequest-ssl@~1.5.4: integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= xtend@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== yallist@^2.1.2: version "2.1.2" diff --git a/src/SignalR/clients/ts/common/yarn.lock b/src/SignalR/clients/ts/common/yarn.lock index e117f5a18a..a6e286527b 100644 --- a/src/SignalR/clients/ts/common/yarn.lock +++ b/src/SignalR/clients/ts/common/yarn.lock @@ -10,17 +10,17 @@ "@babel/highlight" "^7.0.0" "@babel/core@^7.1.0": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.5.tgz#081f97e8ffca65a9b4b0fdc7e274e703f000c06a" - integrity sha512-OvjIh6aqXtlsA8ujtGKfC7LYWksYSX8yQcM8Ay3LuvVeQ63lcOKgoZWVqcpFwkd29aYU9rVx7jxhfhiEDV9MZA== + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.4.tgz#4c32df7ad5a58e9ea27ad025c11276324e0b4ddd" + integrity sha512-+DaeBEpYq6b2+ZmHx3tHspC+ZRflrvLqwfv8E3hNr5LVQoyBnL8RPKSBCg+rK2W2My9PWlujBiqd0ZPsR9Q6zQ== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.4.4" - "@babel/helpers" "^7.4.4" - "@babel/parser" "^7.4.5" + "@babel/generator" "^7.5.0" + "@babel/helpers" "^7.5.4" + "@babel/parser" "^7.5.0" "@babel/template" "^7.4.4" - "@babel/traverse" "^7.4.5" - "@babel/types" "^7.4.4" + "@babel/traverse" "^7.5.0" + "@babel/types" "^7.5.0" convert-source-map "^1.1.0" debug "^4.1.0" json5 "^2.1.0" @@ -29,12 +29,12 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.4.0", "@babel/generator@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041" - integrity sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ== +"@babel/generator@^7.4.0", "@babel/generator@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.0.tgz#f20e4b7a91750ee8b63656073d843d2a736dca4a" + integrity sha512-1TTVrt7J9rcG5PMjvO7VEG3FrEoEJNHxumRq66GemPmzboLWtIjjcJgk8rokuAS7IiRSpgVSu5Vb9lc99iJkOA== dependencies: - "@babel/types" "^7.4.4" + "@babel/types" "^7.5.0" jsesc "^2.5.1" lodash "^4.17.11" source-map "^0.5.0" @@ -68,28 +68,28 @@ dependencies: "@babel/types" "^7.4.4" -"@babel/helpers@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.4.tgz#868b0ef59c1dd4e78744562d5ce1b59c89f2f2a5" - integrity sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A== +"@babel/helpers@^7.5.4": + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.4.tgz#2f00608aa10d460bde0ccf665d6dcf8477357cf0" + integrity sha512-6LJ6xwUEJP51w0sIgKyfvFMJvIb9mWAfohJp0+m6eHJigkFdcH8duZ1sfhn0ltJRzwUIT/yqqhdSfRpCpL7oow== dependencies: "@babel/template" "^7.4.4" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" + "@babel/traverse" "^7.5.0" + "@babel/types" "^7.5.0" "@babel/highlight@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" - integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" + integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== dependencies: chalk "^2.0.0" esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.5.tgz#04af8d5d5a2b044a2a1bffacc1e5e6673544e872" - integrity sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew== +"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.0.tgz#3e0713dff89ad6ae37faec3b29dcfc5c979770b7" + integrity sha512-I5nW8AhGpOXGCCNYGc+p7ExQIBxRFnS2fd/d862bNOKvmoEPjYPcfIjsfdy0ujagYOIYPczKgD9l3FsgTkAzKA== "@babel/plugin-syntax-object-rest-spread@^7.0.0": version "7.2.0" @@ -107,25 +107,25 @@ "@babel/parser" "^7.4.4" "@babel/types" "^7.4.4" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.5.tgz#4e92d1728fd2f1897dafdd321efbff92156c3216" - integrity sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.0.tgz#4216d6586854ef5c3c4592dab56ec7eb78485485" + integrity sha512-SnA9aLbyOCcnnbQEGwdfBggnc142h/rbqqsXcaATj2hZcegCl903pUD/lfpsNBlBSuWow/YDfRyJuWi2EPR5cg== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.4.4" + "@babel/generator" "^7.5.0" "@babel/helper-function-name" "^7.1.0" "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/parser" "^7.4.5" - "@babel/types" "^7.4.4" + "@babel/parser" "^7.5.0" + "@babel/types" "^7.5.0" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.11" -"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" - integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ== +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.0.tgz#e47d43840c2e7f9105bc4d3a2c371b4d0c7832ab" + integrity sha512-UFpDVqRABKsW01bvw7/wSUe56uy6RXM5+VJibVVAybDGxEW25jdwiFJEf7ASvSaC7sN7rbE/l3cLp2izav+CtQ== dependencies: esutils "^2.0.2" lodash "^4.17.11" @@ -349,14 +349,14 @@ integrity sha512-Q5hTcfdudEL2yOmluA1zaSyPbzWPmJ3XfSWeP3RyoYvS9hnje1ZyagrZOuQ6+1nQC1Gw+7gap3pLNL3xL6UBug== "@types/node@*": - version "12.0.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.8.tgz#551466be11b2adc3f3d47156758f610bd9f6b1d8" - integrity sha512-b8bbUOTwzIY3V5vDTY1fIJ+ePKDUBqt2hC2woVGotdQQhG/2Sh62HOKHrT7ab+VerXAcPyAiTEipPu/FsreUtg== + version "12.6.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.2.tgz#a5ccec6abb6060d5f20d256fb03ed743e9774999" + integrity sha512-gojym4tX0FWeV2gsW4Xmzo5wxGjXGm550oVUII7f7G5o4BV6c7DBdiG1RRQd+y1bvqRyYtPfMK85UM95vsapqQ== "@types/node@^8.5.2": - version "8.10.49" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.49.tgz#f331afc5efed0796798e5591d6e0ece636969b7b" - integrity sha512-YX30JVx0PvSmJ3Eqr74fYLGeBxD+C7vIL20ek+GGGLJeUbVYRUW3EzyAXpIRA0K8c8o0UWqR/GwEFYiFoz1T8w== + version "8.10.50" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.50.tgz#f3d68482b1f54b5f4fba8daaac385db12bb6a706" + integrity sha512-+ZbcUwJdaBgOZpwXeT0v+gHC/jQbEfzoc9s4d0rN0JIKeQbuTrT+A2n1aQY6LpZjrLXJT7avVUqiCecCJeeZxA== "@types/stack-utils@^1.0.1": version "1.0.1" @@ -376,9 +376,9 @@ source-map "^0.6.1" "@types/webpack@^4.4.0": - version "4.4.32" - resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.4.32.tgz#2d460cd33a15e568e93f38de5e628cf846396c51" - integrity sha512-mNARoaSJTzbiHxtZbf9NULFilu2frqD+g9Iyl9V2jPYJWXi+AC3Hz8lQWPZ5LLtgUm7iF4SDDMB/1bPrbRQgFw== + version "4.4.35" + resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.4.35.tgz#b7088eb2d471d5645e5503d272783cafa753583b" + integrity sha512-kf+mn/+CB4HsFb+Rz0QBRlo8nNC9LFhwqeK5xxhd3FEPRWJv6MFVnljKV5ARac56+syO8vIhq+nGt860+3wx7A== dependencies: "@types/anymatch" "*" "@types/node" "*" @@ -557,11 +557,6 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -acorn-dynamic-import@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" - integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw== - acorn-globals@^4.1.0: version "4.3.2" resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.2.tgz#4e2c2313a597fd589720395f6354b41cd5ec8006" @@ -571,19 +566,19 @@ acorn-globals@^4.1.0: acorn-walk "^6.0.1" acorn-walk@^6.0.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" - integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== + version "6.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" + integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA== acorn@^5.5.3: version "5.7.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== -acorn@^6.0.1, acorn@^6.0.5: - version "6.1.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" - integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== +acorn@^6.0.1, acorn@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.2.0.tgz#67f0da2fc339d6cfb5d6fb244fd449f33cd8bbe3" + integrity sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw== ajv-errors@^1.0.0: version "1.0.1" @@ -591,14 +586,14 @@ ajv-errors@^1.0.0: integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== ajv-keywords@^3.1.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.0.tgz#4b831e7b531415a7cc518cd404e73f6193c6349d" - integrity sha512-aUjdRFISbuFOl0EIZc+9e4FfZp0bDZgAdOOf30bJmw8VM9v84SHyVyxDfbWxpGYbdZD/9XoKxfHVNmxPkhwyGw== + version "3.4.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" + integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== ajv@^6.1.0, ajv@^6.5.5: - version "6.10.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" - integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" @@ -949,9 +944,9 @@ bs-logger@0.x: fast-json-stable-stringify "2.x" bser@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" - integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk= + version "2.1.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.0.tgz#65fc784bf7f87c009b973c12db6546902fa9c7b5" + integrity sha512-8zsjWrQkkBoLK6uxASk1nJ2SKv97ltiGDo6A3wA0/yRPz+CwmEyDo0hUrhIuukG2JHpAl3bvFIixw2/3Hi0DOg== dependencies: node-int64 "^0.4.0" @@ -1046,7 +1041,7 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: +chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1075,9 +1070,9 @@ chokidar@^2.0.2: fsevents "^1.2.7" chownr@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + version "1.1.2" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.2.tgz#a18f1e0b269c8a6a5d3c86eb298beb14c3dd7bf6" + integrity sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A== chrome-trace-event@^1.0.0: version "1.0.2" @@ -1118,6 +1113,15 @@ cliui@^4.0.0: strip-ansi "^4.0.0" wrap-ansi "^2.0.0" +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1155,7 +1159,7 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^2.12.1, commander@^2.19.0, commander@~2.20.0: +commander@^2.12.1, commander@^2.20.0, commander@~2.20.0: version "2.20.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== @@ -1262,7 +1266,7 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" -cross-spawn@^6.0.0, cross-spawn@^6.0.5: +cross-spawn@6.0.5, cross-spawn@^6.0.0: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== @@ -1290,17 +1294,17 @@ crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" -cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": - version "0.3.6" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad" - integrity sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A== +"cssom@>= 0.3.2 < 0.4.0", cssom@~0.3.6: + version "0.3.8" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" + integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== cssstyle@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.2.2.tgz#427ea4d585b18624f6fdbf9de7a2a1a3ba713077" - integrity sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow== + version "1.3.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.3.0.tgz#c36c466f7037fd30f03baa271b65f0f17b50585c" + integrity sha512-wXsoRfsRfsLVNaVzoKdqvEmK/5PFaEXNspVT22Ots6K/cnJdpoDKuQFw+qlMiXnmaif1OgeC466X1zISgAOcGg== dependencies: - cssom "0.3.x" + cssom "~0.3.6" cyclist@~0.2.2: version "0.2.2" @@ -1481,9 +1485,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" elliptic@^6.0.0: - version "6.4.1" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" - integrity sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ== + version "6.5.0" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.0.tgz#2b8ed4c891b7de3200e14412a5b8248c7af505ca" + integrity sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg== dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -1493,6 +1497,11 @@ elliptic@^6.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.0" +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" @@ -1505,7 +1514,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0: +enhanced-resolve@4.1.0, enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng== @@ -1766,13 +1775,13 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" -findup-sync@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc" - integrity sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw= +findup-sync@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1" + integrity sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg== dependencies: detect-file "^1.0.0" - is-glob "^3.1.0" + is-glob "^4.0.0" micromatch "^3.0.4" resolve-dir "^1.0.1" @@ -1872,6 +1881,11 @@ get-caller-file@^1.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -1911,6 +1925,13 @@ glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" +global-modules@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" + integrity sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A== + dependencies: + global-prefix "^3.0.0" + global-modules@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" @@ -1931,15 +1952,24 @@ global-prefix@^1.0.1: is-windows "^1.0.1" which "^1.2.14" +global-prefix@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-3.0.0.tgz#fc85f73064df69f50421f47f883fe5b913ba9b97" + integrity sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg== + dependencies: + ini "^1.3.5" + kind-of "^6.0.2" + which "^1.3.1" + globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + version "4.2.0" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" + integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== growly@^1.3.0: version "1.3.0" @@ -2105,7 +2135,7 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -import-local@^2.0.0: +import-local@2.0.0, import-local@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== @@ -2126,22 +2156,27 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== inherits@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= -ini@^1.3.4, ini@~1.3.0: +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== -interpret@^1.1.0: +interpret@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== @@ -2293,7 +2328,7 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: +is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== @@ -2936,7 +2971,7 @@ loader-runner@^2.3.0: resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== -loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3: +loader-utils@1.2.3, loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== @@ -2959,9 +2994,9 @@ lodash.sortby@^4.7.0: integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= lodash@^4.17.11: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + version "4.17.14" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" + integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== loose-envify@^1.0.0: version "1.4.0" @@ -3162,9 +3197,9 @@ mississippi@^3.0.0: through2 "^2.0.0" mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" @@ -3346,9 +3381,9 @@ npm-bundled@^1.0.1: integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== npm-packlist@^1.1.6: - version "1.4.1" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" - integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw== + version "1.4.4" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.4.tgz#866224233850ac534b63d1a6e76050092b5d2f44" + integrity sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" @@ -3463,7 +3498,7 @@ os-homedir@^1.0.0: resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= -os-locale@^3.0.0: +os-locale@^3.0.0, os-locale@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== @@ -3672,11 +3707,6 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prettier@^1.17.0: - version "1.18.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" - integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== - pretty-format@^24.8.0: version "24.8.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2" @@ -3688,9 +3718,9 @@ pretty-format@^24.8.0: react-is "^16.8.4" process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== process@^0.11.10: version "0.11.10" @@ -3716,9 +3746,9 @@ prr@~1.0.1: integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= psl@^1.1.24, psl@^1.1.28: - version "1.1.32" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.32.tgz#3f132717cf2f9c169724b2b6caf373cf694198db" - integrity sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g== + version "1.2.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6" + integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA== public-encrypt@^4.0.0: version "4.0.3" @@ -3974,9 +4004,9 @@ resolve@1.1.7: integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= resolve@1.x, resolve@^1.10.0, resolve@^1.3.2: - version "1.11.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.0.tgz#4014870ba296176b86343d50b60f3b50609ce232" - integrity sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw== + version "1.11.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" + integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== dependencies: path-parse "^1.0.6" @@ -4012,7 +4042,12 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" + integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== @@ -4064,9 +4099,9 @@ schema-utils@^1.0.0: integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== semver@^6.0.0: - version "6.1.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b" - integrity sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ== + version "6.2.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" + integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== serialize-javascript@^1.7.0: version "1.7.0" @@ -4078,20 +4113,10 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -4134,9 +4159,9 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= sisteransi@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c" - integrity sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ== + version "1.0.2" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.2.tgz#ec57d64b6f25c4f26c0e2c7dd23f2d7f12f7e418" + integrity sha512-ZcYcZcT69nSLAR2oLN2JwNmLkJEKGooFMCdvOkFrToUt/WfcRWqhIg4P4KwY4dmLbuyXIx4o4YmPsvMRJYJd/w== slash@^2.0.0: version "2.0.0" @@ -4189,7 +4214,7 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.6, source-map-support@~0.5.10: +source-map-support@^0.5.6, source-map-support@~0.5.12: version "0.5.12" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== @@ -4234,9 +4259,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" - integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== + version "3.0.5" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" + integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" @@ -4347,6 +4372,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^3.0.0, string-width@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + string_decoder@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" @@ -4375,7 +4409,7 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.0.0: +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== @@ -4397,20 +4431,20 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -supports-color@^5.3.0, supports-color@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^6.1.0: +supports-color@6.1.0, supports-color@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== dependencies: has-flag "^3.0.0" +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + symbol-tree@^3.2.2: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -4451,13 +4485,13 @@ terser-webpack-plugin@^1.1.0: worker-farm "^1.7.0" terser@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.0.0.tgz#ef356f6f359a963e2cc675517f21c1c382877374" - integrity sha512-dOapGTU0hETFl1tCo4t56FN+2jffoKyER9qBGoUFyZ6y7WLoKT0bF+lAYi6B6YsILcGF3q1C2FBh8QcKSCgkgA== + version "4.1.2" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.1.2.tgz#b2656c8a506f7ce805a3f300a2ff48db022fa391" + integrity sha512-jvNoEQSPXJdssFwqPSgWjsOrb+ELoE+ILpHPKXC83tIxOlh2U75F1KuB2luLD/3a6/7K3Vw5pDn+hvu0C4AzSw== dependencies: - commander "^2.19.0" + commander "^2.20.0" source-map "~0.6.1" - source-map-support "~0.5.10" + source-map-support "~0.5.12" test-exclude@^5.2.3: version "5.2.3" @@ -4589,9 +4623,9 @@ tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== tslint@^5.9.1: - version "5.17.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.17.0.tgz#f9f0ce2011d8e90debaa6e9b4975f24cd16852b8" - integrity sha512-pflx87WfVoYepTet3xLfDOLDm9Jqi61UXIKePOuca0qoAZyrGWonDG9VTbji58Fy+8gciUn8Bt7y69+KEVjc/w== + version "5.18.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.18.0.tgz#f61a6ddcf372344ac5e41708095bbf043a147ac6" + integrity sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w== dependencies: "@babel/code-frame" "^7.0.0" builtin-modules "^1.1.1" @@ -4657,14 +4691,14 @@ uglify-js@^3.1.4, uglify-js@^3.3.5: source-map "~0.6.1" union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== dependencies: arr-union "^3.1.0" get-value "^2.0.6" is-extendable "^0.1.1" - set-value "^0.4.3" + set-value "^2.0.1" unique-filename@^1.1.1: version "1.1.1" @@ -4750,7 +4784,7 @@ uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== -v8-compile-cache@^2.0.2: +v8-compile-cache@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz#00f7494d2ae2b688cfe2899df6ed2c54bef91dbe" integrity sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w== @@ -4806,22 +4840,21 @@ webidl-conversions@^4.0.2: integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== webpack-cli@^3.0.3: - version "3.3.4" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.4.tgz#de27e281c48a897b8c219cb093e261d5f6afe44a" - integrity sha512-ubJGQEKMtBSpT+LiL5hXvn2GIOWiRWItR1DGUqJRhwRBeGhpRXjvF5f0erqdRJLErkfqS5/Ldkkedh4AL5Q1ZQ== + version "3.3.6" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.6.tgz#2c8c399a2642133f8d736a359007a052e060032c" + integrity sha512-0vEa83M7kJtxK/jUhlpZ27WHIOndz5mghWL2O53kiDoA9DIxSKnfqB92LoqEn77cT4f3H2cZm1BMEat/6AZz3A== dependencies: - chalk "^2.4.1" - cross-spawn "^6.0.5" - enhanced-resolve "^4.1.0" - findup-sync "^2.0.0" - global-modules "^1.0.0" - import-local "^2.0.0" - interpret "^1.1.0" - loader-utils "^1.1.0" - prettier "^1.17.0" - supports-color "^5.5.0" - v8-compile-cache "^2.0.2" - yargs "^12.0.5" + chalk "2.4.2" + cross-spawn "6.0.5" + enhanced-resolve "4.1.0" + findup-sync "3.0.0" + global-modules "2.0.0" + import-local "2.0.0" + interpret "1.2.0" + loader-utils "1.2.3" + supports-color "6.1.0" + v8-compile-cache "2.0.3" + yargs "13.2.4" webpack-sources@^1.3.0: version "1.3.0" @@ -4832,16 +4865,15 @@ webpack-sources@^1.3.0: source-map "~0.6.1" webpack@^4.12.0: - version "4.34.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.34.0.tgz#a4c30129482f7b4ece4c0842002dedf2b56fab58" - integrity sha512-ry2IQy1wJjOefLe1uJLzn5tG/DdIKzQqNlIAd2L84kcaADqNvQDTBlo8UcCNyDaT5FiaB+16jhAkb63YeG3H8Q== + version "4.35.3" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.35.3.tgz#66bc35ef215a7b75e8790f84d560013ffecf0ca3" + integrity sha512-xggQPwr9ILlXzz61lHzjvgoqGU08v5+Wnut19Uv3GaTtzN4xBTcwnobodrXE142EL1tOiS5WVEButooGzcQzTA== dependencies: "@webassemblyjs/ast" "1.8.5" "@webassemblyjs/helper-module-context" "1.8.5" "@webassemblyjs/wasm-edit" "1.8.5" "@webassemblyjs/wasm-parser" "1.8.5" - acorn "^6.0.5" - acorn-dynamic-import "^4.0.0" + acorn "^6.2.0" ajv "^6.1.0" ajv-keywords "^3.1.0" chrome-trace-event "^1.0.0" @@ -4896,7 +4928,7 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@^1.2.14, which@^1.2.9, which@^1.3.0: +which@^1.2.14, which@^1.2.9, which@^1.3.0, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -4935,6 +4967,15 @@ wrap-ansi@^2.0.0: string-width "^1.0.1" strip-ansi "^3.0.1" +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -4967,9 +5008,9 @@ xml@^1.0.1: integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU= xtend@^4.0.0, xtend@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== "y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: version "4.0.0" @@ -4996,7 +5037,32 @@ yargs-parser@^11.1.1: camelcase "^5.0.0" decamelize "^1.2.0" -yargs@^12.0.2, yargs@^12.0.5: +yargs-parser@^13.1.0: + version "13.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" + integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@13.2.4: + version "13.2.4" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.4.tgz#0b562b794016eb9651b98bd37acf364aa5d6dc83" + integrity sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + os-locale "^3.1.0" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.0" + +yargs@^12.0.2: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== From 8b9503ee9ed38a58ce76445fd54f189912282abf Mon Sep 17 00:00:00 2001 From: Mikael Mengistu Date: Mon, 15 Jul 2019 11:31:37 -0700 Subject: [PATCH 24/76] Acquire HubConnectionStateLock before Send/Invoke/Stream (#12078) --- .../com/microsoft/signalr/HubConnection.java | 171 ++++++++++-------- .../microsoft/signalr/HubConnectionTest.java | 11 +- .../WebSocketTransportUrlFormatTest.java | 1 - .../com/microsoft/signalr/sample/Chat.java | 2 +- 4 files changed, 110 insertions(+), 75 deletions(-) diff --git a/src/SignalR/clients/java/signalr/src/main/java/com/microsoft/signalr/HubConnection.java b/src/SignalR/clients/java/signalr/src/main/java/com/microsoft/signalr/HubConnection.java index 67669576e7..a4d1e58c7d 100644 --- a/src/SignalR/clients/java/signalr/src/main/java/com/microsoft/signalr/HubConnection.java +++ b/src/SignalR/clients/java/signalr/src/main/java/com/microsoft/signalr/HubConnection.java @@ -537,11 +537,15 @@ public class HubConnection { * @param args The arguments to be passed to the method. */ public void send(String method, Object... args) { - if (hubConnectionState != HubConnectionState.CONNECTED) { - throw new RuntimeException("The 'send' method cannot be called if the connection is not active."); + hubConnectionStateLock.lock(); + try { + if (hubConnectionState != HubConnectionState.CONNECTED) { + throw new RuntimeException("The 'send' method cannot be called if the connection is not active."); + } + sendInvocationMessage(method, args); + } finally { + hubConnectionStateLock.unlock(); } - - sendInvocationMessage(method, args); } private void sendInvocationMessage(String method, Object[] args) { @@ -605,26 +609,31 @@ public class HubConnection { */ @SuppressWarnings("unchecked") public Completable invoke(String method, Object... args) { - if (hubConnectionState != HubConnectionState.CONNECTED) { - throw new RuntimeException("The 'invoke' method cannot be called if the connection is not active."); + hubConnectionStateLock.lock(); + try { + if (hubConnectionState != HubConnectionState.CONNECTED) { + throw new RuntimeException("The 'invoke' method cannot be called if the connection is not active."); + } + + String id = connectionState.getNextInvocationId(); + + CompletableSubject subject = CompletableSubject.create(); + InvocationRequest irq = new InvocationRequest(null, id); + connectionState.addInvocation(irq); + + Subject pendingCall = irq.getPendingCall(); + + pendingCall.subscribe(result -> subject.onComplete(), + error -> subject.onError(error), + () -> subject.onComplete()); + + // Make sure the actual send is after setting up the callbacks otherwise there is a race + // where the map doesn't have the callbacks yet when the response is returned + sendInvocationMessage(method, args, id, false); + return subject; + } finally { + hubConnectionStateLock.unlock(); } - - String id = connectionState.getNextInvocationId(); - - CompletableSubject subject = CompletableSubject.create(); - InvocationRequest irq = new InvocationRequest(null, id); - connectionState.addInvocation(irq); - - Subject pendingCall = irq.getPendingCall(); - - pendingCall.subscribe(result -> subject.onComplete(), - error -> subject.onError(error), - () -> subject.onComplete()); - - // Make sure the actual send is after setting up the callbacks otherwise there is a race - // where the map doesn't have the callbacks yet when the response is returned - sendInvocationMessage(method, args, id, false); - return subject; } /** @@ -638,32 +647,37 @@ public class HubConnection { */ @SuppressWarnings("unchecked") public Single invoke(Class returnType, String method, Object... args) { - if (hubConnectionState != HubConnectionState.CONNECTED) { - throw new RuntimeException("The 'invoke' method cannot be called if the connection is not active."); - } - - String id = connectionState.getNextInvocationId(); - - SingleSubject subject = SingleSubject.create(); - InvocationRequest irq = new InvocationRequest(returnType, id); - connectionState.addInvocation(irq); - - // forward the invocation result or error to the user - // run continuations on a separate thread - Subject pendingCall = irq.getPendingCall(); - pendingCall.subscribe(result -> { - // Primitive types can't be cast with the Class cast function - if (returnType.isPrimitive()) { - subject.onSuccess((T)result); - } else { - subject.onSuccess(returnType.cast(result)); + hubConnectionStateLock.lock(); + try { + if (hubConnectionState != HubConnectionState.CONNECTED) { + throw new RuntimeException("The 'invoke' method cannot be called if the connection is not active."); } - }, error -> subject.onError(error)); - // Make sure the actual send is after setting up the callbacks otherwise there is a race - // where the map doesn't have the callbacks yet when the response is returned - sendInvocationMessage(method, args, id, false); - return subject; + String id = connectionState.getNextInvocationId(); + InvocationRequest irq = new InvocationRequest(returnType, id); + connectionState.addInvocation(irq); + + SingleSubject subject = SingleSubject.create(); + + // forward the invocation result or error to the user + // run continuations on a separate thread + Subject pendingCall = irq.getPendingCall(); + pendingCall.subscribe(result -> { + // Primitive types can't be cast with the Class cast function + if (returnType.isPrimitive()) { + subject.onSuccess((T)result); + } else { + subject.onSuccess(returnType.cast(result)); + } + }, error -> subject.onError(error)); + + // Make sure the actual send is after setting up the callbacks otherwise there is a race + // where the map doesn't have the callbacks yet when the response is returned + sendInvocationMessage(method, args, id, false); + return subject; + } finally { + hubConnectionStateLock.unlock(); + } } /** @@ -677,33 +691,46 @@ public class HubConnection { */ @SuppressWarnings("unchecked") public Observable stream(Class returnType, String method, Object ... args) { - String invocationId = connectionState.getNextInvocationId(); - AtomicInteger subscriptionCount = new AtomicInteger(); - InvocationRequest irq = new InvocationRequest(returnType, invocationId); - connectionState.addInvocation(irq); - ReplaySubject subject = ReplaySubject.create(); - - Subject pendingCall = irq.getPendingCall(); - pendingCall.subscribe(result -> { - // Primitive types can't be cast with the Class cast function - if (returnType.isPrimitive()) { - subject.onNext((T)result); - } else { - subject.onNext(returnType.cast(result)); + String invocationId; + InvocationRequest irq; + hubConnectionStateLock.lock(); + try { + if (hubConnectionState != HubConnectionState.CONNECTED) { + throw new RuntimeException("The 'stream' method cannot be called if the connection is not active."); } - }, error -> subject.onError(error), - () -> subject.onComplete()); - Observable observable = subject.doOnSubscribe((subscriber) -> subscriptionCount.incrementAndGet()); - sendInvocationMessage(method, args, invocationId, true); - return observable.doOnDispose(() -> { - if (subscriptionCount.decrementAndGet() == 0) { - CancelInvocationMessage cancelInvocationMessage = new CancelInvocationMessage(invocationId); - sendHubMessage(cancelInvocationMessage); - connectionState.tryRemoveInvocation(invocationId); - subject.onComplete(); - } - }); + invocationId = connectionState.getNextInvocationId(); + irq = new InvocationRequest(returnType, invocationId); + connectionState.addInvocation(irq); + + AtomicInteger subscriptionCount = new AtomicInteger(); + ReplaySubject subject = ReplaySubject.create(); + Subject pendingCall = irq.getPendingCall(); + pendingCall.subscribe(result -> { + // Primitive types can't be cast with the Class cast function + if (returnType.isPrimitive()) { + subject.onNext((T)result); + } else { + subject.onNext(returnType.cast(result)); + } + }, error -> subject.onError(error), + () -> subject.onComplete()); + + Observable observable = subject.doOnSubscribe((subscriber) -> subscriptionCount.incrementAndGet()); + sendInvocationMessage(method, args, invocationId, true); + return observable.doOnDispose(() -> { + if (subscriptionCount.decrementAndGet() == 0) { + CancelInvocationMessage cancelInvocationMessage = new CancelInvocationMessage(invocationId); + sendHubMessage(cancelInvocationMessage); + if (connectionState != null) { + connectionState.tryRemoveInvocation(invocationId); + } + subject.onComplete(); + } + }); + } finally { + hubConnectionStateLock.unlock(); + } } private void sendHubMessage(HubMessage message) { diff --git a/src/SignalR/clients/java/signalr/src/test/java/com/microsoft/signalr/HubConnectionTest.java b/src/SignalR/clients/java/signalr/src/test/java/com/microsoft/signalr/HubConnectionTest.java index b5104919ab..0ff3be7fd0 100644 --- a/src/SignalR/clients/java/signalr/src/test/java/com/microsoft/signalr/HubConnectionTest.java +++ b/src/SignalR/clients/java/signalr/src/test/java/com/microsoft/signalr/HubConnectionTest.java @@ -1608,6 +1608,15 @@ class HubConnectionTest { assertEquals("The 'invoke' method cannot be called if the connection is not active.", exception.getMessage()); } + @Test + public void cannotStreamBeforeStart() { + HubConnection hubConnection = TestUtils.createHubConnection("http://example.com"); + assertEquals(HubConnectionState.DISCONNECTED, hubConnection.getConnectionState()); + + Throwable exception = assertThrows(RuntimeException.class, () -> hubConnection.stream(String.class, "inc", "arg1")); + assertEquals("The 'stream' method cannot be called if the connection is not active.", exception.getMessage()); + } + @Test public void doesNotErrorWhenReceivingInvokeWithIncorrectArgumentLength() { MockTransport mockTransport = new MockTransport(); @@ -2036,7 +2045,7 @@ class HubConnectionTest { TestHttpClient client = new TestHttpClient() .on("POST", "http://example.com/negotiate", (req) -> { - if(redirectCount.get() == 0){ + if (redirectCount.get() == 0) { redirectCount.incrementAndGet(); redirectToken.set(req.getHeaders().get("Authorization")); return Single.just(new HttpResponse(200, "", "{\"url\":\"http://testexample.com/\",\"accessToken\":\"firstRedirectToken\"}")); diff --git a/src/SignalR/clients/java/signalr/src/test/java/com/microsoft/signalr/WebSocketTransportUrlFormatTest.java b/src/SignalR/clients/java/signalr/src/test/java/com/microsoft/signalr/WebSocketTransportUrlFormatTest.java index 2631084a34..1dbe653dcc 100644 --- a/src/SignalR/clients/java/signalr/src/test/java/com/microsoft/signalr/WebSocketTransportUrlFormatTest.java +++ b/src/SignalR/clients/java/signalr/src/test/java/com/microsoft/signalr/WebSocketTransportUrlFormatTest.java @@ -8,7 +8,6 @@ import static org.junit.jupiter.api.Assertions.*; import java.util.HashMap; import java.util.stream.Stream; -import io.reactivex.Single; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; diff --git a/src/SignalR/clients/java/signalr/src/test/java/com/microsoft/signalr/sample/Chat.java b/src/SignalR/clients/java/signalr/src/test/java/com/microsoft/signalr/sample/Chat.java index bd617fe88e..5201a09158 100644 --- a/src/SignalR/clients/java/signalr/src/test/java/com/microsoft/signalr/sample/Chat.java +++ b/src/SignalR/clients/java/signalr/src/test/java/com/microsoft/signalr/sample/Chat.java @@ -37,6 +37,6 @@ public class Chat { hubConnection.send("Send", message); } - hubConnection.stop(); + hubConnection.stop().blockingAwait(); } } From 09722d1ce59d4a7740451e065256ec62cbdb32a9 Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Mon, 15 Jul 2019 21:38:46 +0200 Subject: [PATCH 25/76] MVC use concrete types for DiagnosticListener (#11730) * MVC use concrete types for DiagnosticListener * Use DiagnosticListener not DiagnosticSource * Implement interface explicitly * Code check * Feedback * Feedback * IReadOnlyDictionary * Remove InstrumentationContext * DiagnosticSource in RazorPageActivator * Code check * Feedback --- .../Hosting/test/HostingApplicationTests.cs | 74 +- src/Http/Http/src/DefaultHttpContext.cs | 2 +- ...osoft.AspNetCore.Mvc.Core.netcoreapp3.0.cs | 304 ++++++++ src/Mvc/Mvc.Core/src/Diagnostics/EventData.cs | 64 ++ .../src/Diagnostics/MvcDiagnostics.cs | 736 ++++++++++++++++++ ...=> MvcCoreDiagnosticListenerExtensions.cs} | 457 +++++------ ...soft.AspNetCore.Mvc.Razor.netcoreapp3.0.cs | 25 + .../src/Diagnostics/MvcDiagnostics.cs | 74 ++ ...> MvcRazorDiagnosticListenerExtensions.cs} | 40 +- src/Mvc/Mvc.Razor/src/RazorPage.cs | 29 +- .../Mvc.Razor/test/RazorPageActivatorTest.cs | 12 +- src/Mvc/Mvc.Razor/test/RazorPageTest.cs | 210 ----- ...AspNetCore.Mvc.RazorPages.netcoreapp3.0.cs | 126 +++ .../src/Diagnostics/MvcDiagnostics.cs | 333 ++++++++ ...RazorPagesDiagnosticListenerExtensions.cs} | 197 +++-- src/Mvc/Mvc.RazorPages/src/PageBase.cs | 29 +- ...pNetCore.Mvc.ViewFeatures.netcoreapp3.0.cs | 88 ++- .../src/Diagnostics/MvcDiagnostics.cs | 228 ++++++ ...ewFeaturesDiagnosticListenerExtensions.cs} | 123 ++- .../src/PartialViewResultExecutor.cs | 4 +- src/Mvc/Mvc.ViewFeatures/src/ViewExecutor.cs | 12 +- .../src/ViewResultExecutor.cs | 40 +- .../test/ViewComponentResultTest.cs | 2 +- .../ViewViewComponentResultTest.cs | 2 +- 24 files changed, 2435 insertions(+), 776 deletions(-) create mode 100644 src/Mvc/Mvc.Core/src/Diagnostics/EventData.cs create mode 100644 src/Mvc/Mvc.Core/src/Diagnostics/MvcDiagnostics.cs rename src/Mvc/Mvc.Core/src/{MvcCoreDiagnosticSourceExtensions.cs => MvcCoreDiagnosticListenerExtensions.cs} (68%) create mode 100644 src/Mvc/Mvc.Razor/src/Diagnostics/MvcDiagnostics.cs rename src/Mvc/Mvc.Razor/src/{MvcRazorDiagnosticSourceExtensions.cs => MvcRazorDiagnosticListenerExtensions.cs} (62%) create mode 100644 src/Mvc/Mvc.RazorPages/src/Diagnostics/MvcDiagnostics.cs rename src/Mvc/Mvc.RazorPages/src/{MvcRazorPagesDiagnosticSourceExtensions.cs => MvcRazorPagesDiagnosticListenerExtensions.cs} (66%) create mode 100644 src/Mvc/Mvc.ViewFeatures/src/Diagnostics/MvcDiagnostics.cs rename src/Mvc/Mvc.ViewFeatures/src/{MvcViewFeaturesDiagnosticSourceExtensions.cs => MvcViewFeaturesDiagnosticListenerExtensions.cs} (62%) diff --git a/src/Hosting/Hosting/test/HostingApplicationTests.cs b/src/Hosting/Hosting/test/HostingApplicationTests.cs index fd8680100d..64d832eb0c 100644 --- a/src/Hosting/Hosting/test/HostingApplicationTests.cs +++ b/src/Hosting/Hosting/test/HostingApplicationTests.cs @@ -88,13 +88,13 @@ namespace Microsoft.AspNetCore.Hosting.Tests public void ActivityStopDoesNotFireIfNoListenerAttachedForStart() { // Arrange - var diagnosticSource = new DiagnosticListener("DummySource"); + var diagnosticListener = new DiagnosticListener("DummySource"); var logger = new LoggerWithScopes(isEnabled: true); - var hostingApplication = CreateApplication(out var features, diagnosticSource: diagnosticSource, logger: logger); + var hostingApplication = CreateApplication(out var features, diagnosticListener: diagnosticListener, logger: logger); var startFired = false; var stopFired = false; - diagnosticSource.Subscribe(new CallbackDiagnosticListener(pair => + diagnosticListener.Subscribe(new CallbackDiagnosticListener(pair => { // This should not fire if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Start") @@ -128,14 +128,14 @@ namespace Microsoft.AspNetCore.Hosting.Tests [Fact] public void ActivityIsNotCreatedWhenIsEnabledForActivityIsFalse() { - var diagnosticSource = new DiagnosticListener("DummySource"); - var hostingApplication = CreateApplication(out var features, diagnosticSource: diagnosticSource); + var diagnosticListener = new DiagnosticListener("DummySource"); + var hostingApplication = CreateApplication(out var features, diagnosticListener: diagnosticListener); bool eventsFired = false; bool isEnabledActivityFired = false; bool isEnabledStartFired = false; - diagnosticSource.Subscribe(new CallbackDiagnosticListener(pair => + diagnosticListener.Subscribe(new CallbackDiagnosticListener(pair => { eventsFired |= pair.Key.StartsWith("Microsoft.AspNetCore.Hosting.HttpRequestIn"); }), (s, o, arg3) => @@ -162,14 +162,14 @@ namespace Microsoft.AspNetCore.Hosting.Tests [Fact] public void ActivityIsCreatedButNotLoggedWhenIsEnabledForActivityStartIsFalse() { - var diagnosticSource = new DiagnosticListener("DummySource"); - var hostingApplication = CreateApplication(out var features, diagnosticSource: diagnosticSource); + var diagnosticListener = new DiagnosticListener("DummySource"); + var hostingApplication = CreateApplication(out var features, diagnosticListener: diagnosticListener); bool eventsFired = false; bool isEnabledStartFired = false; bool isEnabledActivityFired = false; - diagnosticSource.Subscribe(new CallbackDiagnosticListener(pair => + diagnosticListener.Subscribe(new CallbackDiagnosticListener(pair => { eventsFired |= pair.Key.StartsWith("Microsoft.AspNetCore.Hosting.HttpRequestIn"); }), (s, o, arg3) => @@ -199,12 +199,12 @@ namespace Microsoft.AspNetCore.Hosting.Tests [Fact] public void ActivityIsCreatedAndLogged() { - var diagnosticSource = new DiagnosticListener("DummySource"); - var hostingApplication = CreateApplication(out var features, diagnosticSource: diagnosticSource); + var diagnosticListener = new DiagnosticListener("DummySource"); + var hostingApplication = CreateApplication(out var features, diagnosticListener: diagnosticListener); bool startCalled = false; - diagnosticSource.Subscribe(new CallbackDiagnosticListener(pair => + diagnosticListener.Subscribe(new CallbackDiagnosticListener(pair => { if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Start") { @@ -224,11 +224,11 @@ namespace Microsoft.AspNetCore.Hosting.Tests [Fact] public void ActivityIsStoppedDuringStopCall() { - var diagnosticSource = new DiagnosticListener("DummySource"); - var hostingApplication = CreateApplication(out var features, diagnosticSource: diagnosticSource); + var diagnosticListener = new DiagnosticListener("DummySource"); + var hostingApplication = CreateApplication(out var features, diagnosticListener: diagnosticListener); bool endCalled = false; - diagnosticSource.Subscribe(new CallbackDiagnosticListener(pair => + diagnosticListener.Subscribe(new CallbackDiagnosticListener(pair => { if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Stop") { @@ -249,11 +249,11 @@ namespace Microsoft.AspNetCore.Hosting.Tests [Fact] public void ActivityIsStoppedDuringUnhandledExceptionCall() { - var diagnosticSource = new DiagnosticListener("DummySource"); - var hostingApplication = CreateApplication(out var features, diagnosticSource: diagnosticSource); + var diagnosticListener = new DiagnosticListener("DummySource"); + var hostingApplication = CreateApplication(out var features, diagnosticListener: diagnosticListener); bool endCalled = false; - diagnosticSource.Subscribe(new CallbackDiagnosticListener(pair => + diagnosticListener.Subscribe(new CallbackDiagnosticListener(pair => { if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Stop") { @@ -273,11 +273,11 @@ namespace Microsoft.AspNetCore.Hosting.Tests [Fact] public void ActivityIsAvailableDuringUnhandledExceptionCall() { - var diagnosticSource = new DiagnosticListener("DummySource"); - var hostingApplication = CreateApplication(out var features, diagnosticSource: diagnosticSource); + var diagnosticListener = new DiagnosticListener("DummySource"); + var hostingApplication = CreateApplication(out var features, diagnosticListener: diagnosticListener); bool endCalled = false; - diagnosticSource.Subscribe(new CallbackDiagnosticListener(pair => + diagnosticListener.Subscribe(new CallbackDiagnosticListener(pair => { if (pair.Key == "Microsoft.AspNetCore.Hosting.UnhandledException") { @@ -295,10 +295,10 @@ namespace Microsoft.AspNetCore.Hosting.Tests [Fact] public void ActivityIsAvailibleDuringRequest() { - var diagnosticSource = new DiagnosticListener("DummySource"); - var hostingApplication = CreateApplication(out var features, diagnosticSource: diagnosticSource); + var diagnosticListener = new DiagnosticListener("DummySource"); + var hostingApplication = CreateApplication(out var features, diagnosticListener: diagnosticListener); - diagnosticSource.Subscribe(new CallbackDiagnosticListener(pair => { }), + diagnosticListener.Subscribe(new CallbackDiagnosticListener(pair => { }), s => { if (s.StartsWith("Microsoft.AspNetCore.Hosting.HttpRequestIn")) @@ -317,10 +317,10 @@ namespace Microsoft.AspNetCore.Hosting.Tests [Fact] public void ActivityParentIdAndBaggeReadFromHeaders() { - var diagnosticSource = new DiagnosticListener("DummySource"); - var hostingApplication = CreateApplication(out var features, diagnosticSource: diagnosticSource); + var diagnosticListener = new DiagnosticListener("DummySource"); + var hostingApplication = CreateApplication(out var features, diagnosticListener: diagnosticListener); - diagnosticSource.Subscribe(new CallbackDiagnosticListener(pair => { }), + diagnosticListener.Subscribe(new CallbackDiagnosticListener(pair => { }), s => { if (s.StartsWith("Microsoft.AspNetCore.Hosting.HttpRequestIn")) @@ -349,10 +349,10 @@ namespace Microsoft.AspNetCore.Hosting.Tests [Fact] public void ActivityTraceParentAndTraceStateFromHeaders() { - var diagnosticSource = new DiagnosticListener("DummySource"); - var hostingApplication = CreateApplication(out var features, diagnosticSource: diagnosticSource); + var diagnosticListener = new DiagnosticListener("DummySource"); + var hostingApplication = CreateApplication(out var features, diagnosticListener: diagnosticListener); - diagnosticSource.Subscribe(new CallbackDiagnosticListener(pair => { }), + diagnosticListener.Subscribe(new CallbackDiagnosticListener(pair => { }), s => { if (s.StartsWith("Microsoft.AspNetCore.Hosting.HttpRequestIn")) @@ -385,11 +385,11 @@ namespace Microsoft.AspNetCore.Hosting.Tests [Fact] public void ActivityOnExportHookIsCalled() { - var diagnosticSource = new DiagnosticListener("DummySource"); - var hostingApplication = CreateApplication(out var features, diagnosticSource: diagnosticSource); + var diagnosticListener = new DiagnosticListener("DummySource"); + var hostingApplication = CreateApplication(out var features, diagnosticListener: diagnosticListener); bool onActivityImportCalled = false; - diagnosticSource.Subscribe( + diagnosticListener.Subscribe( observer: new CallbackDiagnosticListener(pair => { }), isEnabled: (s, o, _) => true, onActivityImport: (activity, context) => @@ -422,7 +422,7 @@ namespace Microsoft.AspNetCore.Hosting.Tests } private static HostingApplication CreateApplication(out FeatureCollection features, - DiagnosticListener diagnosticSource = null, ILogger logger = null, Action configure = null) + DiagnosticListener diagnosticListener = null, ILogger logger = null, Action configure = null) { var httpContextFactory = new Mock(); @@ -436,7 +436,7 @@ namespace Microsoft.AspNetCore.Hosting.Tests var hostingApplication = new HostingApplication( ctx => Task.CompletedTask, logger ?? new NullScopeLogger(), - diagnosticSource ?? new NoopDiagnosticSource(), + diagnosticListener ?? new NoopDiagnosticListener(), httpContextFactory.Object); return hostingApplication; @@ -490,11 +490,11 @@ namespace Microsoft.AspNetCore.Hosting.Tests } } - private class NoopDiagnosticSource : DiagnosticListener + private class NoopDiagnosticListener : DiagnosticListener { private readonly bool _isEnabled; - public NoopDiagnosticSource(bool isEnabled = false) : base("DummyListener") + public NoopDiagnosticListener(bool isEnabled = false) : base("DummyListener") { _isEnabled = isEnabled; } diff --git a/src/Http/Http/src/DefaultHttpContext.cs b/src/Http/Http/src/DefaultHttpContext.cs index cbc2449058..60e0a185a6 100644 --- a/src/Http/Http/src/DefaultHttpContext.cs +++ b/src/Http/Http/src/DefaultHttpContext.cs @@ -159,7 +159,7 @@ namespace Microsoft.AspNetCore.Http // This property exists because of backwards compatibility. // We send an anonymous object with an HttpContext property - // via DiagnosticSource in various events throughout the pipeline. Instead + // via DiagnosticListener in various events throughout the pipeline. Instead // we just send the HttpContext to avoid extra allocations [EditorBrowsable(EditorBrowsableState.Never)] public HttpContext HttpContext => this; diff --git a/src/Mvc/Mvc.Core/ref/Microsoft.AspNetCore.Mvc.Core.netcoreapp3.0.cs b/src/Mvc/Mvc.Core/ref/Microsoft.AspNetCore.Mvc.Core.netcoreapp3.0.cs index ce0bbc1f92..5294f760ff 100644 --- a/src/Mvc/Mvc.Core/ref/Microsoft.AspNetCore.Mvc.Core.netcoreapp3.0.cs +++ b/src/Mvc/Mvc.Core/ref/Microsoft.AspNetCore.Mvc.Core.netcoreapp3.0.cs @@ -1726,6 +1726,310 @@ namespace Microsoft.AspNetCore.Mvc.Core.Infrastructure { } } +namespace Microsoft.AspNetCore.Mvc.Diagnostics +{ + public sealed partial class AfterAction : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterAction"; + public AfterAction(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Http.HttpContext httpContext, Microsoft.AspNetCore.Routing.RouteData routeData) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Http.HttpContext HttpContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Routing.RouteData RouteData { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class AfterActionMethod : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterActionMethod"; + public AfterActionMethod(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.Collections.Generic.IReadOnlyDictionary arguments, object controller, Microsoft.AspNetCore.Mvc.IActionResult result) { } + public Microsoft.AspNetCore.Mvc.ActionContext ActionContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Arguments { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public object Controller { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.IActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class AfterActionResult : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterActionResult"; + public AfterActionResult(Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.IActionResult result) { } + public Microsoft.AspNetCore.Mvc.ActionContext ActionContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.IActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class AfterOnActionExecuted : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnActionExecuted"; + public AfterOnActionExecuted(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext actionExecutedContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext ActionExecutedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class AfterOnActionExecuting : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnActionExecuting"; + public AfterOnActionExecuting(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext actionExecutingContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext ActionExecutingContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class AfterOnActionExecution : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnActionExecution"; + public AfterOnActionExecution(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext actionExecutedContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext ActionExecutedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class AfterOnAuthorization : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnAuthorization"; + public AfterOnAuthorization(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.AuthorizationFilterContext authorizationContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.AuthorizationFilterContext AuthorizationContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class AfterOnException : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnException"; + public AfterOnException(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ExceptionContext exceptionContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ExceptionContext ExceptionContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class AfterOnResourceExecuted : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnResourceExecuted"; + public AfterOnResourceExecuted(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ResourceExecutedContext resourceExecutedContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ResourceExecutedContext ResourceExecutedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class AfterOnResourceExecuting : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnResourceExecuting"; + public AfterOnResourceExecuting(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ResourceExecutingContext resourceExecutingContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ResourceExecutingContext ResourceExecutingContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class AfterOnResourceExecution : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnResourceExecution"; + public AfterOnResourceExecution(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ResourceExecutedContext resourceExecutedContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ResourceExecutedContext ResourceExecutedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class AfterOnResultExecuted : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnResultExecuted"; + public AfterOnResultExecuted(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ResultExecutedContext resultExecutedContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ResultExecutedContext ResultExecutedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class AfterOnResultExecuting : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnResultExecuting"; + public AfterOnResultExecuting(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ResultExecutingContext resultExecutingContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ResultExecutingContext ResultExecutingContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class AfterOnResultExecution : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnResultExecution"; + public AfterOnResultExecution(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ResultExecutedContext resultExecutedContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ResultExecutedContext ResultExecutedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class BeforeAction : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeAction"; + public BeforeAction(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Http.HttpContext httpContext, Microsoft.AspNetCore.Routing.RouteData routeData) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Http.HttpContext HttpContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Routing.RouteData RouteData { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class BeforeActionMethod : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeActionMethod"; + public BeforeActionMethod(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.Collections.Generic.IReadOnlyDictionary arguments, object controller) { } + public Microsoft.AspNetCore.Mvc.ActionContext ActionContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Arguments { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public object Controller { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class BeforeActionResult : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeActionResult"; + public BeforeActionResult(Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.IActionResult result) { } + public Microsoft.AspNetCore.Mvc.ActionContext ActionContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.IActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class BeforeOnActionExecuted : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnActionExecuted"; + public BeforeOnActionExecuted(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext actionExecutedContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext ActionExecutedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class BeforeOnActionExecuting : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnActionExecuting"; + public BeforeOnActionExecuting(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext actionExecutingContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext ActionExecutingContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class BeforeOnActionExecution : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnActionExecution"; + public BeforeOnActionExecution(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext actionExecutingContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext ActionExecutingContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class BeforeOnAuthorization : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnAuthorization"; + public BeforeOnAuthorization(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.AuthorizationFilterContext authorizationContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.AuthorizationFilterContext AuthorizationContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class BeforeOnException : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnException"; + public BeforeOnException(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ExceptionContext exceptionContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ExceptionContext ExceptionContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class BeforeOnResourceExecuted : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnResourceExecuted"; + public BeforeOnResourceExecuted(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ResourceExecutedContext resourceExecutedContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ResourceExecutedContext ResourceExecutedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class BeforeOnResourceExecuting : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnResourceExecuting"; + public BeforeOnResourceExecuting(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ResourceExecutingContext resourceExecutingContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ResourceExecutingContext ResourceExecutingContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class BeforeOnResourceExecution : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnResourceExecution"; + public BeforeOnResourceExecution(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ResourceExecutingContext resourceExecutingContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ResourceExecutingContext ResourceExecutingContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class BeforeOnResultExecuted : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnResultExecuted"; + public BeforeOnResultExecuted(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ResultExecutedContext resultExecutedContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ResultExecutedContext ResultExecutedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class BeforeOnResultExecuting : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnResultExecuting"; + public BeforeOnResultExecuting(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ResultExecutingContext resultExecutingContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ResultExecutingContext ResultExecutingContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class BeforeOnResultExecution : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnResultExecution"; + public BeforeOnResultExecution(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.ResultExecutingContext resultExecutingContext, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.ResultExecutingContext ResultExecutingContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public abstract partial class EventData : System.Collections.Generic.IEnumerable>, System.Collections.Generic.IReadOnlyCollection>, System.Collections.Generic.IReadOnlyList>, System.Collections.IEnumerable + { + protected const string EventNamespace = "Microsoft.AspNetCore.Mvc."; + protected EventData() { } + protected abstract int Count { get; } + protected abstract System.Collections.Generic.KeyValuePair this[int index] { get; } + int System.Collections.Generic.IReadOnlyCollection>.Count { get { throw null; } } + System.Collections.Generic.KeyValuePair System.Collections.Generic.IReadOnlyList>.this[int index] { get { throw null; } } + System.Collections.Generic.IEnumerator> System.Collections.Generic.IEnumerable>.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public partial struct Enumerator : System.Collections.Generic.IEnumerator>, System.Collections.IEnumerator, System.IDisposable + { + private object _dummy; + private int _dummyPrimitive; + public System.Collections.Generic.KeyValuePair Current { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + object System.Collections.IEnumerator.Current { get { throw null; } } + public void Dispose() { } + public bool MoveNext() { throw null; } + void System.Collections.IEnumerator.Reset() { } + } + } +} namespace Microsoft.AspNetCore.Mvc.Filters { [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)] diff --git a/src/Mvc/Mvc.Core/src/Diagnostics/EventData.cs b/src/Mvc/Mvc.Core/src/Diagnostics/EventData.cs new file mode 100644 index 0000000000..b9d064c314 --- /dev/null +++ b/src/Mvc/Mvc.Core/src/Diagnostics/EventData.cs @@ -0,0 +1,64 @@ +// 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; +using System.Collections.Generic; + +namespace Microsoft.AspNetCore.Mvc.Diagnostics +{ + public abstract class EventData : IReadOnlyList> + { + protected const string EventNamespace = "Microsoft.AspNetCore.Mvc."; + + protected abstract int Count { get; } + protected abstract KeyValuePair this[int index] { get; } + + int IReadOnlyCollection>.Count => Count; + KeyValuePair IReadOnlyList>.this[int index] => this[index]; + + Enumerator GetEnumerator() => new Enumerator(this); + + IEnumerator> IEnumerable>.GetEnumerator() + => GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => GetEnumerator(); + + public struct Enumerator : IEnumerator> + { + private readonly EventData _eventData; + private readonly int _count; + + private int _index; + + public KeyValuePair Current { get; private set; } + + internal Enumerator(EventData eventData) + { + _eventData = eventData; + _count = eventData.Count; + _index = -1; + Current = default; + } + + public bool MoveNext() + { + var index = _index + 1; + if (index >= _count) + { + return false; + } + + _index = index; + + Current = _eventData[index]; + return true; + } + + public void Dispose() { } + object IEnumerator.Current => Current; + void IEnumerator.Reset() => throw new NotSupportedException(); + } + } +} diff --git a/src/Mvc/Mvc.Core/src/Diagnostics/MvcDiagnostics.cs b/src/Mvc/Mvc.Core/src/Diagnostics/MvcDiagnostics.cs new file mode 100644 index 0000000000..8c98d8f302 --- /dev/null +++ b/src/Mvc/Mvc.Core/src/Diagnostics/MvcDiagnostics.cs @@ -0,0 +1,736 @@ +// 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.Http; +using Microsoft.AspNetCore.Mvc.Abstractions; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Routing; + +namespace Microsoft.AspNetCore.Mvc.Diagnostics +{ + public sealed class BeforeAction : EventData + { + public const string EventName = EventNamespace + nameof(BeforeAction); + public BeforeAction(ActionDescriptor actionDescriptor, HttpContext httpContext, RouteData routeData) + { + ActionDescriptor = actionDescriptor; + HttpContext = httpContext; + RouteData = routeData; + } + + public ActionDescriptor ActionDescriptor { get; } + public HttpContext HttpContext { get; } + public RouteData RouteData { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(HttpContext), HttpContext), + 2 => new KeyValuePair(nameof(RouteData), RouteData), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterAction : EventData + { + public const string EventName = EventNamespace + nameof(AfterAction); + + public AfterAction(ActionDescriptor actionDescriptor, HttpContext httpContext, RouteData routeData) + { + ActionDescriptor = actionDescriptor; + HttpContext = httpContext; + RouteData = routeData; + } + + public ActionDescriptor ActionDescriptor { get; } + public HttpContext HttpContext { get; } + public RouteData RouteData { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(HttpContext), HttpContext), + 2 => new KeyValuePair(nameof(RouteData), RouteData), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnAuthorization : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnAuthorization); + + public BeforeOnAuthorization(ActionDescriptor actionDescriptor, AuthorizationFilterContext authorizationContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + AuthorizationContext = authorizationContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public AuthorizationFilterContext AuthorizationContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(AuthorizationContext), AuthorizationContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnAuthorization : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnAuthorization); + + public AfterOnAuthorization(ActionDescriptor actionDescriptor, AuthorizationFilterContext authorizationContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + AuthorizationContext = authorizationContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public AuthorizationFilterContext AuthorizationContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(AuthorizationContext), AuthorizationContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnResourceExecution : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnResourceExecution); + + public BeforeOnResourceExecution(ActionDescriptor actionDescriptor, ResourceExecutingContext resourceExecutingContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ResourceExecutingContext = resourceExecutingContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ResourceExecutingContext ResourceExecutingContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ResourceExecutingContext), ResourceExecutingContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnResourceExecution : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnResourceExecution); + + public AfterOnResourceExecution(ActionDescriptor actionDescriptor, ResourceExecutedContext resourceExecutedContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ResourceExecutedContext = resourceExecutedContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ResourceExecutedContext ResourceExecutedContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ResourceExecutedContext), ResourceExecutedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnResourceExecuting : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnResourceExecuting); + + public BeforeOnResourceExecuting(ActionDescriptor actionDescriptor, ResourceExecutingContext resourceExecutingContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ResourceExecutingContext = resourceExecutingContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ResourceExecutingContext ResourceExecutingContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ResourceExecutingContext), ResourceExecutingContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnResourceExecuting : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnResourceExecuting); + + public AfterOnResourceExecuting(ActionDescriptor actionDescriptor, ResourceExecutingContext resourceExecutingContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ResourceExecutingContext = resourceExecutingContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ResourceExecutingContext ResourceExecutingContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ResourceExecutingContext), ResourceExecutingContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnResourceExecuted : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnResourceExecuted); + + public BeforeOnResourceExecuted(ActionDescriptor actionDescriptor, ResourceExecutedContext resourceExecutedContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ResourceExecutedContext = resourceExecutedContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ResourceExecutedContext ResourceExecutedContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ResourceExecutedContext), ResourceExecutedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnResourceExecuted : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnResourceExecuted); + + public AfterOnResourceExecuted(ActionDescriptor actionDescriptor, ResourceExecutedContext resourceExecutedContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ResourceExecutedContext = resourceExecutedContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ResourceExecutedContext ResourceExecutedContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ResourceExecutedContext), ResourceExecutedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnException : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnException); + + public BeforeOnException(ActionDescriptor actionDescriptor, ExceptionContext exceptionContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ExceptionContext = exceptionContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ExceptionContext ExceptionContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ExceptionContext), ExceptionContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnException : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnException); + + public AfterOnException(ActionDescriptor actionDescriptor, ExceptionContext exceptionContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ExceptionContext = exceptionContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ExceptionContext ExceptionContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ExceptionContext), ExceptionContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnActionExecution : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnActionExecution); + + public BeforeOnActionExecution(ActionDescriptor actionDescriptor, ActionExecutingContext actionExecutingContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ActionExecutingContext = actionExecutingContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ActionExecutingContext ActionExecutingContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ActionExecutingContext), ActionExecutingContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnActionExecution : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnActionExecution); + + public AfterOnActionExecution(ActionDescriptor actionDescriptor, ActionExecutedContext actionExecutedContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ActionExecutedContext = actionExecutedContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ActionExecutedContext ActionExecutedContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ActionExecutedContext), ActionExecutedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnActionExecuting : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnActionExecuting); + + public BeforeOnActionExecuting(ActionDescriptor actionDescriptor, ActionExecutingContext actionExecutingContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ActionExecutingContext = actionExecutingContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ActionExecutingContext ActionExecutingContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ActionExecutingContext), ActionExecutingContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnActionExecuting : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnActionExecuting); + + public AfterOnActionExecuting(ActionDescriptor actionDescriptor, ActionExecutingContext actionExecutingContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ActionExecutingContext = actionExecutingContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ActionExecutingContext ActionExecutingContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ActionExecutingContext), ActionExecutingContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnActionExecuted : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnActionExecuted); + + public BeforeOnActionExecuted(ActionDescriptor actionDescriptor, ActionExecutedContext actionExecutedContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ActionExecutedContext = actionExecutedContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ActionExecutedContext ActionExecutedContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ActionExecutedContext), ActionExecutedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnActionExecuted : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnActionExecuted); + + public AfterOnActionExecuted(ActionDescriptor actionDescriptor, ActionExecutedContext actionExecutedContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ActionExecutedContext = actionExecutedContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ActionExecutedContext ActionExecutedContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ActionExecutedContext), ActionExecutedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeActionMethod : EventData + { + public const string EventName = EventNamespace + nameof(BeforeActionMethod); + + public BeforeActionMethod(ActionContext actionContext, IReadOnlyDictionary arguments, object controller) + { + ActionContext = actionContext; + Arguments = arguments; + Controller = controller; + } + + public ActionContext ActionContext { get; } + public IReadOnlyDictionary Arguments { get; } + public object Controller { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionContext), ActionContext), + 1 => new KeyValuePair(nameof(Arguments), Arguments), + 2 => new KeyValuePair(nameof(Controller), Controller), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterActionMethod : EventData + { + public const string EventName = EventNamespace + nameof(AfterActionMethod); + + public AfterActionMethod(ActionContext actionContext, IReadOnlyDictionary arguments, object controller, IActionResult result) + { + ActionContext = actionContext; + Arguments = arguments; + Controller = controller; + Result = result; + } + + public ActionContext ActionContext { get; } + public IReadOnlyDictionary Arguments { get; } + public object Controller { get; } + public IActionResult Result { get; } + + protected override int Count => 4; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionContext), ActionContext), + 1 => new KeyValuePair(nameof(Controller), Controller), + 2 => new KeyValuePair(nameof(Controller), Controller), + 3 => new KeyValuePair(nameof(Result), Result), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnResultExecution : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnResultExecution); + + public BeforeOnResultExecution(ActionDescriptor actionDescriptor, ResultExecutingContext resultExecutingContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ResultExecutingContext = resultExecutingContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ResultExecutingContext ResultExecutingContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ResultExecutingContext), ResultExecutingContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnResultExecution : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnResultExecution); + + public AfterOnResultExecution(ActionDescriptor actionDescriptor, ResultExecutedContext resultExecutedContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ResultExecutedContext = resultExecutedContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ResultExecutedContext ResultExecutedContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ResultExecutedContext), ResultExecutedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnResultExecuting : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnResultExecuting); + + public BeforeOnResultExecuting(ActionDescriptor actionDescriptor, ResultExecutingContext resultExecutingContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ResultExecutingContext = resultExecutingContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ResultExecutingContext ResultExecutingContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ResultExecutingContext), ResultExecutingContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnResultExecuting : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnResultExecuting); + + public AfterOnResultExecuting(ActionDescriptor actionDescriptor, ResultExecutingContext resultExecutingContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ResultExecutingContext = resultExecutingContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ResultExecutingContext ResultExecutingContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ResultExecutingContext), ResultExecutingContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnResultExecuted : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnResultExecuted); + + public BeforeOnResultExecuted(ActionDescriptor actionDescriptor, ResultExecutedContext resultExecutedContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ResultExecutedContext = resultExecutedContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ResultExecutedContext ResultExecutedContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ResultExecutedContext), ResultExecutedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnResultExecuted : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnResultExecuted); + + public AfterOnResultExecuted(ActionDescriptor actionDescriptor, ResultExecutedContext resultExecutedContext, IFilterMetadata filter) + { + ActionDescriptor = actionDescriptor; + ResultExecutedContext = resultExecutedContext; + Filter = filter; + } + + public ActionDescriptor ActionDescriptor { get; } + public ResultExecutedContext ResultExecutedContext { get; } + public IFilterMetadata Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ResultExecutedContext), ResultExecutedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeActionResult : EventData + { + public const string EventName = EventNamespace + nameof(BeforeActionResult); + + public BeforeActionResult(ActionContext actionContext, IActionResult result) + { + ActionContext = actionContext; + Result = result; + } + + public ActionContext ActionContext { get; } + public IActionResult Result { get; } + + protected override int Count => 2; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionContext), ActionContext), + 1 => new KeyValuePair(nameof(Result), Result), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterActionResult : EventData + { + public const string EventName = EventNamespace + nameof(AfterActionResult); + + public AfterActionResult(ActionContext actionContext, IActionResult result) + { + ActionContext = actionContext; + Result = result; + } + + public ActionContext ActionContext { get; } + public IActionResult Result { get; } + + protected override int Count => 2; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionContext), ActionContext), + 1 => new KeyValuePair(nameof(Result), Result), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } +} \ No newline at end of file diff --git a/src/Mvc/Mvc.Core/src/MvcCoreDiagnosticSourceExtensions.cs b/src/Mvc/Mvc.Core/src/MvcCoreDiagnosticListenerExtensions.cs similarity index 68% rename from src/Mvc/Mvc.Core/src/MvcCoreDiagnosticSourceExtensions.cs rename to src/Mvc/Mvc.Core/src/MvcCoreDiagnosticListenerExtensions.cs index 32085e7da8..89ff1bc905 100644 --- a/src/Mvc/Mvc.Core/src/MvcCoreDiagnosticSourceExtensions.cs +++ b/src/Mvc/Mvc.Core/src/MvcCoreDiagnosticListenerExtensions.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Diagnostics; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Abstractions; +using Microsoft.AspNetCore.Mvc.Diagnostics; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Routing; @@ -13,7 +14,7 @@ namespace Microsoft.AspNetCore.Mvc // We're doing a lot of asserts here because these methods are really tedious to test and // highly dependent on the details of the invoker's state machine. Basically if we wrote the // obvious unit tests that would generate a lot of boilerplate and wouldn't cover the hard parts. - internal static class MvcCoreDiagnosticSourceExtensions + internal static class MvcCoreDiagnosticListenerExtensions { public static void BeforeAction( this DiagnosticListener diagnosticListener, @@ -35,11 +36,11 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeActionImpl(DiagnosticListener diagnosticListener, ActionDescriptor actionDescriptor, HttpContext httpContext, RouteData routeData) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeAction")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeAction.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeAction", - new { actionDescriptor, httpContext = httpContext, routeData = routeData }); + Diagnostics.BeforeAction.EventName, + new BeforeAction(actionDescriptor, httpContext, routeData)); } } @@ -63,11 +64,11 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterActionImpl(DiagnosticListener diagnosticListener, ActionDescriptor actionDescriptor, HttpContext httpContext, RouteData routeData) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterAction")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterAction.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterAction", - new { actionDescriptor, httpContext = httpContext, routeData = routeData }); + Diagnostics.AfterAction.EventName, + new AfterAction(actionDescriptor, httpContext, routeData)); } } @@ -89,16 +90,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnAuthorizationAsyncImpl(DiagnosticListener diagnosticListener, AuthorizationFilterContext authorizationContext, IAsyncAuthorizationFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnAuthorization")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnAuthorization.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnAuthorization", - new - { - actionDescriptor = authorizationContext.ActionDescriptor, - authorizationContext = authorizationContext, - filter = filter - }); + Diagnostics.BeforeOnAuthorization.EventName, + new BeforeOnAuthorization( + authorizationContext.ActionDescriptor, + authorizationContext, + filter + )); } } @@ -120,16 +120,15 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnAuthorizationAsyncImpl(DiagnosticListener diagnosticListener, AuthorizationFilterContext authorizationContext, IAsyncAuthorizationFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnAuthorization")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnAuthorization.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnAuthorization", - new - { - actionDescriptor = authorizationContext.ActionDescriptor, - authorizationContext = authorizationContext, - filter = filter - }); + Diagnostics.AfterOnAuthorization.EventName, + new AfterOnAuthorization( + authorizationContext.ActionDescriptor, + authorizationContext, + filter + )); } } @@ -151,16 +150,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnAuthorizationImpl(DiagnosticListener diagnosticListener, AuthorizationFilterContext authorizationContext, IAuthorizationFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnAuthorization")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnAuthorization.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnAuthorization", - new - { - actionDescriptor = authorizationContext.ActionDescriptor, - authorizationContext = authorizationContext, - filter = filter - }); + Diagnostics.BeforeOnAuthorization.EventName, + new BeforeOnAuthorization( + authorizationContext.ActionDescriptor, + authorizationContext, + filter + )); } } @@ -182,16 +180,15 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnAuthorizationImpl(DiagnosticListener diagnosticListener, AuthorizationFilterContext authorizationContext, IAuthorizationFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnAuthorization")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnAuthorization.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnAuthorization", - new - { - actionDescriptor = authorizationContext.ActionDescriptor, - authorizationContext = authorizationContext, - filter = filter - }); + Diagnostics.AfterOnAuthorization.EventName, + new AfterOnAuthorization( + authorizationContext.ActionDescriptor, + authorizationContext, + filter + )); } } @@ -213,16 +210,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnResourceExecutionImpl(DiagnosticListener diagnosticListener, ResourceExecutingContext resourceExecutingContext, IAsyncResourceFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnResourceExecution")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnResourceExecution.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnResourceExecution", - new - { - actionDescriptor = resourceExecutingContext.ActionDescriptor, - resourceExecutingContext = resourceExecutingContext, - filter = filter - }); + Diagnostics.BeforeOnResourceExecution.EventName, + new BeforeOnResourceExecution( + resourceExecutingContext.ActionDescriptor, + resourceExecutingContext, + filter + )); } } @@ -244,16 +240,15 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnResourceExecutionImpl(DiagnosticListener diagnosticListener, ResourceExecutedContext resourceExecutedContext, IAsyncResourceFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnResourceExecution")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnResourceExecution.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnResourceExecution", - new - { - actionDescriptor = resourceExecutedContext.ActionDescriptor, - resourceExecutedContext = resourceExecutedContext, - filter = filter - }); + Diagnostics.AfterOnResourceExecution.EventName, + new AfterOnResourceExecution( + resourceExecutedContext.ActionDescriptor, + resourceExecutedContext, + filter + )); } } @@ -275,16 +270,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnResourceExecutingImpl(DiagnosticListener diagnosticListener, ResourceExecutingContext resourceExecutingContext, IResourceFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnResourceExecuting")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnResourceExecuting.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnResourceExecuting", - new - { - actionDescriptor = resourceExecutingContext.ActionDescriptor, - resourceExecutingContext = resourceExecutingContext, - filter = filter - }); + Diagnostics.BeforeOnResourceExecuting.EventName, + new BeforeOnResourceExecuting( + resourceExecutingContext.ActionDescriptor, + resourceExecutingContext, + filter + )); } } @@ -306,16 +300,15 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnResourceExecutingImpl(DiagnosticListener diagnosticListener, ResourceExecutingContext resourceExecutingContext, IResourceFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnResourceExecuting")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnResourceExecuting.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnResourceExecuting", - new - { - actionDescriptor = resourceExecutingContext.ActionDescriptor, - resourceExecutingContext = resourceExecutingContext, - filter = filter - }); + Diagnostics.AfterOnResourceExecuting.EventName, + new AfterOnResourceExecuting( + resourceExecutingContext.ActionDescriptor, + resourceExecutingContext, + filter + )); } } @@ -337,16 +330,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnResourceExecutedImpl(DiagnosticListener diagnosticListener, ResourceExecutedContext resourceExecutedContext, IResourceFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnResourceExecuted")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnResourceExecuted.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnResourceExecuted", - new - { - actionDescriptor = resourceExecutedContext.ActionDescriptor, - resourceExecutedContext = resourceExecutedContext, - filter = filter - }); + Diagnostics.BeforeOnResourceExecuted.EventName, + new BeforeOnResourceExecuted( + resourceExecutedContext.ActionDescriptor, + resourceExecutedContext, + filter + )); } } @@ -368,16 +360,15 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnResourceExecutedImpl(DiagnosticListener diagnosticListener, ResourceExecutedContext resourceExecutedContext, IResourceFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnResourceExecuted")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnResourceExecuted.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnResourceExecuted", - new - { - actionDescriptor = resourceExecutedContext.ActionDescriptor, - resourceExecutedContext = resourceExecutedContext, - filter = filter - }); + Diagnostics.AfterOnResourceExecuted.EventName, + new AfterOnResourceExecuted( + resourceExecutedContext.ActionDescriptor, + resourceExecutedContext, + filter + )); } } @@ -399,16 +390,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnExceptionAsyncImpl(DiagnosticListener diagnosticListener, ExceptionContext exceptionContext, IAsyncExceptionFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnException")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnException.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnException", - new - { - actionDescriptor = exceptionContext.ActionDescriptor, - exceptionContext = exceptionContext, - filter = filter - }); + Diagnostics.BeforeOnException.EventName, + new BeforeOnException( + exceptionContext.ActionDescriptor, + exceptionContext, + filter + )); } } @@ -430,16 +420,15 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnExceptionAsyncImpl(DiagnosticListener diagnosticListener, ExceptionContext exceptionContext, IAsyncExceptionFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnException")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnException.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnException", - new - { - actionDescriptor = exceptionContext.ActionDescriptor, - exceptionContext = exceptionContext, - filter = filter - }); + Diagnostics.AfterOnException.EventName, + new AfterOnException( + exceptionContext.ActionDescriptor, + exceptionContext, + filter + )); } } @@ -461,16 +450,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnExceptionImpl(DiagnosticListener diagnosticListener, ExceptionContext exceptionContext, IExceptionFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnException")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnException.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnException", - new - { - actionDescriptor = exceptionContext.ActionDescriptor, - exceptionContext = exceptionContext, - filter = filter - }); + Diagnostics.BeforeOnException.EventName, + new BeforeOnException( + exceptionContext.ActionDescriptor, + exceptionContext, + filter + )); } } @@ -492,16 +480,15 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnExceptionImpl(DiagnosticListener diagnosticListener, ExceptionContext exceptionContext, IExceptionFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnException")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnException.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnException", - new - { - actionDescriptor = exceptionContext.ActionDescriptor, - exceptionContext = exceptionContext, - filter = filter - }); + Diagnostics.AfterOnException.EventName, + new AfterOnException( + exceptionContext.ActionDescriptor, + exceptionContext, + filter + )); } } @@ -523,16 +510,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnActionExecutionImpl(DiagnosticListener diagnosticListener, ActionExecutingContext actionExecutingContext, IAsyncActionFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnActionExecution")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnActionExecution.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnActionExecution", - new - { - actionDescriptor = actionExecutingContext.ActionDescriptor, - actionExecutingContext = actionExecutingContext, - filter = filter - }); + Diagnostics.BeforeOnActionExecution.EventName, + new BeforeOnActionExecution( + actionExecutingContext.ActionDescriptor, + actionExecutingContext, + filter + )); } } @@ -554,16 +540,15 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnActionExecutionImpl(DiagnosticListener diagnosticListener, ActionExecutedContext actionExecutedContext, IAsyncActionFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnActionExecution")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnActionExecution.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnActionExecution", - new - { - actionDescriptor = actionExecutedContext.ActionDescriptor, - actionExecutedContext = actionExecutedContext, - filter = filter - }); + Diagnostics.AfterOnActionExecution.EventName, + new AfterOnActionExecution( + actionExecutedContext.ActionDescriptor, + actionExecutedContext, + filter + )); } } @@ -585,16 +570,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnActionExecutingImpl(DiagnosticListener diagnosticListener, ActionExecutingContext actionExecutingContext, IActionFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnActionExecuting")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnActionExecuting.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnActionExecuting", - new - { - actionDescriptor = actionExecutingContext.ActionDescriptor, - actionExecutingContext = actionExecutingContext, - filter = filter - }); + Diagnostics.BeforeOnActionExecuting.EventName, + new BeforeOnActionExecuting( + actionExecutingContext.ActionDescriptor, + actionExecutingContext, + filter + )); } } @@ -616,16 +600,15 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnActionExecutingImpl(DiagnosticListener diagnosticListener, ActionExecutingContext actionExecutingContext, IActionFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnActionExecuting")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnActionExecuting.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnActionExecuting", - new - { - actionDescriptor = actionExecutingContext.ActionDescriptor, - actionExecutingContext = actionExecutingContext, - filter = filter - }); + Diagnostics.AfterOnActionExecuting.EventName, + new AfterOnActionExecuting( + actionExecutingContext.ActionDescriptor, + actionExecutingContext, + filter + )); } } @@ -647,16 +630,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnActionExecutedImpl(DiagnosticListener diagnosticListener, ActionExecutedContext actionExecutedContext, IActionFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnActionExecuted")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnActionExecuted.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnActionExecuted", - new - { - actionDescriptor = actionExecutedContext.ActionDescriptor, - actionExecutedContext = actionExecutedContext, - filter = filter - }); + Diagnostics.BeforeOnActionExecuted.EventName, + new BeforeOnActionExecuted( + actionExecutedContext.ActionDescriptor, + actionExecutedContext, + filter + )); } } @@ -678,23 +660,22 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnActionExecutedImpl(DiagnosticListener diagnosticListener, ActionExecutedContext actionExecutedContext, IActionFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnActionExecuted")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnActionExecuted.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnActionExecuted", - new - { - actionDescriptor = actionExecutedContext.ActionDescriptor, - actionExecutedContext = actionExecutedContext, - filter = filter - }); + Diagnostics.AfterOnActionExecuted.EventName, + new AfterOnActionExecuted( + actionExecutedContext.ActionDescriptor, + actionExecutedContext, + filter + )); } } public static void BeforeActionMethod( this DiagnosticListener diagnosticListener, ActionContext actionContext, - IDictionary actionArguments, + IReadOnlyDictionary actionArguments, object controller) { Debug.Assert(diagnosticListener != null); @@ -709,25 +690,24 @@ namespace Microsoft.AspNetCore.Mvc } } - private static void BeforeActionMethodImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, IDictionary actionArguments, object controller) + private static void BeforeActionMethodImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, IReadOnlyDictionary actionArguments, object controller) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeActionMethod")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeActionMethod.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeActionMethod", - new - { - actionContext = actionContext, - arguments = actionArguments, - controller = controller - }); + Diagnostics.BeforeActionMethod.EventName, + new BeforeActionMethod( + actionContext, + actionArguments, + controller + )); } } public static void AfterActionMethod( this DiagnosticListener diagnosticListener, ActionContext actionContext, - IDictionary actionArguments, + IReadOnlyDictionary actionArguments, object controller, IActionResult result) { @@ -743,19 +723,18 @@ namespace Microsoft.AspNetCore.Mvc } } - private static void AfterActionMethodImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, IDictionary actionArguments, object controller, IActionResult result) + private static void AfterActionMethodImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, IReadOnlyDictionary actionArguments, object controller, IActionResult result) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterActionMethod")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterActionMethod.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterActionMethod", - new - { - actionContext = actionContext, - arguments = actionArguments, - controller = controller, - result = result - }); + Diagnostics.AfterActionMethod.EventName, + new AfterActionMethod( + actionContext, + actionArguments, + controller, + result + )); } } @@ -777,16 +756,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnResultExecutionImpl(DiagnosticListener diagnosticListener, ResultExecutingContext resultExecutingContext, IAsyncResultFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnResultExecution")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnResultExecution.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnResultExecution", - new - { - actionDescriptor = resultExecutingContext.ActionDescriptor, - resultExecutingContext = resultExecutingContext, - filter = filter - }); + Diagnostics.BeforeOnResultExecution.EventName, + new BeforeOnResultExecution( + resultExecutingContext.ActionDescriptor, + resultExecutingContext, + filter + )); } } @@ -808,16 +786,15 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnResultExecutionImpl(DiagnosticListener diagnosticListener, ResultExecutedContext resultExecutedContext, IAsyncResultFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnResultExecution")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnResultExecution.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnResultExecution", - new - { - actionDescriptor = resultExecutedContext.ActionDescriptor, - resultExecutedContext = resultExecutedContext, - filter = filter - }); + Diagnostics.AfterOnResultExecution.EventName, + new AfterOnResultExecution( + resultExecutedContext.ActionDescriptor, + resultExecutedContext, + filter + )); } } @@ -839,16 +816,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnResultExecutingImpl(DiagnosticListener diagnosticListener, ResultExecutingContext resultExecutingContext, IResultFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnResultExecuting")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnResultExecuting.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnResultExecuting", - new - { - actionDescriptor = resultExecutingContext.ActionDescriptor, - resultExecutingContext = resultExecutingContext, - filter = filter - }); + Diagnostics.BeforeOnResultExecuting.EventName, + new BeforeOnResultExecuting( + resultExecutingContext.ActionDescriptor, + resultExecutingContext, + filter + )); } } @@ -870,16 +846,15 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnResultExecutingImpl(DiagnosticListener diagnosticListener, ResultExecutingContext resultExecutingContext, IResultFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnResultExecuting")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnResultExecuting.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnResultExecuting", - new - { - actionDescriptor = resultExecutingContext.ActionDescriptor, - resultExecutingContext = resultExecutingContext, - filter = filter - }); + Diagnostics.AfterOnResultExecuting.EventName, + new AfterOnResultExecuting( + resultExecutingContext.ActionDescriptor, + resultExecutingContext, + filter + )); } } @@ -901,16 +876,15 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeOnResultExecutedImpl(DiagnosticListener diagnosticListener, ResultExecutedContext resultExecutedContext, IResultFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnResultExecuted")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnResultExecuted.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnResultExecuted", - new - { - actionDescriptor = resultExecutedContext.ActionDescriptor, - resultExecutedContext = resultExecutedContext, - filter = filter - }); + Diagnostics.BeforeOnResultExecuted.EventName, + new BeforeOnResultExecuted( + resultExecutedContext.ActionDescriptor, + resultExecutedContext, + filter + )); } } @@ -932,16 +906,15 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterOnResultExecutedImpl(DiagnosticListener diagnosticListener, ResultExecutedContext resultExecutedContext, IResultFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnResultExecuted")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnResultExecuted.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnResultExecuted", - new - { - actionDescriptor = resultExecutedContext.ActionDescriptor, - resultExecutedContext = resultExecutedContext, - filter = filter - }); + Diagnostics.AfterOnResultExecuted.EventName, + new AfterOnResultExecuted( + resultExecutedContext.ActionDescriptor, + resultExecutedContext, + filter + )); } } @@ -963,11 +936,11 @@ namespace Microsoft.AspNetCore.Mvc private static void BeforeActionResultImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, IActionResult result) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeActionResult")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeActionResult.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeActionResult", - new { actionContext = actionContext, result = result }); + Diagnostics.BeforeActionResult.EventName, + new BeforeActionResult(actionContext, result)); } } @@ -989,11 +962,11 @@ namespace Microsoft.AspNetCore.Mvc private static void AfterActionResultImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, IActionResult result) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterActionResult")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterActionResult.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterActionResult", - new { actionContext = actionContext, result = result }); + Diagnostics.AfterActionResult.EventName, + new AfterActionResult(actionContext, result)); } } } diff --git a/src/Mvc/Mvc.Razor/ref/Microsoft.AspNetCore.Mvc.Razor.netcoreapp3.0.cs b/src/Mvc/Mvc.Razor/ref/Microsoft.AspNetCore.Mvc.Razor.netcoreapp3.0.cs index a5515aef0b..4d088ced51 100644 --- a/src/Mvc/Mvc.Razor/ref/Microsoft.AspNetCore.Mvc.Razor.netcoreapp3.0.cs +++ b/src/Mvc/Mvc.Razor/ref/Microsoft.AspNetCore.Mvc.Razor.netcoreapp3.0.cs @@ -21,6 +21,31 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationParts System.Collections.Generic.IEnumerable CompiledItems { get; } } } +namespace Microsoft.AspNetCore.Mvc.Diagnostics +{ + public sealed partial class AfterViewPage : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.Razor.AfterViewPage"; + public AfterViewPage(Microsoft.AspNetCore.Mvc.Razor.IRazorPage page, Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Http.HttpContext httpContext) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Http.HttpContext HttpContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Razor.IRazorPage Page { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Rendering.ViewContext ViewContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class BeforeViewPage : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.Razor.BeforeViewPage"; + public BeforeViewPage(Microsoft.AspNetCore.Mvc.Razor.IRazorPage page, Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Http.HttpContext httpContext) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Http.HttpContext HttpContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Razor.IRazorPage Page { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Rendering.ViewContext ViewContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } +} namespace Microsoft.AspNetCore.Mvc.Razor { public partial class HelperResult : Microsoft.AspNetCore.Html.IHtmlContent diff --git a/src/Mvc/Mvc.Razor/src/Diagnostics/MvcDiagnostics.cs b/src/Mvc/Mvc.Razor/src/Diagnostics/MvcDiagnostics.cs new file mode 100644 index 0000000000..d87b9709ad --- /dev/null +++ b/src/Mvc/Mvc.Razor/src/Diagnostics/MvcDiagnostics.cs @@ -0,0 +1,74 @@ +// 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.Http; +using Microsoft.AspNetCore.Mvc.Abstractions; +using Microsoft.AspNetCore.Mvc.Razor; +using Microsoft.AspNetCore.Mvc.Rendering; + +namespace Microsoft.AspNetCore.Mvc.Diagnostics +{ + public sealed class BeforeViewPage : EventData + { + public const string EventName = EventNamespace + + "Razor." + + nameof(BeforeViewPage); + + public BeforeViewPage(IRazorPage page, ViewContext viewContext, ActionDescriptor actionDescriptor, HttpContext httpContext) + { + Page = page; + ViewContext = viewContext; + ActionDescriptor = actionDescriptor; + HttpContext = httpContext; + } + + public IRazorPage Page { get; } + public ViewContext ViewContext { get; } + public ActionDescriptor ActionDescriptor { get; } + public HttpContext HttpContext { get; } + + protected override int Count => 4; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(Page), Page), + 1 => new KeyValuePair(nameof(ViewContext), ViewContext), + 2 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 3 => new KeyValuePair(nameof(HttpContext), HttpContext), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterViewPage : EventData + { + public const string EventName = EventNamespace + + "Razor." + + nameof(AfterViewPage); + + public AfterViewPage(IRazorPage page, ViewContext viewContext, ActionDescriptor actionDescriptor, HttpContext httpContext) + { + Page = page; + ViewContext = viewContext; + ActionDescriptor = actionDescriptor; + HttpContext = httpContext; + } + + public IRazorPage Page { get; } + public ViewContext ViewContext { get; } + public ActionDescriptor ActionDescriptor { get; } + public HttpContext HttpContext { get; } + + protected override int Count => 4; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(Page), Page), + 1 => new KeyValuePair(nameof(ViewContext), ViewContext), + 2 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 3 => new KeyValuePair(nameof(HttpContext), HttpContext), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } +} \ No newline at end of file diff --git a/src/Mvc/Mvc.Razor/src/MvcRazorDiagnosticSourceExtensions.cs b/src/Mvc/Mvc.Razor/src/MvcRazorDiagnosticListenerExtensions.cs similarity index 62% rename from src/Mvc/Mvc.Razor/src/MvcRazorDiagnosticSourceExtensions.cs rename to src/Mvc/Mvc.Razor/src/MvcRazorDiagnosticListenerExtensions.cs index f0479ef143..aff60a9298 100644 --- a/src/Mvc/Mvc.Razor/src/MvcRazorDiagnosticSourceExtensions.cs +++ b/src/Mvc/Mvc.Razor/src/MvcRazorDiagnosticListenerExtensions.cs @@ -3,10 +3,12 @@ using System.Diagnostics; using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.Diagnostics; +using Microsoft.AspNetCore.Http; namespace Microsoft.AspNetCore.Mvc.Razor { - internal static class MvcRazorDiagnosticSourceExtensions + internal static class MvcRazorDiagnosticListenerExtensions { public static void BeforeViewPage( this DiagnosticListener diagnosticListener, @@ -25,17 +27,16 @@ namespace Microsoft.AspNetCore.Mvc.Razor IRazorPage page, ViewContext viewContext) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.Razor.BeforeViewPage")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeViewPage.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.Razor.BeforeViewPage", - new - { - page = page, - viewContext = viewContext, - actionDescriptor = viewContext.ActionDescriptor, - httpContext = viewContext.HttpContext, - }); + Diagnostics.BeforeViewPage.EventName, + new BeforeViewPage( + page, + viewContext, + viewContext.ActionDescriptor, + viewContext.HttpContext + )); } } @@ -56,18 +57,17 @@ namespace Microsoft.AspNetCore.Mvc.Razor IRazorPage page, ViewContext viewContext) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.Razor.AfterViewPage")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterViewPage.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.Razor.AfterViewPage", - new - { - page = page, - viewContext = viewContext, - actionDescriptor = viewContext.ActionDescriptor, - httpContext = viewContext.HttpContext, - }); + Diagnostics.AfterViewPage.EventName, + new AfterViewPage( + page, + viewContext, + viewContext.ActionDescriptor, + viewContext.HttpContext + )); } } } -} +} \ No newline at end of file diff --git a/src/Mvc/Mvc.Razor/src/RazorPage.cs b/src/Mvc/Mvc.Razor/src/RazorPage.cs index 53fd192c24..be763a3d70 100644 --- a/src/Mvc/Mvc.Razor/src/RazorPage.cs +++ b/src/Mvc/Mvc.Razor/src/RazorPage.cs @@ -276,37 +276,12 @@ namespace Microsoft.AspNetCore.Mvc.Razor public override void BeginContext(int position, int length, bool isLiteral) { - const string BeginContextEvent = "Microsoft.AspNetCore.Mvc.Razor.BeginInstrumentationContext"; - - if (DiagnosticSource?.IsEnabled(BeginContextEvent) == true) - { - DiagnosticSource.Write( - BeginContextEvent, - new - { - httpContext = Context, - path = Path, - position = position, - length = length, - isLiteral = isLiteral, - }); - } + // noop } public override void EndContext() { - const string EndContextEvent = "Microsoft.AspNetCore.Mvc.Razor.EndInstrumentationContext"; - - if (DiagnosticSource?.IsEnabled(EndContextEvent) == true) - { - DiagnosticSource.Write( - EndContextEvent, - new - { - httpContext = Context, - path = Path, - }); - } + // noop } private void EnsureMethodCanBeInvoked(string methodName) diff --git a/src/Mvc/Mvc.Razor/test/RazorPageActivatorTest.cs b/src/Mvc/Mvc.Razor/test/RazorPageActivatorTest.cs index f4e3a8d97a..da3f6ceccb 100644 --- a/src/Mvc/Mvc.Razor/test/RazorPageActivatorTest.cs +++ b/src/Mvc/Mvc.Razor/test/RazorPageActivatorTest.cs @@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor { public RazorPageActivatorTest() { - DiagnosticSource = new DiagnosticListener("Microsoft.AspNetCore"); + DiagnosticListener = new DiagnosticListener("Microsoft.AspNetCore"); HtmlEncoder = new HtmlTestEncoder(); JsonHelper = Mock.Of(); MetadataProvider = new EmptyModelMetadataProvider(); @@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor UrlHelperFactory = new UrlHelperFactory(); } - private DiagnosticSource DiagnosticSource { get; } + private DiagnosticListener DiagnosticListener { get; } private HtmlEncoder HtmlEncoder { get; } @@ -62,7 +62,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor activator.Activate(instance, viewContext); // Assert - Assert.Same(DiagnosticSource, instance.DiagnosticSource); + Assert.Same(DiagnosticListener, instance.DiagnosticSource); Assert.Same(HtmlEncoder, instance.HtmlEncoder); Assert.Same(JsonHelper, instance.Json); Assert.Same(urlHelper, instance.Url); @@ -97,7 +97,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor activator.Activate(instance, viewContext); // Assert - Assert.Same(DiagnosticSource, instance.DiagnosticSource); + Assert.Same(DiagnosticListener, instance.DiagnosticSource); Assert.Same(HtmlEncoder, instance.HtmlEncoder); // When we don't have a model property, the activator will just leave ViewData alone. @@ -124,7 +124,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor activator.Activate(instance, viewContext); // Assert - Assert.Same(DiagnosticSource, instance.DiagnosticSource); + Assert.Same(DiagnosticListener, instance.DiagnosticSource); Assert.Same(HtmlEncoder, instance.HtmlEncoder); Assert.Same(JsonHelper, instance.Json); Assert.Same(urlHelper, instance.Url); @@ -229,7 +229,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor private RazorPageActivator CreateActivator() { - return new RazorPageActivator(MetadataProvider, UrlHelperFactory, JsonHelper, DiagnosticSource, HtmlEncoder, ModelExpressionProvider); + return new RazorPageActivator(MetadataProvider, UrlHelperFactory, JsonHelper, DiagnosticListener, HtmlEncoder, ModelExpressionProvider); } private ViewContext CreateViewContext(ViewDataDictionary viewData = null) diff --git a/src/Mvc/Mvc.Razor/test/RazorPageTest.cs b/src/Mvc/Mvc.Razor/test/RazorPageTest.cs index 8475c8a2fc..8b0ffc0875 100644 --- a/src/Mvc/Mvc.Razor/test/RazorPageTest.cs +++ b/src/Mvc/Mvc.Razor/test/RazorPageTest.cs @@ -948,216 +948,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor Assert.Same(HtmlString.Empty, actual); } - [Fact] - public async Task WriteAttribute_WritesBeginAndEndEvents_ToDiagnosticSource() - { - // Arrange - var path = "path-to-page"; - var page = CreatePage(p => - { - p.HtmlEncoder = new HtmlTestEncoder(); - p.BeginWriteAttribute("href", "prefix", 0, "suffix", 34, 2); - p.WriteAttributeValue("prefix", 0, "attr1-value", 8, 14, true); - p.WriteAttributeValue("prefix2", 22, "attr2", 29, 5, false); - p.EndWriteAttribute(); - }); - page.Path = path; - var adapter = new TestDiagnosticListener(); - var diagnosticListener = new DiagnosticListener("Microsoft.AspNetCore.Mvc.Razor"); - diagnosticListener.SubscribeWithAdapter(adapter); - page.DiagnosticSource = diagnosticListener; - - // Act - await page.ExecuteAsync(); - - // Assert - Func assertStartEvent = data => - { - var beginEvent = Assert.IsType(data); - Assert.NotNull(beginEvent.HttpContext); - Assert.Equal(path, beginEvent.Path); - - return beginEvent; - }; - - Action assertEndEvent = data => - { - var endEvent = Assert.IsType(data); - Assert.NotNull(endEvent.HttpContext); - Assert.Equal(path, endEvent.Path); - }; - - Assert.Collection(adapter.PageInstrumentationData, - data => - { - var beginEvent = assertStartEvent(data); - Assert.Equal(0, beginEvent.Position); - Assert.Equal(6, beginEvent.Length); - Assert.True(beginEvent.IsLiteral); - }, - assertEndEvent, - data => - { - var beginEvent = assertStartEvent(data); - Assert.Equal(0, beginEvent.Position); - Assert.Equal(6, beginEvent.Length); - Assert.True(beginEvent.IsLiteral); - }, - assertEndEvent, - data => - { - var beginEvent = assertStartEvent(data); - Assert.Equal(8, beginEvent.Position); - Assert.Equal(14, beginEvent.Length); - Assert.True(beginEvent.IsLiteral); - }, - assertEndEvent, - data => - { - var beginEvent = assertStartEvent(data); - Assert.Equal(22, beginEvent.Position); - Assert.Equal(7, beginEvent.Length); - Assert.True(beginEvent.IsLiteral); - }, - assertEndEvent, - data => - { - var beginEvent = assertStartEvent(data); - Assert.Equal(29, beginEvent.Position); - Assert.Equal(5, beginEvent.Length); - Assert.False(beginEvent.IsLiteral); - }, - assertEndEvent, - data => - { - var beginEvent = assertStartEvent(data); - Assert.Equal(34, beginEvent.Position); - Assert.Equal(6, beginEvent.Length); - Assert.True(beginEvent.IsLiteral); - }, - assertEndEvent); - } - - [Fact] - public async Task WriteAttribute_WithBoolValue_WritesBeginAndEndEvents_ToDiagnosticSource() - { - // Arrange - var path = "some-path"; - var page = CreatePage(p => - { - p.HtmlEncoder = new HtmlTestEncoder(); - p.BeginWriteAttribute("href", "prefix", 0, "suffix", 10, 1); - p.WriteAttributeValue("", 6, "true", 6, 4, false); - p.EndWriteAttribute(); - }); - page.Path = path; - var adapter = new TestDiagnosticListener(); - var diagnosticListener = new DiagnosticListener("Microsoft.AspNetCore.Mvc.Razor"); - diagnosticListener.SubscribeWithAdapter(adapter); - page.DiagnosticSource = diagnosticListener; - - // Act - await page.ExecuteAsync(); - - // Assert - Func assertStartEvent = data => - { - var beginEvent = Assert.IsType(data); - Assert.NotNull(beginEvent.HttpContext); - Assert.Equal(path, beginEvent.Path); - - return beginEvent; - }; - - Action assertEndEvent = data => - { - var endEvent = Assert.IsType(data); - Assert.NotNull(endEvent.HttpContext); - Assert.Equal(path, endEvent.Path); - }; - - Assert.Collection(adapter.PageInstrumentationData, - data => - { - var beginEvent = assertStartEvent(data); - Assert.Equal(0, beginEvent.Position); - Assert.Equal(6, beginEvent.Length); - Assert.True(beginEvent.IsLiteral); - }, - assertEndEvent, - data => - { - var beginEvent = assertStartEvent(data); - Assert.Equal(6, beginEvent.Position); - Assert.Equal(4, beginEvent.Length); - Assert.False(beginEvent.IsLiteral); - }, - assertEndEvent, - data => - { - var beginEvent = assertStartEvent(data); - Assert.Equal(10, beginEvent.Position); - Assert.Equal(6, beginEvent.Length); - Assert.True(beginEvent.IsLiteral); - }, - assertEndEvent); - } - - [Fact] - public async Task WriteAttribute_WritesBeginAndEndEvents_ToDiagnosticSource_OnPrefixAndSuffixValues() - { - // Arrange - var path = "some-path"; - var page = CreatePage(p => - { - p.BeginWriteAttribute("href", "prefix", 0, "tail", 7, 0); - p.EndWriteAttribute(); - }); - page.Path = path; - var adapter = new TestDiagnosticListener(); - var diagnosticListener = new DiagnosticListener("Microsoft.AspNetCore.Mvc.Razor"); - diagnosticListener.SubscribeWithAdapter(adapter); - page.DiagnosticSource = diagnosticListener; - - // Act - await page.ExecuteAsync(); - - // Assert - Func assertStartEvent = data => - { - var beginEvent = Assert.IsType(data); - Assert.NotNull(beginEvent.HttpContext); - Assert.Equal(path, beginEvent.Path); - - return beginEvent; - }; - - Action assertEndEvent = data => - { - var endEvent = Assert.IsType(data); - Assert.NotNull(endEvent.HttpContext); - Assert.Equal(path, endEvent.Path); - }; - - Assert.Collection(adapter.PageInstrumentationData, - data => - { - var beginEvent = assertStartEvent(data); - Assert.Equal(0, beginEvent.Position); - Assert.Equal(6, beginEvent.Length); - Assert.True(beginEvent.IsLiteral); - }, - assertEndEvent, - data => - { - var beginEvent = assertStartEvent(data); - Assert.Equal(7, beginEvent.Position); - Assert.Equal(4, beginEvent.Length); - Assert.True(beginEvent.IsLiteral); - }, - assertEndEvent); - } - public static TheoryData AddHtmlAttributeValues_ValueData { get diff --git a/src/Mvc/Mvc.RazorPages/ref/Microsoft.AspNetCore.Mvc.RazorPages.netcoreapp3.0.cs b/src/Mvc/Mvc.RazorPages/ref/Microsoft.AspNetCore.Mvc.RazorPages.netcoreapp3.0.cs index 247bcbabcd..dbd9d6fcb7 100644 --- a/src/Mvc/Mvc.RazorPages/ref/Microsoft.AspNetCore.Mvc.RazorPages.netcoreapp3.0.cs +++ b/src/Mvc/Mvc.RazorPages/ref/Microsoft.AspNetCore.Mvc.RazorPages.netcoreapp3.0.cs @@ -143,6 +143,132 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels protected virtual bool ShouldApply(Microsoft.AspNetCore.Mvc.ApplicationModels.PageRouteModel action) { throw null; } } } +namespace Microsoft.AspNetCore.Mvc.Diagnostics +{ + public sealed partial class AfterHandlerMethod : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterHandlerMethod"; + public AfterHandlerMethod(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.Collections.Generic.IReadOnlyDictionary arguments, Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.HandlerMethodDescriptor handlerMethodDescriptor, object instance, Microsoft.AspNetCore.Mvc.IActionResult result) { } + public Microsoft.AspNetCore.Mvc.ActionContext ActionContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Arguments { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.HandlerMethodDescriptor HandlerMethodDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public object Instance { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.IActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class AfterOnPageHandlerExecuted : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnPageHandlerExecuted"; + public AfterOnPageHandlerExecuted(Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.PageHandlerExecutedContext handlerExecutedContext, Microsoft.AspNetCore.Mvc.Filters.IPageFilter filter) { } + public Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IPageFilter Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.PageHandlerExecutedContext HandlerExecutedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class AfterOnPageHandlerExecuting : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnPageHandlerExecuting"; + public AfterOnPageHandlerExecuting(Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.PageHandlerExecutingContext handlerExecutingContext, Microsoft.AspNetCore.Mvc.Filters.IPageFilter filter) { } + public Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IPageFilter Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.PageHandlerExecutingContext HandlerExecutingContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class AfterOnPageHandlerExecution : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnPageHandlerExecution"; + public AfterOnPageHandlerExecution(Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.PageHandlerExecutedContext handlerExecutedContext, Microsoft.AspNetCore.Mvc.Filters.IAsyncPageFilter filter) { } + public Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IAsyncPageFilter Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.PageHandlerExecutedContext HandlerExecutedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class AfterOnPageHandlerSelected : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnPageHandlerSelected"; + public AfterOnPageHandlerSelected(Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.PageHandlerSelectedContext handlerSelectedContext, Microsoft.AspNetCore.Mvc.Filters.IPageFilter filter) { } + public Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IPageFilter Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.PageHandlerSelectedContext HandlerSelectedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class AfterOnPageHandlerSelection : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterOnPageHandlerSelection"; + public AfterOnPageHandlerSelection(Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.PageHandlerSelectedContext handlerSelectedContext, Microsoft.AspNetCore.Mvc.Filters.IAsyncPageFilter filter) { } + public Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IAsyncPageFilter Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.PageHandlerSelectedContext HandlerSelectedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class BeforeHandlerMethod : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeHandlerMethod"; + public BeforeHandlerMethod(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.Collections.Generic.IReadOnlyDictionary arguments, Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.HandlerMethodDescriptor handlerMethodDescriptor, object instance) { } + public Microsoft.AspNetCore.Mvc.ActionContext ActionContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Arguments { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.HandlerMethodDescriptor HandlerMethodDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public object Instance { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class BeforeOnPageHandlerExecuted : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerExecuted"; + public BeforeOnPageHandlerExecuted(Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.PageHandlerExecutedContext handlerExecutedContext, Microsoft.AspNetCore.Mvc.Filters.IPageFilter filter) { } + public Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IPageFilter Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.PageHandlerExecutedContext HandlerExecutedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class BeforeOnPageHandlerExecuting : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerExecuting"; + public BeforeOnPageHandlerExecuting(Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.PageHandlerExecutingContext handlerExecutingContext, Microsoft.AspNetCore.Mvc.Filters.IPageFilter filter) { } + public Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IPageFilter Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.PageHandlerExecutingContext HandlerExecutingContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class BeforeOnPageHandlerExecution : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerExecution"; + public BeforeOnPageHandlerExecution(Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.PageHandlerExecutingContext handlerExecutionContext, Microsoft.AspNetCore.Mvc.Filters.IAsyncPageFilter filter) { } + public Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IAsyncPageFilter Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.PageHandlerExecutingContext HandlerExecutionContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class BeforeOnPageHandlerSelected : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerSelected"; + public BeforeOnPageHandlerSelected(Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.PageHandlerSelectedContext handlerSelectedContext, Microsoft.AspNetCore.Mvc.Filters.IPageFilter filter) { } + public Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IPageFilter Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.PageHandlerSelectedContext HandlerSelectedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } + public sealed partial class BeforeOnPageHandlerSelection : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerSelection"; + public BeforeOnPageHandlerSelection(Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.Filters.PageHandlerSelectedContext handlerSelectedContext, Microsoft.AspNetCore.Mvc.Filters.IAsyncPageFilter filter) { } + public Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.IAsyncPageFilter Filter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Filters.PageHandlerSelectedContext HandlerSelectedContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + } +} namespace Microsoft.AspNetCore.Mvc.Filters { public partial interface IAsyncPageFilter : Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata diff --git a/src/Mvc/Mvc.RazorPages/src/Diagnostics/MvcDiagnostics.cs b/src/Mvc/Mvc.RazorPages/src/Diagnostics/MvcDiagnostics.cs new file mode 100644 index 0000000000..78285b68c4 --- /dev/null +++ b/src/Mvc/Mvc.RazorPages/src/Diagnostics/MvcDiagnostics.cs @@ -0,0 +1,333 @@ +// 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.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure; +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.Http; + +namespace Microsoft.AspNetCore.Mvc.Diagnostics +{ + public sealed class BeforeHandlerMethod : EventData + { + public const string EventName = EventNamespace + nameof(BeforeHandlerMethod); + + public BeforeHandlerMethod(ActionContext actionContext, IReadOnlyDictionary arguments, HandlerMethodDescriptor handlerMethodDescriptor, object instance) + { + ActionContext = actionContext; + Arguments = arguments; + HandlerMethodDescriptor = handlerMethodDescriptor; + Instance = instance; + } + + public ActionContext ActionContext { get; } + public IReadOnlyDictionary Arguments { get; } + public HandlerMethodDescriptor HandlerMethodDescriptor { get; } + public object Instance { get; } + + protected override int Count => 4; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionContext), ActionContext), + 1 => new KeyValuePair(nameof(Arguments), Arguments), + 2 => new KeyValuePair(nameof(HandlerMethodDescriptor), HandlerMethodDescriptor), + 3 => new KeyValuePair(nameof(Instance), Instance), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterHandlerMethod : EventData + { + public const string EventName = EventNamespace + nameof(AfterHandlerMethod); + + public AfterHandlerMethod(ActionContext actionContext, IReadOnlyDictionary arguments, HandlerMethodDescriptor handlerMethodDescriptor, object instance, IActionResult result) + { + ActionContext = actionContext; + Arguments = arguments; + HandlerMethodDescriptor = handlerMethodDescriptor; + Instance = instance; + Result = result; + } + + public ActionContext ActionContext { get; } + public IReadOnlyDictionary Arguments { get; } + public HandlerMethodDescriptor HandlerMethodDescriptor { get; } + public object Instance { get; } + public IActionResult Result { get; } + + protected override int Count => 5; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionContext), ActionContext), + 1 => new KeyValuePair(nameof(Arguments), Arguments), + 2 => new KeyValuePair(nameof(HandlerMethodDescriptor), HandlerMethodDescriptor), + 3 => new KeyValuePair(nameof(Instance), Instance), + 4 => new KeyValuePair(nameof(Result), Result), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnPageHandlerExecution : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnPageHandlerExecution); + + public BeforeOnPageHandlerExecution(CompiledPageActionDescriptor actionDescriptor, PageHandlerExecutingContext handlerExecutionContext, IAsyncPageFilter filter) + { + ActionDescriptor = actionDescriptor; + HandlerExecutionContext = handlerExecutionContext; + Filter = filter; + } + + public CompiledPageActionDescriptor ActionDescriptor { get; } + public PageHandlerExecutingContext HandlerExecutionContext { get; } + public IAsyncPageFilter Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(HandlerExecutionContext), HandlerExecutionContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnPageHandlerExecution : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnPageHandlerExecution); + + public AfterOnPageHandlerExecution(CompiledPageActionDescriptor actionDescriptor, PageHandlerExecutedContext handlerExecutedContext, IAsyncPageFilter filter) + { + ActionDescriptor = actionDescriptor; + HandlerExecutedContext = handlerExecutedContext; + Filter = filter; + } + + public CompiledPageActionDescriptor ActionDescriptor { get; } + public PageHandlerExecutedContext HandlerExecutedContext { get; } + public IAsyncPageFilter Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(HandlerExecutedContext), HandlerExecutedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnPageHandlerExecuting : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnPageHandlerExecuting); + + public BeforeOnPageHandlerExecuting(CompiledPageActionDescriptor actionDescriptor, PageHandlerExecutingContext handlerExecutingContext, IPageFilter filter) + { + ActionDescriptor = actionDescriptor; + HandlerExecutingContext = handlerExecutingContext; + Filter = filter; + } + + public CompiledPageActionDescriptor ActionDescriptor { get; } + public PageHandlerExecutingContext HandlerExecutingContext { get; } + public IPageFilter Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(HandlerExecutingContext), HandlerExecutingContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnPageHandlerExecuting : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnPageHandlerExecuting); + + public AfterOnPageHandlerExecuting(CompiledPageActionDescriptor actionDescriptor, PageHandlerExecutingContext handlerExecutingContext, IPageFilter filter) + { + ActionDescriptor = actionDescriptor; + HandlerExecutingContext = handlerExecutingContext; + Filter = filter; + } + + public CompiledPageActionDescriptor ActionDescriptor { get; } + public PageHandlerExecutingContext HandlerExecutingContext { get; } + public IPageFilter Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(HandlerExecutingContext), HandlerExecutingContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnPageHandlerExecuted : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnPageHandlerExecuted); + + public BeforeOnPageHandlerExecuted(CompiledPageActionDescriptor actionDescriptor, PageHandlerExecutedContext handlerExecutedContext, IPageFilter filter) + { + ActionDescriptor = actionDescriptor; + HandlerExecutedContext = handlerExecutedContext; + Filter = filter; + } + + public CompiledPageActionDescriptor ActionDescriptor { get; } + public PageHandlerExecutedContext HandlerExecutedContext { get; } + public IPageFilter Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(HandlerExecutedContext), HandlerExecutedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnPageHandlerExecuted : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnPageHandlerExecuted); + + public AfterOnPageHandlerExecuted(CompiledPageActionDescriptor actionDescriptor, PageHandlerExecutedContext handlerExecutedContext, IPageFilter filter) + { + ActionDescriptor = actionDescriptor; + HandlerExecutedContext = handlerExecutedContext; + Filter = filter; + } + + public CompiledPageActionDescriptor ActionDescriptor { get; } + public PageHandlerExecutedContext HandlerExecutedContext { get; } + public IPageFilter Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(HandlerExecutedContext), HandlerExecutedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnPageHandlerSelection : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnPageHandlerSelection); + + public BeforeOnPageHandlerSelection(CompiledPageActionDescriptor actionDescriptor, PageHandlerSelectedContext handlerSelectedContext, IAsyncPageFilter filter) + { + ActionDescriptor = actionDescriptor; + HandlerSelectedContext = handlerSelectedContext; + Filter = filter; + } + + public CompiledPageActionDescriptor ActionDescriptor { get; } + public PageHandlerSelectedContext HandlerSelectedContext { get; } + public IAsyncPageFilter Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(HandlerSelectedContext), HandlerSelectedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnPageHandlerSelection : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnPageHandlerSelection); + + public AfterOnPageHandlerSelection(CompiledPageActionDescriptor actionDescriptor, PageHandlerSelectedContext handlerSelectedContext, IAsyncPageFilter filter) + { + ActionDescriptor = actionDescriptor; + HandlerSelectedContext = handlerSelectedContext; + Filter = filter; + } + + public CompiledPageActionDescriptor ActionDescriptor { get; } + public PageHandlerSelectedContext HandlerSelectedContext { get; } + public IAsyncPageFilter Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(HandlerSelectedContext), HandlerSelectedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeOnPageHandlerSelected : EventData + { + public const string EventName = EventNamespace + nameof(BeforeOnPageHandlerSelected); + + public BeforeOnPageHandlerSelected(CompiledPageActionDescriptor actionDescriptor, PageHandlerSelectedContext handlerSelectedContext, IPageFilter filter) + { + ActionDescriptor = actionDescriptor; + HandlerSelectedContext = handlerSelectedContext; + Filter = filter; + } + + public CompiledPageActionDescriptor ActionDescriptor { get; } + public PageHandlerSelectedContext HandlerSelectedContext { get; } + public IPageFilter Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(HandlerSelectedContext), HandlerSelectedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterOnPageHandlerSelected : EventData + { + public const string EventName = EventNamespace + nameof(AfterOnPageHandlerSelected); + + public AfterOnPageHandlerSelected(CompiledPageActionDescriptor actionDescriptor, PageHandlerSelectedContext handlerSelectedContext, IPageFilter filter) + { + ActionDescriptor = actionDescriptor; + HandlerSelectedContext = handlerSelectedContext; + Filter = filter; + } + + public CompiledPageActionDescriptor ActionDescriptor { get; } + public PageHandlerSelectedContext HandlerSelectedContext { get; } + public IPageFilter Filter { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(HandlerSelectedContext), HandlerSelectedContext), + 2 => new KeyValuePair(nameof(Filter), Filter), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } +} \ No newline at end of file diff --git a/src/Mvc/Mvc.RazorPages/src/MvcRazorPagesDiagnosticSourceExtensions.cs b/src/Mvc/Mvc.RazorPages/src/MvcRazorPagesDiagnosticListenerExtensions.cs similarity index 66% rename from src/Mvc/Mvc.RazorPages/src/MvcRazorPagesDiagnosticSourceExtensions.cs rename to src/Mvc/Mvc.RazorPages/src/MvcRazorPagesDiagnosticListenerExtensions.cs index 5747c9828f..f96ec244bc 100644 --- a/src/Mvc/Mvc.RazorPages/src/MvcRazorPagesDiagnosticSourceExtensions.cs +++ b/src/Mvc/Mvc.RazorPages/src/MvcRazorPagesDiagnosticListenerExtensions.cs @@ -5,16 +5,17 @@ using System.Collections.Generic; using System.Diagnostics; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure; +using Microsoft.AspNetCore.Mvc.Diagnostics; namespace Microsoft.AspNetCore.Mvc.RazorPages { - internal static class MvcRazorPagesDiagnosticSourceExtensions + internal static class MvcRazorPagesDiagnosticListenerExtensions { public static void BeforeHandlerMethod( this DiagnosticListener diagnosticListener, ActionContext actionContext, HandlerMethodDescriptor handlerMethodDescriptor, - IDictionary arguments, + IReadOnlyDictionary arguments, object instance) { Debug.Assert(diagnosticListener != null); @@ -30,19 +31,18 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages } } - private static void BeforeHandlerMethodImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, HandlerMethodDescriptor handlerMethodDescriptor, IDictionary arguments, object instance) + private static void BeforeHandlerMethodImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, HandlerMethodDescriptor handlerMethodDescriptor, IReadOnlyDictionary arguments, object instance) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeHandlerMethod")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeHandlerMethod.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeHandlerMethod", - new - { - actionContext = actionContext, - arguments = arguments, - handlerMethodDescriptor = handlerMethodDescriptor, - instance = instance, - }); + Diagnostics.BeforeHandlerMethod.EventName, + new BeforeHandlerMethod( + actionContext, + arguments, + handlerMethodDescriptor, + instance + )); } } @@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages this DiagnosticListener diagnosticListener, ActionContext actionContext, HandlerMethodDescriptor handlerMethodDescriptor, - IDictionary arguments, + IReadOnlyDictionary arguments, object instance, IActionResult result) { @@ -67,20 +67,19 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages } } - private static void AfterHandlerMethodImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, HandlerMethodDescriptor handlerMethodDescriptor, IDictionary arguments, object instance, IActionResult result) + private static void AfterHandlerMethodImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, HandlerMethodDescriptor handlerMethodDescriptor, IReadOnlyDictionary arguments, object instance, IActionResult result) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterHandlerMethod")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterHandlerMethod.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterHandlerMethod", - new - { - actionContext = actionContext, - arguments = arguments, - handlerMethodDescriptor = handlerMethodDescriptor, - instance = instance, - result = result - }); + Diagnostics.AfterHandlerMethod.EventName, + new AfterHandlerMethod( + actionContext, + arguments, + handlerMethodDescriptor, + instance, + result + )); } } @@ -102,16 +101,15 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages private static void BeforeOnPageHandlerExecutionImpl(DiagnosticListener diagnosticListener, PageHandlerExecutingContext handlerExecutionContext, IAsyncPageFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerExecution")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnPageHandlerExecution.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerExecution", - new - { - actionDescriptor = handlerExecutionContext.ActionDescriptor, - handlerExecutionContext = handlerExecutionContext, - filter = filter - }); + Diagnostics.BeforeOnPageHandlerExecution.EventName, + new BeforeOnPageHandlerExecution( + handlerExecutionContext.ActionDescriptor, + handlerExecutionContext, + filter + )); } } @@ -133,16 +131,15 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages private static void AfterOnPageHandlerExecutionImpl(DiagnosticListener diagnosticListener, PageHandlerExecutedContext handlerExecutedContext, IAsyncPageFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnPageHandlerExecution")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnPageHandlerExecution.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnPageHandlerExecution", - new - { - actionDescriptor = handlerExecutedContext.ActionDescriptor, - handlerExecutedContext = handlerExecutedContext, - filter = filter - }); + Diagnostics.AfterOnPageHandlerExecution.EventName, + new AfterOnPageHandlerExecution( + handlerExecutedContext.ActionDescriptor, + handlerExecutedContext, + filter + )); } } @@ -164,16 +161,15 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages private static void BeforeOnPageHandlerExecutingImpl(DiagnosticListener diagnosticListener, PageHandlerExecutingContext handlerExecutingContext, IPageFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerExecuting")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnPageHandlerExecuting.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerExecuting", - new - { - actionDescriptor = handlerExecutingContext.ActionDescriptor, - handlerExecutingContext = handlerExecutingContext, - filter = filter - }); + Diagnostics.BeforeOnPageHandlerExecuting.EventName, + new BeforeOnPageHandlerExecuting( + handlerExecutingContext.ActionDescriptor, + handlerExecutingContext, + filter + )); } } @@ -195,16 +191,15 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages private static void AfterOnPageHandlerExecutingImpl(DiagnosticListener diagnosticListener, PageHandlerExecutingContext handlerExecutingContext, IPageFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnPageHandlerExecuting")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnPageHandlerExecuting.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnPageHandlerExecuting", - new - { - actionDescriptor = handlerExecutingContext.ActionDescriptor, - handlerExecutingContext = handlerExecutingContext, - filter = filter - }); + Diagnostics.AfterOnPageHandlerExecuting.EventName, + new AfterOnPageHandlerExecuting( + handlerExecutingContext.ActionDescriptor, + handlerExecutingContext, + filter + )); } } @@ -226,16 +221,15 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages private static void BeforeOnPageHandlerExecutedImpl(DiagnosticListener diagnosticListener, PageHandlerExecutedContext handlerExecutedContext, IPageFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerExecuted")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnPageHandlerExecuted.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerExecuted", - new - { - actionDescriptor = handlerExecutedContext.ActionDescriptor, - handlerExecutedContext = handlerExecutedContext, - filter = filter - }); + Diagnostics.BeforeOnPageHandlerExecuted.EventName, + new BeforeOnPageHandlerExecuted( + handlerExecutedContext.ActionDescriptor, + handlerExecutedContext, + filter + )); } } @@ -257,16 +251,15 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages private static void AfterOnPageHandlerExecutedImpl(DiagnosticListener diagnosticListener, PageHandlerExecutedContext handlerExecutedContext, IPageFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnPageHandlerExecuted")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnPageHandlerExecuted.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnPageHandlerExecuted", - new - { - actionDescriptor = handlerExecutedContext.ActionDescriptor, - handlerExecutedContext = handlerExecutedContext, - filter = filter - }); + Diagnostics.AfterOnPageHandlerExecuted.EventName, + new AfterOnPageHandlerExecuted( + handlerExecutedContext.ActionDescriptor, + handlerExecutedContext, + filter + )); } } @@ -288,16 +281,15 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages private static void BeforeOnPageHandlerSelectionImpl(DiagnosticListener diagnosticListener, PageHandlerSelectedContext handlerSelectedContext, IAsyncPageFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerSelection")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnPageHandlerSelection.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerSelection", - new - { - actionDescriptor = handlerSelectedContext.ActionDescriptor, - handlerSelectedContext = handlerSelectedContext, - filter = filter - }); + Diagnostics.BeforeOnPageHandlerSelection.EventName, + new BeforeOnPageHandlerSelection( + handlerSelectedContext.ActionDescriptor, + handlerSelectedContext, + filter + )); } } @@ -319,16 +311,15 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages private static void AfterOnPageHandlerSelectionImpl(DiagnosticListener diagnosticListener, PageHandlerSelectedContext handlerSelectedContext, IAsyncPageFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnPageHandlerSelection")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnPageHandlerSelection.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnPageHandlerSelection", - new - { - actionDescriptor = handlerSelectedContext.ActionDescriptor, - handlerSelectedContext = handlerSelectedContext, - filter = filter - }); + Diagnostics.AfterOnPageHandlerSelection.EventName, + new AfterOnPageHandlerSelection( + handlerSelectedContext.ActionDescriptor, + handlerSelectedContext, + filter + )); } } @@ -350,16 +341,15 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages private static void BeforeOnPageHandlerSelectedImpl(DiagnosticListener diagnosticListener, PageHandlerSelectedContext handlerSelectedContext, IPageFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerSelected")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeOnPageHandlerSelected.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeOnPageHandlerSelected", - new - { - actionDescriptor = handlerSelectedContext.ActionDescriptor, - handlerSelectedContext = handlerSelectedContext, - filter = filter - }); + Diagnostics.BeforeOnPageHandlerSelected.EventName, + new BeforeOnPageHandlerSelected( + handlerSelectedContext.ActionDescriptor, + handlerSelectedContext, + filter + )); } } @@ -381,16 +371,15 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages private static void AfterOnPageHandlerSelectedImpl(DiagnosticListener diagnosticListener, PageHandlerSelectedContext handlerSelectedContext, IPageFilter filter) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnPageHandlerSelected")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterOnPageHandlerSelected.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterOnPageHandlerSelected", - new - { - actionDescriptor = handlerSelectedContext.ActionDescriptor, - handlerSelectedContext = handlerSelectedContext, - filter = filter - }); + Diagnostics.AfterOnPageHandlerSelected.EventName, + new AfterOnPageHandlerSelected( + handlerSelectedContext.ActionDescriptor, + handlerSelectedContext, + filter + )); } } } diff --git a/src/Mvc/Mvc.RazorPages/src/PageBase.cs b/src/Mvc/Mvc.RazorPages/src/PageBase.cs index 1d43071cf7..0ae4993b35 100644 --- a/src/Mvc/Mvc.RazorPages/src/PageBase.cs +++ b/src/Mvc/Mvc.RazorPages/src/PageBase.cs @@ -110,38 +110,13 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages /// public override void BeginContext(int position, int length, bool isLiteral) { - const string BeginContextEvent = "Microsoft.AspNetCore.Mvc.Razor.BeginInstrumentationContext"; - - if (DiagnosticSource?.IsEnabled(BeginContextEvent) == true) - { - DiagnosticSource.Write( - BeginContextEvent, - new - { - httpContext = ViewContext, - path = Path, - position = position, - length = length, - isLiteral = isLiteral, - }); - } + // noop } /// public override void EndContext() { - const string EndContextEvent = "Microsoft.AspNetCore.Mvc.Razor.EndInstrumentationContext"; - - if (DiagnosticSource?.IsEnabled(EndContextEvent) == true) - { - DiagnosticSource.Write( - EndContextEvent, - new - { - httpContext = ViewContext, - path = Path, - }); - } + // noop } /// diff --git a/src/Mvc/Mvc.ViewFeatures/ref/Microsoft.AspNetCore.Mvc.ViewFeatures.netcoreapp3.0.cs b/src/Mvc/Mvc.ViewFeatures/ref/Microsoft.AspNetCore.Mvc.ViewFeatures.netcoreapp3.0.cs index ad98c18e9a..945609c560 100644 --- a/src/Mvc/Mvc.ViewFeatures/ref/Microsoft.AspNetCore.Mvc.ViewFeatures.netcoreapp3.0.cs +++ b/src/Mvc/Mvc.ViewFeatures/ref/Microsoft.AspNetCore.Mvc.ViewFeatures.netcoreapp3.0.cs @@ -213,6 +213,92 @@ namespace Microsoft.AspNetCore.Mvc public override System.Threading.Tasks.Task ExecuteResultAsync(Microsoft.AspNetCore.Mvc.ActionContext context) { throw null; } } } +namespace Microsoft.AspNetCore.Mvc.Diagnostics +{ + public sealed partial class AfterView : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterView"; + public AfterView(Microsoft.AspNetCore.Mvc.ViewEngines.IView view, Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext) { } + protected override int Count { get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.ViewEngines.IView View { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Rendering.ViewContext ViewContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class AfterViewComponent : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.AfterViewComponent"; + public AfterViewComponent(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext viewComponentContext, Microsoft.AspNetCore.Mvc.IViewComponentResult viewComponentResult, object viewComponent) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public object ViewComponent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext ViewComponentContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.IViewComponentResult ViewComponentResult { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class BeforeView : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeView"; + public BeforeView(Microsoft.AspNetCore.Mvc.ViewEngines.IView view, Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext) { } + protected override int Count { get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.ViewEngines.IView View { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.Rendering.ViewContext ViewContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class BeforeViewComponent : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.BeforeViewComponent"; + public BeforeViewComponent(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext viewComponentContext, object viewComponent) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public object ViewComponent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext ViewComponentContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class ViewComponentAfterViewExecute : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.ViewComponentAfterViewExecute"; + public ViewComponentAfterViewExecute(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext viewComponentContext, Microsoft.AspNetCore.Mvc.ViewEngines.IView view) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.ViewEngines.IView View { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext ViewComponentContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class ViewComponentBeforeViewExecute : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.ViewComponentBeforeViewExecute"; + public ViewComponentBeforeViewExecute(Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor, Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext viewComponentContext, Microsoft.AspNetCore.Mvc.ViewEngines.IView view) { } + public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.ViewEngines.IView View { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext ViewComponentContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class ViewFound : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.ViewFound"; + public ViewFound(Microsoft.AspNetCore.Mvc.ActionContext actionContext, bool isMainPage, Microsoft.AspNetCore.Mvc.ActionResult result, string viewName, Microsoft.AspNetCore.Mvc.ViewEngines.IView view) { } + public Microsoft.AspNetCore.Mvc.ActionContext ActionContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public bool IsMainPage { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.ActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Mvc.ViewEngines.IView View { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public string ViewName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public sealed partial class ViewNotFound : Microsoft.AspNetCore.Mvc.Diagnostics.EventData + { + public const string EventName = "Microsoft.AspNetCore.Mvc.ViewNotFound"; + public ViewNotFound(Microsoft.AspNetCore.Mvc.ActionContext actionContext, bool isMainPage, Microsoft.AspNetCore.Mvc.ActionResult result, string viewName, System.Collections.Generic.IEnumerable searchedLocations) { } + public Microsoft.AspNetCore.Mvc.ActionContext ActionContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override int Count { get { throw null; } } + public bool IsMainPage { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected override System.Collections.Generic.KeyValuePair this[int index] { get { throw null; } } + public Microsoft.AspNetCore.Mvc.ActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public System.Collections.Generic.IEnumerable SearchedLocations { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public string ViewName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } +} namespace Microsoft.AspNetCore.Mvc.ModelBinding { public static partial class ModelStateDictionaryExtensions @@ -1286,7 +1372,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures public static readonly string DefaultContentType; protected ViewExecutor(Microsoft.AspNetCore.Mvc.Infrastructure.IHttpResponseStreamWriterFactory writerFactory, Microsoft.AspNetCore.Mvc.ViewEngines.ICompositeViewEngine viewEngine, System.Diagnostics.DiagnosticListener diagnosticListener) { } public ViewExecutor(Microsoft.Extensions.Options.IOptions viewOptions, Microsoft.AspNetCore.Mvc.Infrastructure.IHttpResponseStreamWriterFactory writerFactory, Microsoft.AspNetCore.Mvc.ViewEngines.ICompositeViewEngine viewEngine, Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory tempDataFactory, System.Diagnostics.DiagnosticListener diagnosticListener, Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider modelMetadataProvider) { } - protected System.Diagnostics.DiagnosticListener DiagnosticSource { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected System.Diagnostics.DiagnosticListener DiagnosticListener { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } protected Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider ModelMetadataProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } protected Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory TempDataFactory { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } protected Microsoft.AspNetCore.Mvc.ViewEngines.IViewEngine ViewEngine { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } diff --git a/src/Mvc/Mvc.ViewFeatures/src/Diagnostics/MvcDiagnostics.cs b/src/Mvc/Mvc.ViewFeatures/src/Diagnostics/MvcDiagnostics.cs new file mode 100644 index 0000000000..4cccd159b3 --- /dev/null +++ b/src/Mvc/Mvc.ViewFeatures/src/Diagnostics/MvcDiagnostics.cs @@ -0,0 +1,228 @@ +// 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.Mvc.Abstractions; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.ViewComponents; +using Microsoft.AspNetCore.Mvc.ViewEngines; + +namespace Microsoft.AspNetCore.Mvc.Diagnostics +{ + public sealed class BeforeViewComponent : EventData + { + public const string EventName = EventNamespace + nameof(BeforeViewComponent); + + public BeforeViewComponent(ActionDescriptor actionDescriptor, ViewComponentContext viewComponentContext, object viewComponent) + { + ActionDescriptor = actionDescriptor; + ViewComponentContext = viewComponentContext; + ViewComponent = viewComponent; + } + + public ActionDescriptor ActionDescriptor { get; } + public ViewComponentContext ViewComponentContext { get; } + public object ViewComponent { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ViewComponentContext), ViewComponentContext), + 2 => new KeyValuePair(nameof(ViewComponent), ViewComponent), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterViewComponent : EventData + { + public const string EventName = EventNamespace + nameof(AfterViewComponent); + + public AfterViewComponent(ActionDescriptor actionDescriptor, ViewComponentContext viewComponentContext, IViewComponentResult viewComponentResult, object viewComponent) + { + ActionDescriptor = actionDescriptor; + ViewComponentContext = viewComponentContext; + ViewComponentResult = viewComponentResult; + ViewComponent = viewComponent; + } + + public ActionDescriptor ActionDescriptor { get; } + public ViewComponentContext ViewComponentContext { get; } + public IViewComponentResult ViewComponentResult { get; } + public object ViewComponent { get; } + + protected override int Count => 4; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ViewComponentContext), ViewComponentContext), + 2 => new KeyValuePair(nameof(ViewComponent), ViewComponent), + 3 => new KeyValuePair(nameof(ViewComponentResult), ViewComponentResult), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class ViewComponentBeforeViewExecute : EventData + { + public const string EventName = EventNamespace + nameof(ViewComponentBeforeViewExecute); + + public ViewComponentBeforeViewExecute(ActionDescriptor actionDescriptor, ViewComponentContext viewComponentContext, IView view) + { + ActionDescriptor = actionDescriptor; + ViewComponentContext = viewComponentContext; + View = view; + } + public ActionDescriptor ActionDescriptor { get; } + public ViewComponentContext ViewComponentContext { get; } + public IView View { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ViewComponentContext), ViewComponentContext), + 2 => new KeyValuePair(nameof(View), View), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class ViewComponentAfterViewExecute : EventData + { + public const string EventName = EventNamespace + nameof(ViewComponentAfterViewExecute); + + public ViewComponentAfterViewExecute(ActionDescriptor actionDescriptor, ViewComponentContext viewComponentContext, IView view) + { + ActionDescriptor = actionDescriptor; + ViewComponentContext = viewComponentContext; + View = view; + } + + public ActionDescriptor ActionDescriptor { get; } + public ViewComponentContext ViewComponentContext { get; } + public IView View { get; } + + protected override int Count => 3; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), + 1 => new KeyValuePair(nameof(ViewComponentContext), ViewComponentContext), + 2 => new KeyValuePair(nameof(View), View), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class BeforeView : EventData + { + public const string EventName = EventNamespace + nameof(BeforeView); + + public BeforeView(IView view, ViewContext viewContext) + { + View = view; + ViewContext = viewContext; + } + + public IView View { get; } + public ViewContext ViewContext { get; } + + protected override int Count => 2; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(View), View), + 1 => new KeyValuePair(nameof(ViewContext), ViewContext), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class AfterView : EventData + { + public const string EventName = EventNamespace + nameof(AfterView); + + public AfterView(IView view, ViewContext viewContext) + { + View = view; + ViewContext = viewContext; + } + + public IView View { get; } + public ViewContext ViewContext { get; } + + protected override int Count => 2; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(View), View), + 1 => new KeyValuePair(nameof(ViewContext), ViewContext), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class ViewFound : EventData + { + public const string EventName = EventNamespace + nameof(ViewFound); + + public ViewFound(ActionContext actionContext, bool isMainPage, ActionResult result, string viewName, IView view) + { + ActionContext = actionContext; + IsMainPage = isMainPage; + Result = result; + ViewName = viewName; + View = view; + } + + public ActionContext ActionContext { get; } + public bool IsMainPage { get; } + public ActionResult Result { get; } + public string ViewName { get; } + public IView View { get; } + + protected override int Count => 5; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionContext), ActionContext), + 1 => new KeyValuePair(nameof(IsMainPage), IsMainPage), + 2 => new KeyValuePair(nameof(Result), Result), + 3 => new KeyValuePair(nameof(ViewName), ViewName), + 4 => new KeyValuePair(nameof(View), View), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } + + public sealed class ViewNotFound : EventData + { + public const string EventName = EventNamespace + nameof(ViewNotFound); + + public ViewNotFound(ActionContext actionContext, bool isMainPage, ActionResult result, string viewName, IEnumerable searchedLocations) + { + ActionContext = actionContext; + IsMainPage = isMainPage; + Result = result; + ViewName = viewName; + SearchedLocations = searchedLocations; + } + + public ActionContext ActionContext { get; } + public bool IsMainPage { get; } + public ActionResult Result { get; } + public string ViewName { get; } + public IEnumerable SearchedLocations { get; } + + protected override int Count => 5; + + protected override KeyValuePair this[int index] => index switch + { + 0 => new KeyValuePair(nameof(ActionContext), ActionContext), + 1 => new KeyValuePair(nameof(IsMainPage), IsMainPage), + 2 => new KeyValuePair(nameof(Result), Result), + 3 => new KeyValuePair(nameof(ViewName), ViewName), + 4 => new KeyValuePair(nameof(SearchedLocations), SearchedLocations), + _ => throw new IndexOutOfRangeException(nameof(index)) + }; + } +} \ No newline at end of file diff --git a/src/Mvc/Mvc.ViewFeatures/src/MvcViewFeaturesDiagnosticSourceExtensions.cs b/src/Mvc/Mvc.ViewFeatures/src/MvcViewFeaturesDiagnosticListenerExtensions.cs similarity index 62% rename from src/Mvc/Mvc.ViewFeatures/src/MvcViewFeaturesDiagnosticSourceExtensions.cs rename to src/Mvc/Mvc.ViewFeatures/src/MvcViewFeaturesDiagnosticListenerExtensions.cs index fa237a7d5d..efd7cc8c6c 100644 --- a/src/Mvc/Mvc.ViewFeatures/src/MvcViewFeaturesDiagnosticSourceExtensions.cs +++ b/src/Mvc/Mvc.ViewFeatures/src/MvcViewFeaturesDiagnosticListenerExtensions.cs @@ -6,10 +6,11 @@ using System.Diagnostics; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewComponents; using Microsoft.AspNetCore.Mvc.ViewEngines; +using Microsoft.AspNetCore.Mvc.Diagnostics; namespace Microsoft.AspNetCore.Mvc.ViewFeatures { - internal static class MvcViewFeaturesDiagnosticSourceExtensions + internal static class MvcViewFeaturesDiagnosticListenerExtensions { public static void BeforeViewComponent( this DiagnosticListener diagnosticListener, @@ -25,16 +26,15 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures private static void BeforeViewComponentImpl(DiagnosticListener diagnosticListener, ViewComponentContext context, object viewComponent) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeViewComponent")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeViewComponent.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeViewComponent", - new - { - actionDescriptor = context.ViewContext.ActionDescriptor, - viewComponentContext = context, - viewComponent = viewComponent - }); + Diagnostics.BeforeViewComponent.EventName, + new BeforeViewComponent( + context.ViewContext.ActionDescriptor, + context, + viewComponent + )); } } @@ -53,17 +53,16 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures private static void AfterViewComponentImpl(DiagnosticListener diagnosticListener, ViewComponentContext context, IViewComponentResult result, object viewComponent) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterViewComponent")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterViewComponent.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterViewComponent", - new - { - actionDescriptor = context.ViewContext.ActionDescriptor, - viewComponentContext = context, - viewComponentResult = result, - viewComponent = viewComponent - }); + Diagnostics.AfterViewComponent.EventName, + new AfterViewComponent( + context.ViewContext.ActionDescriptor, + context, + result, + viewComponent + )); } } @@ -81,16 +80,15 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures private static void ViewComponentBeforeViewExecuteImpl(DiagnosticListener diagnosticListener, ViewComponentContext context, IView view) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.ViewComponentBeforeViewExecute")) + if (diagnosticListener.IsEnabled(Diagnostics.ViewComponentBeforeViewExecute.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.ViewComponentBeforeViewExecute", - new - { - actionDescriptor = context.ViewContext.ActionDescriptor, - viewComponentContext = context, - view = view - }); + Diagnostics.ViewComponentBeforeViewExecute.EventName, + new ViewComponentBeforeViewExecute( + context.ViewContext.ActionDescriptor, + context, + view + )); } } @@ -108,16 +106,15 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures private static void ViewComponentAfterViewExecuteImpl(DiagnosticListener diagnosticListener, ViewComponentContext context, IView view) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.ViewComponentAfterViewExecute")) + if (diagnosticListener.IsEnabled(Diagnostics.ViewComponentAfterViewExecute.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.ViewComponentAfterViewExecute", - new - { - actionDescriptor = context.ViewContext.ActionDescriptor, - viewComponentContext = context, - view = view - }); + Diagnostics.ViewComponentAfterViewExecute.EventName, + new ViewComponentAfterViewExecute( + context.ViewContext.ActionDescriptor, + context, + view + )); } } @@ -135,11 +132,11 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures private static void BeforeViewImpl(DiagnosticListener diagnosticListener, IView view, ViewContext viewContext) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeView")) + if (diagnosticListener.IsEnabled(Diagnostics.BeforeView.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.BeforeView", - new { view = view, viewContext = viewContext, }); + Diagnostics.BeforeView.EventName, + new BeforeView(view, viewContext)); } } @@ -157,11 +154,11 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures private static void AfterViewImpl(DiagnosticListener diagnosticListener, IView view, ViewContext viewContext) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterView")) + if (diagnosticListener.IsEnabled(Diagnostics.AfterView.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.AfterView", - new { view = view, viewContext = viewContext, }); + Diagnostics.AfterView.EventName, + new AfterView(view, viewContext)); } } @@ -169,7 +166,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures this DiagnosticListener diagnosticListener, ActionContext actionContext, bool isMainPage, - PartialViewResult viewResult, + ActionResult viewResult, string viewName, IView view) { @@ -180,20 +177,19 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures } } - private static void ViewFoundImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, bool isMainPage, PartialViewResult viewResult, string viewName, IView view) + private static void ViewFoundImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, bool isMainPage, ActionResult viewResult, string viewName, IView view) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.ViewFound")) + if (diagnosticListener.IsEnabled(Diagnostics.ViewFound.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.ViewFound", - new - { - actionContext = actionContext, - isMainPage = isMainPage, - result = viewResult, - viewName = viewName, - view = view, - }); + Diagnostics.ViewFound.EventName, + new ViewFound( + actionContext, + isMainPage, + viewResult, + viewName, + view + )); } } @@ -201,7 +197,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures this DiagnosticListener diagnosticListener, ActionContext actionContext, bool isMainPage, - PartialViewResult viewResult, + ActionResult viewResult, string viewName, IEnumerable searchedLocations) { @@ -212,20 +208,19 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures } } - private static void ViewNotFoundImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, bool isMainPage, PartialViewResult viewResult, string viewName, IEnumerable searchedLocations) + private static void ViewNotFoundImpl(DiagnosticListener diagnosticListener, ActionContext actionContext, bool isMainPage, ActionResult viewResult, string viewName, IEnumerable searchedLocations) { - if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.ViewNotFound")) + if (diagnosticListener.IsEnabled(Diagnostics.ViewNotFound.EventName)) { diagnosticListener.Write( - "Microsoft.AspNetCore.Mvc.ViewNotFound", - new - { - actionContext = actionContext, - isMainPage = isMainPage, - result = viewResult, - viewName = viewName, - searchedLocations = searchedLocations, - }); + Diagnostics.ViewNotFound.EventName, + new ViewNotFound( + actionContext, + isMainPage, + viewResult, + viewName, + searchedLocations + )); } } } diff --git a/src/Mvc/Mvc.ViewFeatures/src/PartialViewResultExecutor.cs b/src/Mvc/Mvc.ViewFeatures/src/PartialViewResultExecutor.cs index 18476d7008..95b68df506 100644 --- a/src/Mvc/Mvc.ViewFeatures/src/PartialViewResultExecutor.cs +++ b/src/Mvc/Mvc.ViewFeatures/src/PartialViewResultExecutor.cs @@ -108,7 +108,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures if (result.Success) { - DiagnosticSource.ViewFound( + DiagnosticListener.ViewFound( actionContext, isMainPage: false, viewResult: viewResult, @@ -119,7 +119,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures } else { - DiagnosticSource.ViewNotFound( + DiagnosticListener.ViewNotFound( actionContext, isMainPage: false, viewResult: viewResult, diff --git a/src/Mvc/Mvc.ViewFeatures/src/ViewExecutor.cs b/src/Mvc/Mvc.ViewFeatures/src/ViewExecutor.cs index 5ac1031f56..24ca974c2e 100644 --- a/src/Mvc/Mvc.ViewFeatures/src/ViewExecutor.cs +++ b/src/Mvc/Mvc.ViewFeatures/src/ViewExecutor.cs @@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures /// The . /// The . /// The . - /// The . + /// The . /// The . public ViewExecutor( IOptions viewOptions, @@ -91,13 +91,13 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures WriterFactory = writerFactory; ViewEngine = viewEngine; - DiagnosticSource = diagnosticListener; + DiagnosticListener = diagnosticListener; } /// - /// Gets the . + /// Gets the . /// - protected DiagnosticListener DiagnosticSource { get; } + protected DiagnosticListener DiagnosticListener { get; } /// /// Gets the . @@ -242,11 +242,11 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures { viewContext.Writer = writer; - DiagnosticSource.BeforeView(view, viewContext); + DiagnosticListener.BeforeView(view, viewContext); await view.RenderAsync(viewContext); - DiagnosticSource.AfterView(view, viewContext); + DiagnosticListener.AfterView(view, viewContext); } finally { diff --git a/src/Mvc/Mvc.ViewFeatures/src/ViewResultExecutor.cs b/src/Mvc/Mvc.ViewFeatures/src/ViewResultExecutor.cs index 8cc09aac3c..69b8750e2f 100644 --- a/src/Mvc/Mvc.ViewFeatures/src/ViewResultExecutor.cs +++ b/src/Mvc/Mvc.ViewFeatures/src/ViewResultExecutor.cs @@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures } } - if (DiagnosticSource.IsEnabled()) + if (DiagnosticListener.IsEnabled()) { OutputDiagnostics(actionContext, viewResult, viewName, stopwatch, result); } @@ -128,35 +128,21 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures { if (result.Success) { - if (DiagnosticSource.IsEnabled("Microsoft.AspNetCore.Mvc.ViewFound")) - { - DiagnosticSource.Write( - "Microsoft.AspNetCore.Mvc.ViewFound", - new - { - actionContext, - isMainPage = true, - result = viewResult, - viewName, - view = result.View, - }); - } + DiagnosticListener.ViewFound( + actionContext, + isMainPage: true, + viewResult, + viewName, + view: result.View); } else { - if (DiagnosticSource.IsEnabled("Microsoft.AspNetCore.Mvc.ViewNotFound")) - { - DiagnosticSource.Write( - "Microsoft.AspNetCore.Mvc.ViewNotFound", - new - { - actionContext, - isMainPage = true, - result = viewResult, - viewName, - searchedLocations = result.SearchedLocations - }); - } + DiagnosticListener.ViewNotFound( + actionContext, + isMainPage: true, + viewResult, + viewName, + searchedLocations: result.SearchedLocations); } } diff --git a/src/Mvc/Mvc.ViewFeatures/test/ViewComponentResultTest.cs b/src/Mvc/Mvc.ViewFeatures/test/ViewComponentResultTest.cs index 0eff0f4df0..4dbf5e20d7 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/ViewComponentResultTest.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/ViewComponentResultTest.cs @@ -264,7 +264,7 @@ namespace Microsoft.AspNetCore.Mvc } [Fact] - public async Task ExecuteResultAsync_ExecutesViewComponent_AndWritesDiagnosticSource() + public async Task ExecuteResultAsync_ExecutesViewComponent_AndWritesDiagnosticListener() { // Arrange var methodInfo = typeof(TextViewComponent).GetMethod(nameof(TextViewComponent.Invoke)); diff --git a/src/Mvc/Mvc.ViewFeatures/test/ViewComponents/ViewViewComponentResultTest.cs b/src/Mvc/Mvc.ViewFeatures/test/ViewComponents/ViewViewComponentResultTest.cs index 1f0255c7e8..dc0f10ed02 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/ViewComponents/ViewViewComponentResultTest.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/ViewComponents/ViewViewComponentResultTest.cs @@ -102,7 +102,7 @@ namespace Microsoft.AspNetCore.Mvc } [Fact] - public void Execute_ResolvesView_AndWritesDiagnosticSource() + public void Execute_ResolvesView_AndWritesDiagnosticListener() { // Arrange var view = new Mock(MockBehavior.Strict); From a784f4575b738ec5b7c6f5cfff2b1fee10de5118 Mon Sep 17 00:00:00 2001 From: Mikael Mengistu Date: Mon, 15 Jul 2019 13:20:35 -0700 Subject: [PATCH 26/76] Updating logging on transport failure (#12026) --- src/Components/Web.JS/dist/Release/blazor.server.js | 2 +- src/SignalR/clients/ts/signalr/src/WebSocketTransport.ts | 3 +++ .../clients/ts/signalr/tests/HttpConnection.test.ts | 8 +++++--- .../clients/ts/signalr/tests/WebSocketTransport.test.ts | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Components/Web.JS/dist/Release/blazor.server.js b/src/Components/Web.JS/dist/Release/blazor.server.js index e4ff73a3e3..8b09c74e44 100644 --- a/src/Components/Web.JS/dist/Release/blazor.server.js +++ b/src/Components/Web.JS/dist/Release/blazor.server.js @@ -1,4 +1,4 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=48)}([function(e,t,n){"use strict";var r;n.d(t,"a",function(){return r}),function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(r||(r={}))},function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"c",function(){return c}),n.d(t,"f",function(){return u}),n.d(t,"g",function(){return l}),n.d(t,"h",function(){return f}),n.d(t,"e",function(){return h}),n.d(t,"d",function(){return p}),n.d(t,"b",function(){return d});var r=n(0),o=n(6),i=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})},a=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]-1&&this.subject.observers.splice(e,1),0===this.subject.observers.length&&this.subject.cancelCallback&&this.subject.cancelCallback().catch(function(e){})},e}(),d=function(){function e(e){this.minimumLogLevel=e,this.outputConsole=console}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.a.Critical:case r.a.Error:this.outputConsole.error("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Warning:this.outputConsole.warn("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Information:this.outputConsole.info("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;default:this.outputConsole.log("["+(new Date).toISOString()+"] "+r.a[e]+": "+t)}},e}()},function(e,t,n){"use strict";n.r(t);var r,o,i=n(3),a=n(4),s=n(42),c=n(0),u=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=function(e){function t(t){var n=e.call(this)||this;return n.logger=t,n}return u(t,e),t.prototype.send=function(e){var t=this;return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new i.a):e.method?e.url?new Promise(function(n,r){var o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=!0,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-Type","text/plain;charset=UTF-8");var s=e.headers;s&&Object.keys(s).forEach(function(e){o.setRequestHeader(e,s[e])}),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=function(){o.abort(),r(new i.a)}),e.timeout&&(o.timeout=e.timeout),o.onload=function(){e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?n(new a.b(o.status,o.statusText,o.response||o.responseText)):r(new i.b(o.statusText,o.status))},o.onerror=function(){t.logger.log(c.a.Warning,"Error from HTTP request. "+o.status+": "+o.statusText+"."),r(new i.b(o.statusText,o.status))},o.ontimeout=function(){t.logger.log(c.a.Warning,"Timeout from HTTP request."),r(new i.c)},o.send(e.content||"")}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t}(a.a),f=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),h=function(e){function t(t){var n=e.call(this)||this;return"undefined"!=typeof XMLHttpRequest?n.httpClient=new l(t):n.httpClient=new s.a(t),n}return f(t,e),t.prototype.send=function(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new i.a):e.method?e.url?this.httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t.prototype.getCookieString=function(e){return this.httpClient.getCookieString(e)},t}(a.a),p=n(43);!function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close"}(o||(o={}));var d,g=n(1),y=function(){function e(){this.observers=[]}return e.prototype.next=function(e){for(var t=0,n=this.observers;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?[2,Promise.reject(new Error("Unable to connect to the server with any of the available transports. "+i.join(" ")))]:[2,Promise.reject(new Error("None of the transports supported by the client are supported by the server."))]}})})},e.prototype.constructTransport=function(e){switch(e){case E.WebSockets:if(!this.options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new A(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.WebSocket);case E.ServerSentEvents:if(!this.options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new O(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.EventSource);case E.LongPolling:return new P(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1);default:throw new Error("Unknown transport: "+e+".")}},e.prototype.resolveTransportOrError=function(e,t,n){var r=E[e.transport];if(null==r)return this.logger.log(c.a.Debug,"Skipping transport '"+e.transport+"' because it is not supported by this client."),new Error("Skipping transport '"+e.transport+"' because it is not supported by this client.");if(!function(e,t){return!e||0!=(t&e)}(t,r))return this.logger.log(c.a.Debug,"Skipping transport '"+E[r]+"' because it was disabled by the client."),new Error("'"+E[r]+"' is disabled by the client.");if(!(e.transferFormats.map(function(e){return S[e]}).indexOf(n)>=0))return this.logger.log(c.a.Debug,"Skipping transport '"+E[r]+"' because it does not support the requested transfer format '"+S[n]+"'."),new Error("'"+E[r]+"' does not support "+S[n]+".");if(r===E.WebSockets&&!this.options.WebSocket||r===E.ServerSentEvents&&!this.options.EventSource)return this.logger.log(c.a.Debug,"Skipping transport '"+E[r]+"' because it is not supported in your environment.'"),new Error("'"+E[r]+"' is not supported in your environment.");this.logger.log(c.a.Debug,"Selecting transport '"+E[r]+"'.");try{return this.constructTransport(r)}catch(e){return e}},e.prototype.isITransport=function(e){return e&&"object"==typeof e&&"connect"in e},e.prototype.stopConnection=function(e){if(this.logger.log(c.a.Debug,"HttpConnection.stopConnection("+e+") called while in state "+this.connectionState+"."),this.transport=void 0,e=this.stopError||e,this.stopError=void 0,"Disconnected"!==this.connectionState)if("Connecting "!==this.connectionState){if("Disconnecting"===this.connectionState&&this.stopPromiseResolver(),e?this.logger.log(c.a.Error,"Connection disconnected with error '"+e+"'."):this.logger.log(c.a.Information,"Connection disconnected."),this.connectionId=void 0,this.connectionState="Disconnected",this.onclose&&this.connectionStarted){this.connectionStarted=!1;try{this.onclose(e)}catch(t){this.logger.log(c.a.Error,"HttpConnection.onclose("+e+") threw error '"+t+"'.")}}}else this.logger.log(c.a.Warning,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection hasn't yet left the in the connecting state.");else this.logger.log(c.a.Debug,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection is already in the disconnected state.")},e.prototype.resolveUrl=function(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!g.c.isBrowser||!window.document)throw new Error("Cannot resolve '"+e+"'.");var t=window.document.createElement("a");return t.href=e,this.logger.log(c.a.Information,"Normalizing '"+e+"' to '"+t.href+"'."),t.href},e.prototype.resolveNegotiateUrl=function(e){var t=e.indexOf("?"),n=e.substring(0,-1===t?e.length:t);return"/"!==n[n.length-1]&&(n+="/"),n+="negotiate",n+=-1===t?"":e.substring(t)},e}();var W=function(){function e(e){this.transport=e,this.buffer=[],this.executing=!0,this.sendBufferedData=new q,this.transportResult=new q,this.sendLoopPromise=this.sendLoop()}return e.prototype.send=function(e){return this.bufferData(e),this.transportResult||(this.transportResult=new q),this.transportResult.promise},e.prototype.stop=function(){return this.executing=!1,this.sendBufferedData.resolve(),this.sendLoopPromise},e.prototype.bufferData=function(e){if(this.buffer.length&&typeof this.buffer[0]!=typeof e)throw new Error("Expected data to be of type "+typeof this.buffer+" but was of type "+typeof e);this.buffer.push(e),this.sendBufferedData.resolve()},e.prototype.sendLoop=function(){return B(this,void 0,void 0,function(){var t,n,r;return j(this,function(o){switch(o.label){case 0:return[4,this.sendBufferedData.promise];case 1:if(o.sent(),!this.executing)return this.transportResult&&this.transportResult.reject("Connection stopped."),[3,6];this.sendBufferedData=new q,t=this.transportResult,this.transportResult=void 0,n="string"==typeof this.buffer[0]?this.buffer.join(""):e.concatBuffers(this.buffer),this.buffer.length=0,o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.transport.send(n)];case 3:return o.sent(),t.resolve(),[3,5];case 4:return r=o.sent(),t.reject(r),[3,5];case 5:return[3,0];case 6:return[2]}})})},e.concatBuffers=function(e){for(var t=e.map(function(e){return e.byteLength}).reduce(function(e,t){return e+t}),n=new Uint8Array(t),r=0,o=0,i=e;o0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]-1&&this.subject.observers.splice(e,1),0===this.subject.observers.length&&this.subject.cancelCallback&&this.subject.cancelCallback().catch(function(e){})},e}(),d=function(){function e(e){this.minimumLogLevel=e,this.outputConsole=console}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.a.Critical:case r.a.Error:this.outputConsole.error("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Warning:this.outputConsole.warn("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Information:this.outputConsole.info("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;default:this.outputConsole.log("["+(new Date).toISOString()+"] "+r.a[e]+": "+t)}},e}()},function(e,t,n){"use strict";n.r(t);var r,o,i=n(3),a=n(4),s=n(42),c=n(0),u=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=function(e){function t(t){var n=e.call(this)||this;return n.logger=t,n}return u(t,e),t.prototype.send=function(e){var t=this;return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new i.a):e.method?e.url?new Promise(function(n,r){var o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=!0,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-Type","text/plain;charset=UTF-8");var s=e.headers;s&&Object.keys(s).forEach(function(e){o.setRequestHeader(e,s[e])}),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=function(){o.abort(),r(new i.a)}),e.timeout&&(o.timeout=e.timeout),o.onload=function(){e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?n(new a.b(o.status,o.statusText,o.response||o.responseText)):r(new i.b(o.statusText,o.status))},o.onerror=function(){t.logger.log(c.a.Warning,"Error from HTTP request. "+o.status+": "+o.statusText+"."),r(new i.b(o.statusText,o.status))},o.ontimeout=function(){t.logger.log(c.a.Warning,"Timeout from HTTP request."),r(new i.c)},o.send(e.content||"")}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t}(a.a),f=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),h=function(e){function t(t){var n=e.call(this)||this;return"undefined"!=typeof XMLHttpRequest?n.httpClient=new l(t):n.httpClient=new s.a(t),n}return f(t,e),t.prototype.send=function(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new i.a):e.method?e.url?this.httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t.prototype.getCookieString=function(e){return this.httpClient.getCookieString(e)},t}(a.a),p=n(43);!function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close"}(o||(o={}));var d,g=n(1),y=function(){function e(){this.observers=[]}return e.prototype.next=function(e){for(var t=0,n=this.observers;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?[2,Promise.reject(new Error("Unable to connect to the server with any of the available transports. "+i.join(" ")))]:[2,Promise.reject(new Error("None of the transports supported by the client are supported by the server."))]}})})},e.prototype.constructTransport=function(e){switch(e){case E.WebSockets:if(!this.options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new A(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.WebSocket);case E.ServerSentEvents:if(!this.options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new O(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.EventSource);case E.LongPolling:return new P(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1);default:throw new Error("Unknown transport: "+e+".")}},e.prototype.resolveTransportOrError=function(e,t,n){var r=E[e.transport];if(null==r)return this.logger.log(c.a.Debug,"Skipping transport '"+e.transport+"' because it is not supported by this client."),new Error("Skipping transport '"+e.transport+"' because it is not supported by this client.");if(!function(e,t){return!e||0!=(t&e)}(t,r))return this.logger.log(c.a.Debug,"Skipping transport '"+E[r]+"' because it was disabled by the client."),new Error("'"+E[r]+"' is disabled by the client.");if(!(e.transferFormats.map(function(e){return S[e]}).indexOf(n)>=0))return this.logger.log(c.a.Debug,"Skipping transport '"+E[r]+"' because it does not support the requested transfer format '"+S[n]+"'."),new Error("'"+E[r]+"' does not support "+S[n]+".");if(r===E.WebSockets&&!this.options.WebSocket||r===E.ServerSentEvents&&!this.options.EventSource)return this.logger.log(c.a.Debug,"Skipping transport '"+E[r]+"' because it is not supported in your environment.'"),new Error("'"+E[r]+"' is not supported in your environment.");this.logger.log(c.a.Debug,"Selecting transport '"+E[r]+"'.");try{return this.constructTransport(r)}catch(e){return e}},e.prototype.isITransport=function(e){return e&&"object"==typeof e&&"connect"in e},e.prototype.stopConnection=function(e){if(this.logger.log(c.a.Debug,"HttpConnection.stopConnection("+e+") called while in state "+this.connectionState+"."),this.transport=void 0,e=this.stopError||e,this.stopError=void 0,"Disconnected"!==this.connectionState)if("Connecting "!==this.connectionState){if("Disconnecting"===this.connectionState&&this.stopPromiseResolver(),e?this.logger.log(c.a.Error,"Connection disconnected with error '"+e+"'."):this.logger.log(c.a.Information,"Connection disconnected."),this.connectionId=void 0,this.connectionState="Disconnected",this.onclose&&this.connectionStarted){this.connectionStarted=!1;try{this.onclose(e)}catch(t){this.logger.log(c.a.Error,"HttpConnection.onclose("+e+") threw error '"+t+"'.")}}}else this.logger.log(c.a.Warning,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection hasn't yet left the in the connecting state.");else this.logger.log(c.a.Debug,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection is already in the disconnected state.")},e.prototype.resolveUrl=function(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!g.c.isBrowser||!window.document)throw new Error("Cannot resolve '"+e+"'.");var t=window.document.createElement("a");return t.href=e,this.logger.log(c.a.Information,"Normalizing '"+e+"' to '"+t.href+"'."),t.href},e.prototype.resolveNegotiateUrl=function(e){var t=e.indexOf("?"),n=e.substring(0,-1===t?e.length:t);return"/"!==n[n.length-1]&&(n+="/"),n+="negotiate",n+=-1===t?"":e.substring(t)},e}();var W=function(){function e(e){this.transport=e,this.buffer=[],this.executing=!0,this.sendBufferedData=new q,this.transportResult=new q,this.sendLoopPromise=this.sendLoop()}return e.prototype.send=function(e){return this.bufferData(e),this.transportResult||(this.transportResult=new q),this.transportResult.promise},e.prototype.stop=function(){return this.executing=!1,this.sendBufferedData.resolve(),this.sendLoopPromise},e.prototype.bufferData=function(e){if(this.buffer.length&&typeof this.buffer[0]!=typeof e)throw new Error("Expected data to be of type "+typeof this.buffer+" but was of type "+typeof e);this.buffer.push(e),this.sendBufferedData.resolve()},e.prototype.sendLoop=function(){return B(this,void 0,void 0,function(){var t,n,r;return j(this,function(o){switch(o.label){case 0:return[4,this.sendBufferedData.promise];case 1:if(o.sent(),!this.executing)return this.transportResult&&this.transportResult.reject("Connection stopped."),[3,6];this.sendBufferedData=new q,t=this.transportResult,this.transportResult=void 0,n="string"==typeof this.buffer[0]?this.buffer.join(""):e.concatBuffers(this.buffer),this.buffer.length=0,o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.transport.send(n)];case 3:return o.sent(),t.resolve(),[3,5];case 4:return r=o.sent(),t.reject(r),[3,5];case 5:return[3,0];case 6:return[2]}})})},e.concatBuffers=function(e){for(var t=e.map(function(e){return e.byteLength}).reduce(function(e,t){return e+t}),n=new Uint8Array(t),r=0,o=0,i=e;o { const connection = new HttpConnection("http://tempuri.org", options); await expect(connection.start(TransferFormat.Text)) .rejects - .toThrow("Unable to connect to the server with any of the available transports. WebSockets failed: null ServerSentEvents failed: Error: 'ServerSentEvents' is disabled by the client. LongPolling failed: Error: 'LongPolling' is disabled by the client."); + .toThrow("Unable to connect to the server with any of the available transports. WebSockets failed: Error: There was an error with the transport. " + + "ServerSentEvents failed: Error: 'ServerSentEvents' is disabled by the client. LongPolling failed: Error: 'LongPolling' is disabled by the client."); expect(negotiateCount).toEqual(1); }, - "Failed to start the transport 'WebSockets': null", - "Failed to start the connection: Error: Unable to connect to the server with any of the available transports. WebSockets failed: null ServerSentEvents failed: Error: 'ServerSentEvents' is disabled by the client. LongPolling failed: Error: 'LongPolling' is disabled by the client."); + "Failed to start the transport 'WebSockets': Error: There was an error with the transport.", + "Failed to start the connection: Error: Unable to connect to the server with any of the available transports. WebSockets failed: Error: There was an error with the transport. " + + "ServerSentEvents failed: Error: 'ServerSentEvents' is disabled by the client. LongPolling failed: Error: 'LongPolling' is disabled by the client."); }); it("negotiate called again when transport fails to start and falls back", async () => { diff --git a/src/SignalR/clients/ts/signalr/tests/WebSocketTransport.test.ts b/src/SignalR/clients/ts/signalr/tests/WebSocketTransport.test.ts index 8c610d523a..28277df11a 100644 --- a/src/SignalR/clients/ts/signalr/tests/WebSocketTransport.test.ts +++ b/src/SignalR/clients/ts/signalr/tests/WebSocketTransport.test.ts @@ -61,7 +61,7 @@ describe("WebSocketTransport", () => { await expect(connectPromise) .rejects - .toBeNull(); + .toThrow("There was an error with the transport."); expect(connectComplete).toBe(false); }); }); From 7b56439ca1cbc384f1e9648f4ae983d3b39119d8 Mon Sep 17 00:00:00 2001 From: Dylan Dmitri Gray Date: Mon, 15 Jul 2019 15:28:51 -0700 Subject: [PATCH 27/76] Dylan/polishing (#12163) * fixed slnf path, fixed options comment, renames * cleaned up sample --- src/Middleware/ConcurrencyLimiter/ConcurrencyLimiter.slnf | 2 +- .../Microsoft.AspNetCore.ConcurrencyLimiter.netcoreapp3.0.cs | 4 ++-- src/Middleware/ConcurrencyLimiter/sample/Startup.cs | 3 ++- .../src/QueuePolicies/QueuePolicyOptions.cs | 2 +- .../QueuePolicies/QueuePolicyServiceCollectionExtensions.cs | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Middleware/ConcurrencyLimiter/ConcurrencyLimiter.slnf b/src/Middleware/ConcurrencyLimiter/ConcurrencyLimiter.slnf index cff033d73c..57a7824aae 100644 --- a/src/Middleware/ConcurrencyLimiter/ConcurrencyLimiter.slnf +++ b/src/Middleware/ConcurrencyLimiter/ConcurrencyLimiter.slnf @@ -1,6 +1,6 @@ { "solution": { - "path": "C:\\Users\\t-dygra\\Desktop\\AspNetCore\\src\\Middleware\\Middleware.sln", + "path": "..\\Middleware.sln", "projects": [ "..\\Hosting\\Abstractions\\src\\Microsoft.AspNetCore.Hosting.Abstractions.csproj", "..\\Hosting\\Hosting\\src\\Microsoft.AspNetCore.Hosting.csproj", diff --git a/src/Middleware/ConcurrencyLimiter/ref/Microsoft.AspNetCore.ConcurrencyLimiter.netcoreapp3.0.cs b/src/Middleware/ConcurrencyLimiter/ref/Microsoft.AspNetCore.ConcurrencyLimiter.netcoreapp3.0.cs index dd8206d528..7eec4a3840 100644 --- a/src/Middleware/ConcurrencyLimiter/ref/Microsoft.AspNetCore.ConcurrencyLimiter.netcoreapp3.0.cs +++ b/src/Middleware/ConcurrencyLimiter/ref/Microsoft.AspNetCore.ConcurrencyLimiter.netcoreapp3.0.cs @@ -37,7 +37,7 @@ namespace Microsoft.Extensions.DependencyInjection { public static partial class QueuePolicyServiceCollectionExtensions { - public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddStackQueue(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action configure) { throw null; } - public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddTailDropQueue(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action configure) { throw null; } + public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddFIFOQueue(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action configure) { throw null; } + public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddLIFOQueue(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action configure) { throw null; } } } diff --git a/src/Middleware/ConcurrencyLimiter/sample/Startup.cs b/src/Middleware/ConcurrencyLimiter/sample/Startup.cs index 618d6e56f6..6fe4e4a6b0 100644 --- a/src/Middleware/ConcurrencyLimiter/sample/Startup.cs +++ b/src/Middleware/ConcurrencyLimiter/sample/Startup.cs @@ -17,7 +17,7 @@ namespace ConcurrencyLimiterSample { public void ConfigureServices(IServiceCollection services) { - services.AddStackQueue((options) => { + services.AddLIFOQueue((options) => { options.MaxConcurrentRequests = Environment.ProcessorCount; options.RequestQueueLimit = 50; }); @@ -39,6 +39,7 @@ namespace ConcurrencyLimiterSample { new WebHostBuilder() .UseKestrel() + .UseContentRoot(Directory.GetCurrentDirectory()) // for cert file .UseStartup() .Build() .Run(); diff --git a/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyOptions.cs b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyOptions.cs index 53923ccd1b..e70eb66a27 100644 --- a/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyOptions.cs +++ b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyOptions.cs @@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.ConcurrencyLimiter /// /// Maximum number of queued requests before the server starts rejecting connections with '503 Service Unavailible'. - /// Defaults to 5000 queued requests. + /// This option is highly application dependant, and must be configured by the application. /// public int RequestQueueLimit { get; set; } } diff --git a/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyServiceCollectionExtensions.cs b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyServiceCollectionExtensions.cs index 021ae8278a..c11fe8fffa 100644 --- a/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyServiceCollectionExtensions.cs +++ b/src/Middleware/ConcurrencyLimiter/src/QueuePolicies/QueuePolicyServiceCollectionExtensions.cs @@ -18,7 +18,7 @@ namespace Microsoft.Extensions.DependencyInjection /// Set the options used by the queue. /// Mandatory, since must be provided. /// - public static IServiceCollection AddTailDropQueue(this IServiceCollection services, Action configure) + public static IServiceCollection AddFIFOQueue(this IServiceCollection services, Action configure) { services.Configure(configure); services.AddSingleton(); @@ -32,7 +32,7 @@ namespace Microsoft.Extensions.DependencyInjection /// Set the options used by the queue. /// Mandatory, since must be provided. /// - public static IServiceCollection AddStackQueue(this IServiceCollection services, Action configure) + public static IServiceCollection AddLIFOQueue(this IServiceCollection services, Action configure) { services.Configure(configure); services.AddSingleton(); From d27c0100bc8b9b93eb8102b097c20b40f7de9c49 Mon Sep 17 00:00:00 2001 From: John Luo Date: Mon, 15 Jul 2019 17:17:31 -0700 Subject: [PATCH 28/76] Resolve Guid inputs correctly (#11865) (#12206) --- src/Installers/Windows/Wix.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Installers/Windows/Wix.targets b/src/Installers/Windows/Wix.targets index 8970b74341..f7323ee110 100644 --- a/src/Installers/Windows/Wix.targets +++ b/src/Installers/Windows/Wix.targets @@ -21,7 +21,7 @@ - $(Version);$(Platform);(VersionSuffix) + $(Version);$(Platform);$(VersionSuffix) From 94edcbf65bc68aeebc97be8347577304059a01e0 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 15 Jul 2019 17:48:26 -0700 Subject: [PATCH 29/76] Avoid throwing if serializer settings is null (#12207) Also adds some docs that suggest what needs to be passed as an argument instance --- src/Mvc/Mvc.Core/src/JsonResult.cs | 23 +++++++++++++++------- src/Mvc/Mvc.ViewFeatures/src/Controller.cs | 15 ++++++++------ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/Mvc/Mvc.Core/src/JsonResult.cs b/src/Mvc/Mvc.Core/src/JsonResult.cs index c62cf5e49e..6d43cc6832 100644 --- a/src/Mvc/Mvc.Core/src/JsonResult.cs +++ b/src/Mvc/Mvc.Core/src/JsonResult.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Text.Json; using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.Extensions.DependencyInjection; @@ -27,14 +27,17 @@ namespace Microsoft.AspNetCore.Mvc /// Creates a new with the given . /// /// The value to format as JSON. - /// The serializer settings to be used by the formatter. + /// + /// The serializer settings to be used by the formatter. + /// + /// When using System.Text.Json, this should be an instance of . + /// + /// + /// When using Newtonsoft.Json, this should be an instance of JsonSerializerSettings. + /// + /// public JsonResult(object value, object serializerSettings) { - if (serializerSettings == null) - { - throw new ArgumentNullException(nameof(serializerSettings)); - } - Value = value; SerializerSettings = serializerSettings; } @@ -46,6 +49,12 @@ namespace Microsoft.AspNetCore.Mvc /// /// Gets or sets the serializer settings. + /// + /// When using System.Text.Json, this should be an instance of + /// + /// + /// When using Newtonsoft.Json, this should be an instance of JsonSerializerSettings. + /// /// public object SerializerSettings { get; set; } diff --git a/src/Mvc/Mvc.ViewFeatures/src/Controller.cs b/src/Mvc/Mvc.ViewFeatures/src/Controller.cs index e90117df62..0171f04797 100644 --- a/src/Mvc/Mvc.ViewFeatures/src/Controller.cs +++ b/src/Mvc/Mvc.ViewFeatures/src/Controller.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Text.Json; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.ModelBinding; @@ -298,7 +299,14 @@ namespace Microsoft.AspNetCore.Mvc /// to JSON. /// /// The object to serialize. - /// The serializer settings to be used by the formatter. + /// The serializer settings to be used by the formatter. + /// + /// When using System.Text.Json, this should be an instance of . + /// + /// + /// When using Newtonsoft.Json, this should be an instance of JsonSerializerSettings. + /// + /// /// The created that serializes the specified /// as JSON format for the response. /// Callers should cache an instance of serializer settings to avoid @@ -306,11 +314,6 @@ namespace Microsoft.AspNetCore.Mvc [NonAction] public virtual JsonResult Json(object data, object serializerSettings) { - if (serializerSettings == null) - { - throw new ArgumentNullException(nameof(serializerSettings)); - } - return new JsonResult(data, serializerSettings); } From 2d335f3647f14f03be843f1e097fc19b05ef0674 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Mon, 15 Jul 2019 18:22:29 -0700 Subject: [PATCH 30/76] List all SPA project template names --- .../test/Templates.Test/Helpers/TemplatePackageInstaller.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Templating/test/Templates.Test/Helpers/TemplatePackageInstaller.cs b/src/Templating/test/Templates.Test/Helpers/TemplatePackageInstaller.cs index 304bfb3dd5..27133552f0 100644 --- a/src/Templating/test/Templates.Test/Helpers/TemplatePackageInstaller.cs +++ b/src/Templating/test/Templates.Test/Helpers/TemplatePackageInstaller.cs @@ -46,6 +46,7 @@ namespace Templates.Test.Helpers "Microsoft.DotNet.Web.ProjectTemplates.2.2", "Microsoft.DotNet.Web.ProjectTemplates.3.0", "Microsoft.DotNet.Web.Spa.ProjectTemplates", + "Microsoft.DotNet.Web.Spa.ProjectTemplates.2.1", "Microsoft.DotNet.Web.Spa.ProjectTemplates.2.2", "Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0" }; From 496249fee9ffa0855c2e4d95353010568dbc4935 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Mon, 15 Jul 2019 16:06:28 -0700 Subject: [PATCH 31/76] Fix bug in CircuitManager This bug was introduced by removing the parsing from 8fa4df9bda938def3ea053a5c51ed4a38d9b80ec but not updating the tests. We expect component and rendererId to always be numbers (not strings). It looks like these tests are not currently running on the CI which was how we were able to find the issue. --- .../Web.JS/dist/Release/blazor.server.js | 2 +- .../src/Platform/Circuits/CircuitManager.ts | 15 +++---- .../Web.JS/tests/CircuitManager.test.ts | 45 ++++++++++++++----- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/src/Components/Web.JS/dist/Release/blazor.server.js b/src/Components/Web.JS/dist/Release/blazor.server.js index 8b09c74e44..d0bae1fe85 100644 --- a/src/Components/Web.JS/dist/Release/blazor.server.js +++ b/src/Components/Web.JS/dist/Release/blazor.server.js @@ -12,4 +12,4 @@ var r=n(49),o=n(50),i=n(51);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647 * @author Feross Aboukhadijeh * @license MIT */ -function r(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o=0;u--)if(l[u]!==f[u])return!1;for(u=l.length-1;u>=0;u--)if(c=l[u],!b(e[c],t[c],n,r))return!1;return!0}(e,t,n,a))}return n?e===t:e==t}function m(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&y(o,n,"Missing expected exception"+r);var a="string"==typeof r,s=!e&&o&&!n;if((!e&&i.isError(o)&&a&&w(o,n)||s)&&y(o,n,"Got unwanted exception"+r),e&&o&&n&&!w(o,n)||!e&&o)throw o}f.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=d(g((t=this).actual),128)+" "+t.operator+" "+d(g(t.expected),128),this.generatedMessage=!0);var n=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var r=new Error;if(r.stack){var o=r.stack,i=p(n),a=o.indexOf("\n"+i);if(a>=0){var s=o.indexOf("\n",a+1);o=o.substring(s+1)}this.stack=o}}},i.inherits(f.AssertionError,Error),f.fail=y,f.ok=v,f.equal=function(e,t,n){e!=t&&y(e,t,n,"==",f.equal)},f.notEqual=function(e,t,n){e==t&&y(e,t,n,"!=",f.notEqual)},f.deepEqual=function(e,t,n){b(e,t,!1)||y(e,t,n,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,n){b(e,t,!0)||y(e,t,n,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,n){b(e,t,!1)&&y(e,t,n,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,n,r){b(t,n,!0)&&y(t,n,r,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,n){e!==t&&y(e,t,n,"===",f.strictEqual)},f.notStrictEqual=function(e,t,n){e===t&&y(e,t,n,"!==",f.notStrictEqual)},f.throws=function(e,t,n){E(!0,e,t,n)},f.doesNotThrow=function(e,t,n){E(!1,e,t,n)},f.ifError=function(e){if(e)throw e};var S=Object.keys||function(e){var t=[];for(var n in e)a.call(e,n)&&t.push(n);return t}}).call(this,n(8))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){e.exports=n(9)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t){},function(e,t,n){"use strict";var r=n(13).Buffer,o=n(59);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=i,o=s,t.copy(n,o),s+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){var r=n(5),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),i(o,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(62),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(8))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,c=1,u={},l=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){d(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n0?this._transform(null,t,n):n()},e.exports.decoder=c,e.exports.encoder=s},function(e,t,n){(t=e.exports=n(34)).Stream=t,t.Readable=t,t.Writable=n(39),t.Duplex=n(9),t.Transform=n(40),t.PassThrough=n(66)},function(e,t,n){"use strict";e.exports=i;var r=n(40),o=n(18);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(14),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){var r=n(20);function o(e){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=e||"unable to decode"}n(33).inherits(o,Error),e.exports=function(e){return function(e){e instanceof r||(e=r().append(e));var t=i(e);if(t)return e.consume(t.bytesConsumed),t.value;throw new o};function t(e,t,n){return t>=n+e}function n(e,t){return{value:e,bytesConsumed:t}}function i(e,r){r=void 0===r?0:r;var o=e.length-r;if(o<=0)return null;var i,l,f,h=e.readUInt8(r),p=0;if(!function(e,t){var n=function(e){switch(e){case 196:return 2;case 197:return 3;case 198:return 5;case 199:return 3;case 200:return 4;case 201:return 6;case 202:return 5;case 203:return 9;case 204:return 2;case 205:return 3;case 206:return 5;case 207:return 9;case 208:return 2;case 209:return 3;case 210:return 5;case 211:return 9;case 212:return 3;case 213:return 4;case 214:return 6;case 215:return 10;case 216:return 18;case 217:return 2;case 218:return 3;case 219:return 5;case 222:return 3;default:return-1}}(e);return!(-1!==n&&t=0;f--)p+=e.readUInt8(r+f+1)*Math.pow(2,8*(7-f));return n(p,9);case 208:return n(p=e.readInt8(r+1),2);case 209:return n(p=e.readInt16BE(r+1),3);case 210:return n(p=e.readInt32BE(r+1),5);case 211:return n(p=function(e,t){var n=128==(128&e[t]);if(n)for(var r=1,o=t+7;o>=t;o--){var i=(255^e[o])+r;e[o]=255&i,r=i>>8}var a=e.readUInt32BE(t+0),s=e.readUInt32BE(t+4);return(4294967296*a+s)*(n?-1:1)}(e.slice(r+1,r+9),0),9);case 202:return n(p=e.readFloatBE(r+1),5);case 203:return n(p=e.readDoubleBE(r+1),9);case 217:return t(i=e.readUInt8(r+1),o,2)?n(p=e.toString("utf8",r+2,r+2+i),2+i):null;case 218:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.toString("utf8",r+3,r+3+i),3+i):null;case 219:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.toString("utf8",r+5,r+5+i),5+i):null;case 196:return t(i=e.readUInt8(r+1),o,2)?n(p=e.slice(r+2,r+2+i),2+i):null;case 197:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.slice(r+3,r+3+i),3+i):null;case 198:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.slice(r+5,r+5+i),5+i):null;case 220:return o<3?null:(i=e.readUInt16BE(r+1),a(e,r,i,3));case 221:return o<5?null:(i=e.readUInt32BE(r+1),a(e,r,i,5));case 222:return i=e.readUInt16BE(r+1),s(e,r,i,3);case 223:throw new Error("map too big to decode in JS");case 212:return c(e,r,1);case 213:return c(e,r,2);case 214:return c(e,r,4);case 215:return c(e,r,8);case 216:return c(e,r,16);case 199:return i=e.readUInt8(r+1),l=e.readUInt8(r+2),t(i,o,3)?u(e,r,l,i,3):null;case 200:return i=e.readUInt16BE(r+1),l=e.readUInt8(r+3),t(i,o,4)?u(e,r,l,i,4):null;case 201:return i=e.readUInt32BE(r+1),l=e.readUInt8(r+5),t(i,o,6)?u(e,r,l,i,6):null}if(144==(240&h))return a(e,r,i=15&h,1);if(128==(240&h))return s(e,r,i=15&h,1);if(160==(224&h))return t(i=31&h,o,1)?n(p=e.toString("utf8",r+1,r+i+1),i+1):null;if(h>=224)return n(p=h-256,1);if(h<128)return n(h,1);throw new Error("not implemented yet")}function a(e,t,r,o){var a,s=[],c=0;for(t+=o,a=0;ai)&&((n=r.allocUnsafe(9))[0]=203,n.writeDoubleBE(e,1)),n}e.exports=function(e,t,n,i){function s(c,u){var l,f,h;if(void 0===c)throw new Error("undefined is not encodable in msgpack!");if(null===c)(l=r.allocUnsafe(1))[0]=192;else if(!0===c)(l=r.allocUnsafe(1))[0]=195;else if(!1===c)(l=r.allocUnsafe(1))[0]=194;else if("string"==typeof c)(f=r.byteLength(c))<32?((l=r.allocUnsafe(1+f))[0]=160|f,f>0&&l.write(c,1)):f<=255&&!n?((l=r.allocUnsafe(2+f))[0]=217,l[1]=f,l.write(c,2)):f<=65535?((l=r.allocUnsafe(3+f))[0]=218,l.writeUInt16BE(f,1),l.write(c,3)):((l=r.allocUnsafe(5+f))[0]=219,l.writeUInt32BE(f,1),l.write(c,5));else if(c&&(c.readUInt32LE||c instanceof Uint8Array))c instanceof Uint8Array&&(c=r.from(c)),c.length<=255?((l=r.allocUnsafe(2))[0]=196,l[1]=c.length):c.length<=65535?((l=r.allocUnsafe(3))[0]=197,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=198,l.writeUInt32BE(c.length,1)),l=o([l,c]);else if(Array.isArray(c))c.length<16?(l=r.allocUnsafe(1))[0]=144|c.length:c.length<65536?((l=r.allocUnsafe(3))[0]=220,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=221,l.writeUInt32BE(c.length,1)),l=c.reduce(function(e,t){return e.append(s(t,!0)),e},o().append(l));else{if(!i&&"function"==typeof c.getDate)return function(e){var t,n=1*e,i=Math.floor(n/1e3),a=1e6*(n-1e3*i);if(a||i>4294967295){(t=new r(10))[0]=215,t[1]=-1;var s=4*a,c=i/Math.pow(2,32),u=s+c&4294967295,l=4294967295&i;t.writeInt32BE(u,2),t.writeInt32BE(l,6)}else(t=new r(6))[0]=214,t[1]=-1,t.writeUInt32BE(Math.floor(n/1e3),2);return o().append(t)}(c);if("object"==typeof c)l=function(t){var n,i,a=-1,s=[];for(n=0;n>8),s.push(255&a)):(s.push(201),s.push(a>>24),s.push(a>>16&255),s.push(a>>8&255),s.push(255&a));return o().append(r.from(s)).append(i)}(c)||function(e){var t,n,i=[],a=0;for(t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&"function"!=typeof e[t]&&(++a,i.push(s(t,!0)),i.push(s(e[t],!0)));a<16?(n=r.allocUnsafe(1))[0]=128|a:((n=r.allocUnsafe(3))[0]=222,n.writeUInt16BE(a,1));return i.unshift(n),i.reduce(function(e,t){return e.append(t)},o())}(c);else if("number"==typeof c){if((h=c)!==Math.floor(h))return a(c,t);if(c>=0)if(c<128)(l=r.allocUnsafe(1))[0]=c;else if(c<256)(l=r.allocUnsafe(2))[0]=204,l[1]=c;else if(c<65536)(l=r.allocUnsafe(3))[0]=205,l.writeUInt16BE(c,1);else if(c<=4294967295)(l=r.allocUnsafe(5))[0]=206,l.writeUInt32BE(c,1);else{if(!(c<=9007199254740991))return a(c,!0);(l=r.allocUnsafe(9))[0]=207,function(e,t){for(var n=7;n>=0;n--)e[n+1]=255&t,t/=256}(l,c)}else if(c>=-32)(l=r.allocUnsafe(1))[0]=256+c;else if(c>=-128)(l=r.allocUnsafe(2))[0]=208,l.writeInt8(c,1);else if(c>=-32768)(l=r.allocUnsafe(3))[0]=209,l.writeInt16BE(c,1);else if(c>-214748365)(l=r.allocUnsafe(5))[0]=210,l.writeInt32BE(c,1);else{if(!(c>=-9007199254740991))return a(c,!0);(l=r.allocUnsafe(9))[0]=211,function(e,t,n){var r=n<0;r&&(n=Math.abs(n));var o=n%4294967296,i=n/4294967296;if(e.writeUInt32BE(Math.floor(i),t+0),e.writeUInt32BE(o,t+4),r)for(var a=1,s=t+7;s>=t;s--){var c=(255^e[s])+a;e[s]=255&c,a=c>>8}}(l,1,c)}}}if(!l)throw new Error("not implemented yet");return u?l:l.slice()}return s}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.dialog=e}return e.prototype.show=function(){this.removeClasses(),this.dialog.classList.add(e.ShowClassName)},e.prototype.hide=function(){this.removeClasses(),this.dialog.classList.add(e.HideClassName)},e.prototype.failed=function(){this.removeClasses(),this.dialog.classList.add(e.FailedClassName)},e.prototype.removeClasses=function(){this.dialog.classList.remove(e.ShowClassName,e.HideClassName,e.FailedClassName)},e.ShowClassName="components-reconnect-show",e.HideClassName="components-reconnect-hide",e.FailedClassName="components-reconnect-failed",e}();t.UserSpecifiedDisplay=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(41),o=function(){function e(e){this.document=e,this.addedToDom=!1,this.modal=this.document.createElement("div"),this.modal.id=r.AutoReconnectCircuitHandler.DialogId;this.modal.style.cssText=["position: fixed","top: 0","right: 0","bottom: 0","left: 0","z-index: 1000","display: none","overflow: hidden","background-color: #fff","opacity: 0.8","text-align: center","font-weight: bold"].join(";"),this.modal.innerHTML='
',this.message=this.modal.querySelector("h5"),this.button=this.modal.querySelector("button"),this.button.addEventListener("click",function(){return window.Blazor.reconnect()})}return e.prototype.show=function(){this.addedToDom||(this.addedToDom=!0,this.document.body.appendChild(this.modal)),this.modal.style.display="block",this.button.style.display="none",this.message.textContent="Attempting to reconnect to the server..."},e.prototype.hide=function(){this.modal.style.display="none"},e.prototype.failed=function(){this.button.style.display="block",this.message.textContent="Failed to reconnect to the server."},e}();t.DefaultReconnectDisplay=o},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]this.nextBatchId)this.logger.log(s.LogLevel.Debug,"Waiting for batch "+this.nextBatchId+". Batch "+e+" not processed.");else try{this.nextBatchId++,this.logger.log(s.LogLevel.Debug,"Applying batch "+e+"."),i.renderBatch(this.browserRendererId,new a.OutOfProcessRenderBatch(t)),this.completeBatch(n,e)}catch(t){throw this.logger.log(s.LogLevel.Error,"There was an error applying batch "+e+"."),n.send("OnRenderCompleted",e,t.toString()),t}},e.prototype.getLastBatchid=function(){return this.nextBatchId-1},e.prototype.completeBatch=function(e,t){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.send("OnRenderCompleted",t,null)];case 1:return n.sent(),[3,3];case 2:return n.sent(),this.logger.log(s.LogLevel.Warning,"Failed to deliver completion notification for render '"+t+"'."),[3,3];case 3:return[2]}})})},e.renderQueues=new Map,e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(73),o=function(){function e(e){this.batchData=e;var t=new c(e);this.arrayRangeReader=new u(e),this.arrayBuilderSegmentReader=new l(e),this.diffReader=new i(e),this.editReader=new a(e,t),this.frameReader=new s(e,t)}return e.prototype.updatedComponents=function(){return f(this.batchData,this.batchData.length-20)},e.prototype.referenceFrames=function(){return f(this.batchData,this.batchData.length-16)},e.prototype.disposedComponentIds=function(){return f(this.batchData,this.batchData.length-12)},e.prototype.disposedEventHandlerIds=function(){return f(this.batchData,this.batchData.length-8)},e.prototype.updatedComponentsEntry=function(e,t){var n=e+4*t;return f(this.batchData,n)},e.prototype.referenceFramesEntry=function(e,t){return e+16*t},e.prototype.disposedComponentIdsEntry=function(e,t){var n=e+4*t;return f(this.batchData,n)},e.prototype.disposedEventHandlerIdsEntry=function(e,t){var n=e+4*t;return f(this.batchData,n)},e}();t.OutOfProcessRenderBatch=o;var i=function(){function e(e){this.batchDataUint8=e}return e.prototype.componentId=function(e){return f(this.batchDataUint8,e)},e.prototype.edits=function(e){return e+4},e.prototype.editsEntry=function(e,t){return e+16*t},e}(),a=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.editType=function(e){return f(this.batchDataUint8,e)},e.prototype.siblingIndex=function(e){return f(this.batchDataUint8,e+4)},e.prototype.newTreeIndex=function(e){return f(this.batchDataUint8,e+8)},e.prototype.moveToSiblingIndex=function(e){return f(this.batchDataUint8,e+8)},e.prototype.removedAttributeName=function(e){var t=f(this.batchDataUint8,e+12);return this.stringReader.readString(t)},e}(),s=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.frameType=function(e){return f(this.batchDataUint8,e)},e.prototype.subtreeLength=function(e){return f(this.batchDataUint8,e+4)},e.prototype.elementReferenceCaptureId=function(e){var t=f(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.componentId=function(e){return f(this.batchDataUint8,e+8)},e.prototype.elementName=function(e){var t=f(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.textContent=function(e){var t=f(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.markupContent=function(e){var t=f(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeName=function(e){var t=f(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeValue=function(e){var t=f(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.attributeEventHandlerId=function(e){return f(this.batchDataUint8,e+12)},e}(),c=function(){function e(e){this.batchDataUint8=e,this.stringTableStartIndex=f(e,e.length-4)}return e.prototype.readString=function(e){if(-1===e)return null;var t,n=f(this.batchDataUint8,this.stringTableStartIndex+4*e),o=function(e,t){for(var n=0,r=0,o=0;o<4;o++){var i=e[t+o];if(n|=(127&i)<65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u)}r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22),o=function(){function e(){}return e.prototype.log=function(e,t){},e.instance=new e,e}();t.NullLogger=o;var i=function(){function e(e){this.minimumLogLevel=e}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.LogLevel.Critical:case r.LogLevel.Error:console.error("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Warning:console.warn("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Information:console.info("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;default:console.log("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t)}},e}();t.ConsoleLogger=i},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0});var s=n(19),c=n(76),u=function(){function e(e,t){this.circuitId=e,this.components=t}return e.prototype.reconnect=function(e){return e.invoke("ConnectCircuit",this.circuitId)},e}();function l(e){if(e.nodeType===Node.COMMENT_NODE&&e.textContent){var t=/\W+M.A.C.Component:[^{]*(.*)$/.exec(e.textContent),n=t&&t[1];if(n)try{var r=JSON.parse(n),o=r.componentId,i=r.rendererId,a=r.circuitId;if(void 0!==o&&void 0!==i&&!!a)return{node:e,circuitId:a,rendererId:i,componentId:o};throw new Error("Found malformed start component comment at "+e.textContent)}catch(t){throw new Error("Found malformed start component comment at "+e.textContent)}}}function f(e,t,n,r){for(var o=n;o>=7)>0&&(r|=128),n.push(r)}while(t>0);t=e.byteLength||e.length;var o=new Uint8Array(n.length+t);return o.set(n,0),o.set(e,n.length),o.buffer},e.parse=function(e){for(var t=[],n=new Uint8Array(e),r=[0,7,14,21,28],o=0;o7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=o+i+a))throw new Error("Incomplete message.");t.push(n.slice?n.slice(o+i,o+i+a):n.subarray(o+i,o+i+a)),o=o+i+a}return t},e}();var s=new Uint8Array([145,i.MessageType.Ping]),c=function(){function e(){this.name="messagepack",this.version=1,this.transferFormat=i.TransferFormat.Binary,this.errorResult=1,this.voidResult=2,this.nonVoidResult=3}return e.prototype.parseMessages=function(e,t){if(!(e instanceof r.Buffer||(n=e,n&&"undefined"!=typeof ArrayBuffer&&(n instanceof ArrayBuffer||n.constructor&&"ArrayBuffer"===n.constructor.name))))throw new Error("Invalid input for MessagePack hub protocol. Expected an ArrayBuffer or Buffer.");var n;null===t&&(t=i.NullLogger.instance);for(var o=[],s=0,c=a.parse(e);s=0;u--)if(l[u]!==f[u])return!1;for(u=l.length-1;u>=0;u--)if(c=l[u],!b(e[c],t[c],n,r))return!1;return!0}(e,t,n,a))}return n?e===t:e==t}function m(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&y(o,n,"Missing expected exception"+r);var a="string"==typeof r,s=!e&&o&&!n;if((!e&&i.isError(o)&&a&&w(o,n)||s)&&y(o,n,"Got unwanted exception"+r),e&&o&&n&&!w(o,n)||!e&&o)throw o}f.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=d(g((t=this).actual),128)+" "+t.operator+" "+d(g(t.expected),128),this.generatedMessage=!0);var n=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var r=new Error;if(r.stack){var o=r.stack,i=p(n),a=o.indexOf("\n"+i);if(a>=0){var s=o.indexOf("\n",a+1);o=o.substring(s+1)}this.stack=o}}},i.inherits(f.AssertionError,Error),f.fail=y,f.ok=v,f.equal=function(e,t,n){e!=t&&y(e,t,n,"==",f.equal)},f.notEqual=function(e,t,n){e==t&&y(e,t,n,"!=",f.notEqual)},f.deepEqual=function(e,t,n){b(e,t,!1)||y(e,t,n,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,n){b(e,t,!0)||y(e,t,n,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,n){b(e,t,!1)&&y(e,t,n,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,n,r){b(t,n,!0)&&y(t,n,r,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,n){e!==t&&y(e,t,n,"===",f.strictEqual)},f.notStrictEqual=function(e,t,n){e===t&&y(e,t,n,"!==",f.notStrictEqual)},f.throws=function(e,t,n){E(!0,e,t,n)},f.doesNotThrow=function(e,t,n){E(!1,e,t,n)},f.ifError=function(e){if(e)throw e};var S=Object.keys||function(e){var t=[];for(var n in e)a.call(e,n)&&t.push(n);return t}}).call(this,n(8))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){e.exports=n(9)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t){},function(e,t,n){"use strict";var r=n(13).Buffer,o=n(59);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=i,o=s,t.copy(n,o),s+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){var r=n(5),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),i(o,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(62),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(8))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,c=1,u={},l=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){d(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n0?this._transform(null,t,n):n()},e.exports.decoder=c,e.exports.encoder=s},function(e,t,n){(t=e.exports=n(34)).Stream=t,t.Readable=t,t.Writable=n(39),t.Duplex=n(9),t.Transform=n(40),t.PassThrough=n(66)},function(e,t,n){"use strict";e.exports=i;var r=n(40),o=n(18);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(14),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){var r=n(20);function o(e){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=e||"unable to decode"}n(33).inherits(o,Error),e.exports=function(e){return function(e){e instanceof r||(e=r().append(e));var t=i(e);if(t)return e.consume(t.bytesConsumed),t.value;throw new o};function t(e,t,n){return t>=n+e}function n(e,t){return{value:e,bytesConsumed:t}}function i(e,r){r=void 0===r?0:r;var o=e.length-r;if(o<=0)return null;var i,l,f,h=e.readUInt8(r),p=0;if(!function(e,t){var n=function(e){switch(e){case 196:return 2;case 197:return 3;case 198:return 5;case 199:return 3;case 200:return 4;case 201:return 6;case 202:return 5;case 203:return 9;case 204:return 2;case 205:return 3;case 206:return 5;case 207:return 9;case 208:return 2;case 209:return 3;case 210:return 5;case 211:return 9;case 212:return 3;case 213:return 4;case 214:return 6;case 215:return 10;case 216:return 18;case 217:return 2;case 218:return 3;case 219:return 5;case 222:return 3;default:return-1}}(e);return!(-1!==n&&t=0;f--)p+=e.readUInt8(r+f+1)*Math.pow(2,8*(7-f));return n(p,9);case 208:return n(p=e.readInt8(r+1),2);case 209:return n(p=e.readInt16BE(r+1),3);case 210:return n(p=e.readInt32BE(r+1),5);case 211:return n(p=function(e,t){var n=128==(128&e[t]);if(n)for(var r=1,o=t+7;o>=t;o--){var i=(255^e[o])+r;e[o]=255&i,r=i>>8}var a=e.readUInt32BE(t+0),s=e.readUInt32BE(t+4);return(4294967296*a+s)*(n?-1:1)}(e.slice(r+1,r+9),0),9);case 202:return n(p=e.readFloatBE(r+1),5);case 203:return n(p=e.readDoubleBE(r+1),9);case 217:return t(i=e.readUInt8(r+1),o,2)?n(p=e.toString("utf8",r+2,r+2+i),2+i):null;case 218:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.toString("utf8",r+3,r+3+i),3+i):null;case 219:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.toString("utf8",r+5,r+5+i),5+i):null;case 196:return t(i=e.readUInt8(r+1),o,2)?n(p=e.slice(r+2,r+2+i),2+i):null;case 197:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.slice(r+3,r+3+i),3+i):null;case 198:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.slice(r+5,r+5+i),5+i):null;case 220:return o<3?null:(i=e.readUInt16BE(r+1),a(e,r,i,3));case 221:return o<5?null:(i=e.readUInt32BE(r+1),a(e,r,i,5));case 222:return i=e.readUInt16BE(r+1),s(e,r,i,3);case 223:throw new Error("map too big to decode in JS");case 212:return c(e,r,1);case 213:return c(e,r,2);case 214:return c(e,r,4);case 215:return c(e,r,8);case 216:return c(e,r,16);case 199:return i=e.readUInt8(r+1),l=e.readUInt8(r+2),t(i,o,3)?u(e,r,l,i,3):null;case 200:return i=e.readUInt16BE(r+1),l=e.readUInt8(r+3),t(i,o,4)?u(e,r,l,i,4):null;case 201:return i=e.readUInt32BE(r+1),l=e.readUInt8(r+5),t(i,o,6)?u(e,r,l,i,6):null}if(144==(240&h))return a(e,r,i=15&h,1);if(128==(240&h))return s(e,r,i=15&h,1);if(160==(224&h))return t(i=31&h,o,1)?n(p=e.toString("utf8",r+1,r+i+1),i+1):null;if(h>=224)return n(p=h-256,1);if(h<128)return n(h,1);throw new Error("not implemented yet")}function a(e,t,r,o){var a,s=[],c=0;for(t+=o,a=0;ai)&&((n=r.allocUnsafe(9))[0]=203,n.writeDoubleBE(e,1)),n}e.exports=function(e,t,n,i){function s(c,u){var l,f,h;if(void 0===c)throw new Error("undefined is not encodable in msgpack!");if(null===c)(l=r.allocUnsafe(1))[0]=192;else if(!0===c)(l=r.allocUnsafe(1))[0]=195;else if(!1===c)(l=r.allocUnsafe(1))[0]=194;else if("string"==typeof c)(f=r.byteLength(c))<32?((l=r.allocUnsafe(1+f))[0]=160|f,f>0&&l.write(c,1)):f<=255&&!n?((l=r.allocUnsafe(2+f))[0]=217,l[1]=f,l.write(c,2)):f<=65535?((l=r.allocUnsafe(3+f))[0]=218,l.writeUInt16BE(f,1),l.write(c,3)):((l=r.allocUnsafe(5+f))[0]=219,l.writeUInt32BE(f,1),l.write(c,5));else if(c&&(c.readUInt32LE||c instanceof Uint8Array))c instanceof Uint8Array&&(c=r.from(c)),c.length<=255?((l=r.allocUnsafe(2))[0]=196,l[1]=c.length):c.length<=65535?((l=r.allocUnsafe(3))[0]=197,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=198,l.writeUInt32BE(c.length,1)),l=o([l,c]);else if(Array.isArray(c))c.length<16?(l=r.allocUnsafe(1))[0]=144|c.length:c.length<65536?((l=r.allocUnsafe(3))[0]=220,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=221,l.writeUInt32BE(c.length,1)),l=c.reduce(function(e,t){return e.append(s(t,!0)),e},o().append(l));else{if(!i&&"function"==typeof c.getDate)return function(e){var t,n=1*e,i=Math.floor(n/1e3),a=1e6*(n-1e3*i);if(a||i>4294967295){(t=new r(10))[0]=215,t[1]=-1;var s=4*a,c=i/Math.pow(2,32),u=s+c&4294967295,l=4294967295&i;t.writeInt32BE(u,2),t.writeInt32BE(l,6)}else(t=new r(6))[0]=214,t[1]=-1,t.writeUInt32BE(Math.floor(n/1e3),2);return o().append(t)}(c);if("object"==typeof c)l=function(t){var n,i,a=-1,s=[];for(n=0;n>8),s.push(255&a)):(s.push(201),s.push(a>>24),s.push(a>>16&255),s.push(a>>8&255),s.push(255&a));return o().append(r.from(s)).append(i)}(c)||function(e){var t,n,i=[],a=0;for(t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&"function"!=typeof e[t]&&(++a,i.push(s(t,!0)),i.push(s(e[t],!0)));a<16?(n=r.allocUnsafe(1))[0]=128|a:((n=r.allocUnsafe(3))[0]=222,n.writeUInt16BE(a,1));return i.unshift(n),i.reduce(function(e,t){return e.append(t)},o())}(c);else if("number"==typeof c){if((h=c)!==Math.floor(h))return a(c,t);if(c>=0)if(c<128)(l=r.allocUnsafe(1))[0]=c;else if(c<256)(l=r.allocUnsafe(2))[0]=204,l[1]=c;else if(c<65536)(l=r.allocUnsafe(3))[0]=205,l.writeUInt16BE(c,1);else if(c<=4294967295)(l=r.allocUnsafe(5))[0]=206,l.writeUInt32BE(c,1);else{if(!(c<=9007199254740991))return a(c,!0);(l=r.allocUnsafe(9))[0]=207,function(e,t){for(var n=7;n>=0;n--)e[n+1]=255&t,t/=256}(l,c)}else if(c>=-32)(l=r.allocUnsafe(1))[0]=256+c;else if(c>=-128)(l=r.allocUnsafe(2))[0]=208,l.writeInt8(c,1);else if(c>=-32768)(l=r.allocUnsafe(3))[0]=209,l.writeInt16BE(c,1);else if(c>-214748365)(l=r.allocUnsafe(5))[0]=210,l.writeInt32BE(c,1);else{if(!(c>=-9007199254740991))return a(c,!0);(l=r.allocUnsafe(9))[0]=211,function(e,t,n){var r=n<0;r&&(n=Math.abs(n));var o=n%4294967296,i=n/4294967296;if(e.writeUInt32BE(Math.floor(i),t+0),e.writeUInt32BE(o,t+4),r)for(var a=1,s=t+7;s>=t;s--){var c=(255^e[s])+a;e[s]=255&c,a=c>>8}}(l,1,c)}}}if(!l)throw new Error("not implemented yet");return u?l:l.slice()}return s}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.dialog=e}return e.prototype.show=function(){this.removeClasses(),this.dialog.classList.add(e.ShowClassName)},e.prototype.hide=function(){this.removeClasses(),this.dialog.classList.add(e.HideClassName)},e.prototype.failed=function(){this.removeClasses(),this.dialog.classList.add(e.FailedClassName)},e.prototype.removeClasses=function(){this.dialog.classList.remove(e.ShowClassName,e.HideClassName,e.FailedClassName)},e.ShowClassName="components-reconnect-show",e.HideClassName="components-reconnect-hide",e.FailedClassName="components-reconnect-failed",e}();t.UserSpecifiedDisplay=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(41),o=function(){function e(e){this.document=e,this.addedToDom=!1,this.modal=this.document.createElement("div"),this.modal.id=r.AutoReconnectCircuitHandler.DialogId;this.modal.style.cssText=["position: fixed","top: 0","right: 0","bottom: 0","left: 0","z-index: 1000","display: none","overflow: hidden","background-color: #fff","opacity: 0.8","text-align: center","font-weight: bold"].join(";"),this.modal.innerHTML='
',this.message=this.modal.querySelector("h5"),this.button=this.modal.querySelector("button"),this.button.addEventListener("click",function(){return window.Blazor.reconnect()})}return e.prototype.show=function(){this.addedToDom||(this.addedToDom=!0,this.document.body.appendChild(this.modal)),this.modal.style.display="block",this.button.style.display="none",this.message.textContent="Attempting to reconnect to the server..."},e.prototype.hide=function(){this.modal.style.display="none"},e.prototype.failed=function(){this.button.style.display="block",this.message.textContent="Failed to reconnect to the server."},e}();t.DefaultReconnectDisplay=o},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]this.nextBatchId)this.logger.log(s.LogLevel.Debug,"Waiting for batch "+this.nextBatchId+". Batch "+e+" not processed.");else try{this.nextBatchId++,this.logger.log(s.LogLevel.Debug,"Applying batch "+e+"."),i.renderBatch(this.browserRendererId,new a.OutOfProcessRenderBatch(t)),this.completeBatch(n,e)}catch(t){throw this.logger.log(s.LogLevel.Error,"There was an error applying batch "+e+"."),n.send("OnRenderCompleted",e,t.toString()),t}},e.prototype.getLastBatchid=function(){return this.nextBatchId-1},e.prototype.completeBatch=function(e,t){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.send("OnRenderCompleted",t,null)];case 1:return n.sent(),[3,3];case 2:return n.sent(),this.logger.log(s.LogLevel.Warning,"Failed to deliver completion notification for render '"+t+"'."),[3,3];case 3:return[2]}})})},e.renderQueues=new Map,e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(73),o=function(){function e(e){this.batchData=e;var t=new c(e);this.arrayRangeReader=new u(e),this.arrayBuilderSegmentReader=new l(e),this.diffReader=new i(e),this.editReader=new a(e,t),this.frameReader=new s(e,t)}return e.prototype.updatedComponents=function(){return f(this.batchData,this.batchData.length-20)},e.prototype.referenceFrames=function(){return f(this.batchData,this.batchData.length-16)},e.prototype.disposedComponentIds=function(){return f(this.batchData,this.batchData.length-12)},e.prototype.disposedEventHandlerIds=function(){return f(this.batchData,this.batchData.length-8)},e.prototype.updatedComponentsEntry=function(e,t){var n=e+4*t;return f(this.batchData,n)},e.prototype.referenceFramesEntry=function(e,t){return e+16*t},e.prototype.disposedComponentIdsEntry=function(e,t){var n=e+4*t;return f(this.batchData,n)},e.prototype.disposedEventHandlerIdsEntry=function(e,t){var n=e+4*t;return f(this.batchData,n)},e}();t.OutOfProcessRenderBatch=o;var i=function(){function e(e){this.batchDataUint8=e}return e.prototype.componentId=function(e){return f(this.batchDataUint8,e)},e.prototype.edits=function(e){return e+4},e.prototype.editsEntry=function(e,t){return e+16*t},e}(),a=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.editType=function(e){return f(this.batchDataUint8,e)},e.prototype.siblingIndex=function(e){return f(this.batchDataUint8,e+4)},e.prototype.newTreeIndex=function(e){return f(this.batchDataUint8,e+8)},e.prototype.moveToSiblingIndex=function(e){return f(this.batchDataUint8,e+8)},e.prototype.removedAttributeName=function(e){var t=f(this.batchDataUint8,e+12);return this.stringReader.readString(t)},e}(),s=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.frameType=function(e){return f(this.batchDataUint8,e)},e.prototype.subtreeLength=function(e){return f(this.batchDataUint8,e+4)},e.prototype.elementReferenceCaptureId=function(e){var t=f(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.componentId=function(e){return f(this.batchDataUint8,e+8)},e.prototype.elementName=function(e){var t=f(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.textContent=function(e){var t=f(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.markupContent=function(e){var t=f(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeName=function(e){var t=f(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeValue=function(e){var t=f(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.attributeEventHandlerId=function(e){return f(this.batchDataUint8,e+12)},e}(),c=function(){function e(e){this.batchDataUint8=e,this.stringTableStartIndex=f(e,e.length-4)}return e.prototype.readString=function(e){if(-1===e)return null;var t,n=f(this.batchDataUint8,this.stringTableStartIndex+4*e),o=function(e,t){for(var n=0,r=0,o=0;o<4;o++){var i=e[t+o];if(n|=(127&i)<65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u)}r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22),o=function(){function e(){}return e.prototype.log=function(e,t){},e.instance=new e,e}();t.NullLogger=o;var i=function(){function e(e){this.minimumLogLevel=e}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.LogLevel.Critical:case r.LogLevel.Error:console.error("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Warning:console.warn("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Information:console.info("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;default:console.log("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t)}},e}();t.ConsoleLogger=i},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0});var s=n(19),c=n(76),u=function(){function e(e,t){this.circuitId=e,this.components=t}return e.prototype.reconnect=function(e){return e.invoke("ConnectCircuit",this.circuitId)},e}();function l(e){if(e.nodeType===Node.COMMENT_NODE&&e.textContent){var t=/\W+M.A.C.Component:[^{]*(.*)$/.exec(e.textContent),n=t&&t[1];if(n){try{var r=JSON.parse(n),o=r.componentId,i=r.rendererId,a=r.circuitId;if(void 0!==o&&void 0!==i&&!!a)return{node:e,circuitId:a,rendererId:i,componentId:o}}catch(e){}throw new Error("Found malformed start component comment at "+e.textContent)}}}function f(e,t,n,r){for(var o=n;o>=7)>0&&(r|=128),n.push(r)}while(t>0);t=e.byteLength||e.length;var o=new Uint8Array(n.length+t);return o.set(n,0),o.set(e,n.length),o.buffer},e.parse=function(e){for(var t=[],n=new Uint8Array(e),r=[0,7,14,21,28],o=0;o7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=o+i+a))throw new Error("Incomplete message.");t.push(n.slice?n.slice(o+i,o+i+a):n.subarray(o+i,o+i+a)),o=o+i+a}return t},e}();var s=new Uint8Array([145,i.MessageType.Ping]),c=function(){function e(){this.name="messagepack",this.version=1,this.transferFormat=i.TransferFormat.Binary,this.errorResult=1,this.voidResult=2,this.nonVoidResult=3}return e.prototype.parseMessages=function(e,t){if(!(e instanceof r.Buffer||(n=e,n&&"undefined"!=typeof ArrayBuffer&&(n instanceof ArrayBuffer||n.constructor&&"ArrayBuffer"===n.constructor.name))))throw new Error("Invalid input for MessagePack hub protocol. Expected an ArrayBuffer or Buffer.");var n;null===t&&(t=i.NullLogger.instance);for(var o=[],s=0,c=a.parse(e);s { @@ -14,7 +13,7 @@ describe('CircuitManager', () => {
Preamble
- +

Prerendered content

@@ -40,11 +39,11 @@ describe('CircuitManager', () => {
Preamble
- +

Prerendered content

- +

Prerendered content

@@ -66,7 +65,31 @@ describe('CircuitManager', () => { expect(second.componentId).toEqual(2); }); - it('discoverPrerenderedCircuits throws for malformed circuits', () => { + it('discoverPrerenderedCircuits throws for malformed circuits - improper nesting', () => { + const dom = new JSDOM(` + + + Page + + +
Preamble
+ +

Prerendered content

+ +
+ +

Prerendered content

+ +
+ + `); + + expect(() => discoverPrerenderedCircuits(dom.window.document)) + .toThrow(); + }); + + + it('discoverPrerenderedCircuits throws for malformed circuits - mixed string and int', () => { const dom = new JSDOM(` @@ -76,11 +99,11 @@ describe('CircuitManager', () => {
Preamble

Prerendered content

- -