From a5d9930802ec9be37ed0a99f1dc043696a8a6720 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Mon, 16 Apr 2018 10:31:10 -0700 Subject: [PATCH] API review changes (#2043) - Make SerializedHubMessage and SerializedMessage public - Made HubConnectionStore public - Move SendUtils and Utils to the internal folder - Make Microsoft.AspNetCore.Http.Connections.Common/Internal public. - Move InvocationRequest to internal folder --- .../NegotiateProtocolBenchmark.cs | 2 +- .../HttpConnection.cs | 1 - .../HttpConnectionOptions.cs | 1 - .../Internal/DefaultTransportFactory.cs | 1 - .../{ => Internal}/SendUtils.cs | 2 +- .../{ => Internal}/Utils.cs | 2 +- .../{Internal => }/AvailableTransport.cs | 2 +- .../{Internal => }/HttpTransports.cs | 2 +- .../{Internal => }/NegotiateProtocol.cs | 2 +- .../{Internal => }/NegotiationResponse.cs | 2 +- src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs | 1 + .../{ => Internal}/InvocationRequest.cs | 2 +- .../{Internal => }/HubConnectionStore.cs | 2 +- src/Microsoft.AspNetCore.SignalR.Core/Hub`T.cs | 2 ++ .../{ => Internal}/SignalRMarkerService.cs | 2 +- .../{ => Internal}/TypedClientBuilder.cs | 2 +- .../{ => Internal}/TypedHubClients.cs | 2 +- .../{Internal => }/SerializedHubMessage.cs | 2 +- .../{Internal => }/SerializedMessage.cs | 2 +- .../SignalRConnectionBuilderExtensions.cs | 1 + .../HttpConnectionTests.ConnectionLifecycle.cs | 2 +- test/Microsoft.AspNetCore.SignalR.Client.Tests/ResponseUtils.cs | 1 - 22 files changed, 19 insertions(+), 19 deletions(-) rename src/Microsoft.AspNetCore.Http.Connections.Client/{ => Internal}/SendUtils.cs (99%) rename src/Microsoft.AspNetCore.Http.Connections.Client/{ => Internal}/Utils.cs (94%) rename src/Microsoft.AspNetCore.Http.Connections.Common/{Internal => }/AvailableTransport.cs (86%) rename src/Microsoft.AspNetCore.Http.Connections.Common/{Internal => }/HttpTransports.cs (91%) rename src/Microsoft.AspNetCore.Http.Connections.Common/{Internal => }/NegotiateProtocol.cs (99%) rename src/Microsoft.AspNetCore.Http.Connections.Common/{Internal => }/NegotiationResponse.cs (86%) rename src/Microsoft.AspNetCore.SignalR.Client.Core/{ => Internal}/InvocationRequest.cs (99%) rename src/Microsoft.AspNetCore.SignalR.Core/{Internal => }/HubConnectionStore.cs (97%) rename src/Microsoft.AspNetCore.SignalR.Core/{ => Internal}/SignalRMarkerService.cs (81%) rename src/Microsoft.AspNetCore.SignalR.Core/{ => Internal}/TypedClientBuilder.cs (99%) rename src/Microsoft.AspNetCore.SignalR.Core/{ => Internal}/TypedHubClients.cs (97%) rename src/Microsoft.AspNetCore.SignalR.Core/{Internal => }/SerializedHubMessage.cs (98%) rename src/Microsoft.AspNetCore.SignalR.Core/{Internal => }/SerializedMessage.cs (91%) diff --git a/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/NegotiateProtocolBenchmark.cs b/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/NegotiateProtocolBenchmark.cs index 6718581ab9..2e4120e187 100644 --- a/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/NegotiateProtocolBenchmark.cs +++ b/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/NegotiateProtocolBenchmark.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using BenchmarkDotNet.Attributes; -using Microsoft.AspNetCore.Http.Connections.Internal; +using Microsoft.AspNetCore.Http.Connections; using Microsoft.AspNetCore.Internal; namespace Microsoft.AspNetCore.SignalR.Microbenchmarks diff --git a/src/Microsoft.AspNetCore.Http.Connections.Client/HttpConnection.cs b/src/Microsoft.AspNetCore.Http.Connections.Client/HttpConnection.cs index dce91f0aab..470159ffd9 100644 --- a/src/Microsoft.AspNetCore.Http.Connections.Client/HttpConnection.cs +++ b/src/Microsoft.AspNetCore.Http.Connections.Client/HttpConnection.cs @@ -13,7 +13,6 @@ using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Connections.Features; using Microsoft.AspNetCore.Http.Connections.Client.Internal; using Microsoft.AspNetCore.Http.Connections.Features; -using Microsoft.AspNetCore.Http.Connections.Internal; using Microsoft.AspNetCore.Http.Features; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; diff --git a/src/Microsoft.AspNetCore.Http.Connections.Client/HttpConnectionOptions.cs b/src/Microsoft.AspNetCore.Http.Connections.Client/HttpConnectionOptions.cs index 79cdd0ac4f..9bf7db2fb6 100644 --- a/src/Microsoft.AspNetCore.Http.Connections.Client/HttpConnectionOptions.cs +++ b/src/Microsoft.AspNetCore.Http.Connections.Client/HttpConnectionOptions.cs @@ -8,7 +8,6 @@ using System.Net.Http; using System.Net.WebSockets; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; -using Microsoft.AspNetCore.Http.Connections.Internal; namespace Microsoft.AspNetCore.Http.Connections.Client { diff --git a/src/Microsoft.AspNetCore.Http.Connections.Client/Internal/DefaultTransportFactory.cs b/src/Microsoft.AspNetCore.Http.Connections.Client/Internal/DefaultTransportFactory.cs index e781681b47..6332d276f5 100644 --- a/src/Microsoft.AspNetCore.Http.Connections.Client/Internal/DefaultTransportFactory.cs +++ b/src/Microsoft.AspNetCore.Http.Connections.Client/Internal/DefaultTransportFactory.cs @@ -5,7 +5,6 @@ using System; using System.Net.Http; using Microsoft.AspNetCore.Http.Connections.Client; using Microsoft.AspNetCore.Http.Connections.Client.Internal; -using Microsoft.AspNetCore.Http.Connections.Internal; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.Http.Connections.Client.Internal diff --git a/src/Microsoft.AspNetCore.Http.Connections.Client/SendUtils.cs b/src/Microsoft.AspNetCore.Http.Connections.Client/Internal/SendUtils.cs similarity index 99% rename from src/Microsoft.AspNetCore.Http.Connections.Client/SendUtils.cs rename to src/Microsoft.AspNetCore.Http.Connections.Client/Internal/SendUtils.cs index 6439355745..d3cff78214 100644 --- a/src/Microsoft.AspNetCore.Http.Connections.Client/SendUtils.cs +++ b/src/Microsoft.AspNetCore.Http.Connections.Client/Internal/SendUtils.cs @@ -11,7 +11,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Http.Connections.Client +namespace Microsoft.AspNetCore.Http.Connections.Client.Internal { internal static class SendUtils { diff --git a/src/Microsoft.AspNetCore.Http.Connections.Client/Utils.cs b/src/Microsoft.AspNetCore.Http.Connections.Client/Internal/Utils.cs similarity index 94% rename from src/Microsoft.AspNetCore.Http.Connections.Client/Utils.cs rename to src/Microsoft.AspNetCore.Http.Connections.Client/Internal/Utils.cs index 385ccf145e..f92f89a3a0 100644 --- a/src/Microsoft.AspNetCore.Http.Connections.Client/Utils.cs +++ b/src/Microsoft.AspNetCore.Http.Connections.Client/Internal/Utils.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.Http.Connections.Client +namespace Microsoft.AspNetCore.Http.Connections.Client.Internal { internal static class Utils { diff --git a/src/Microsoft.AspNetCore.Http.Connections.Common/Internal/AvailableTransport.cs b/src/Microsoft.AspNetCore.Http.Connections.Common/AvailableTransport.cs similarity index 86% rename from src/Microsoft.AspNetCore.Http.Connections.Common/Internal/AvailableTransport.cs rename to src/Microsoft.AspNetCore.Http.Connections.Common/AvailableTransport.cs index 62e68b0ca3..47b1435cae 100644 --- a/src/Microsoft.AspNetCore.Http.Connections.Common/Internal/AvailableTransport.cs +++ b/src/Microsoft.AspNetCore.Http.Connections.Common/AvailableTransport.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace Microsoft.AspNetCore.Http.Connections.Internal +namespace Microsoft.AspNetCore.Http.Connections { public class AvailableTransport { diff --git a/src/Microsoft.AspNetCore.Http.Connections.Common/Internal/HttpTransports.cs b/src/Microsoft.AspNetCore.Http.Connections.Common/HttpTransports.cs similarity index 91% rename from src/Microsoft.AspNetCore.Http.Connections.Common/Internal/HttpTransports.cs rename to src/Microsoft.AspNetCore.Http.Connections.Common/HttpTransports.cs index 193defd7ef..5743ea324d 100644 --- a/src/Microsoft.AspNetCore.Http.Connections.Common/Internal/HttpTransports.cs +++ b/src/Microsoft.AspNetCore.Http.Connections.Common/HttpTransports.cs @@ -1,7 +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. -namespace Microsoft.AspNetCore.Http.Connections.Internal +namespace Microsoft.AspNetCore.Http.Connections { public static class HttpTransports { diff --git a/src/Microsoft.AspNetCore.Http.Connections.Common/Internal/NegotiateProtocol.cs b/src/Microsoft.AspNetCore.Http.Connections.Common/NegotiateProtocol.cs similarity index 99% rename from src/Microsoft.AspNetCore.Http.Connections.Common/Internal/NegotiateProtocol.cs rename to src/Microsoft.AspNetCore.Http.Connections.Common/NegotiateProtocol.cs index 5822113ca5..f1cd03ac62 100644 --- a/src/Microsoft.AspNetCore.Http.Connections.Common/Internal/NegotiateProtocol.cs +++ b/src/Microsoft.AspNetCore.Http.Connections.Common/NegotiateProtocol.cs @@ -8,7 +8,7 @@ using System.IO; using Microsoft.AspNetCore.Internal; using Newtonsoft.Json; -namespace Microsoft.AspNetCore.Http.Connections.Internal +namespace Microsoft.AspNetCore.Http.Connections { public static class NegotiateProtocol { diff --git a/src/Microsoft.AspNetCore.Http.Connections.Common/Internal/NegotiationResponse.cs b/src/Microsoft.AspNetCore.Http.Connections.Common/NegotiationResponse.cs similarity index 86% rename from src/Microsoft.AspNetCore.Http.Connections.Common/Internal/NegotiationResponse.cs rename to src/Microsoft.AspNetCore.Http.Connections.Common/NegotiationResponse.cs index 528ea3cca0..2e59277f31 100644 --- a/src/Microsoft.AspNetCore.Http.Connections.Common/Internal/NegotiationResponse.cs +++ b/src/Microsoft.AspNetCore.Http.Connections.Common/NegotiationResponse.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace Microsoft.AspNetCore.Http.Connections.Internal +namespace Microsoft.AspNetCore.Http.Connections { public class NegotiationResponse { diff --git a/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs b/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs index 1752f58283..fd848ce440 100644 --- a/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs +++ b/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs @@ -13,6 +13,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Connections.Features; using Microsoft.AspNetCore.Internal; +using Microsoft.AspNetCore.SignalR.Client.Internal; using Microsoft.AspNetCore.SignalR.Internal; using Microsoft.AspNetCore.SignalR.Protocol; using Microsoft.Extensions.DependencyInjection; diff --git a/src/Microsoft.AspNetCore.SignalR.Client.Core/InvocationRequest.cs b/src/Microsoft.AspNetCore.SignalR.Client.Core/Internal/InvocationRequest.cs similarity index 99% rename from src/Microsoft.AspNetCore.SignalR.Client.Core/InvocationRequest.cs rename to src/Microsoft.AspNetCore.SignalR.Client.Core/Internal/InvocationRequest.cs index d8b2f56fa4..dc3c433663 100644 --- a/src/Microsoft.AspNetCore.SignalR.Client.Core/InvocationRequest.cs +++ b/src/Microsoft.AspNetCore.SignalR.Client.Core/Internal/InvocationRequest.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.SignalR.Protocol; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.SignalR.Client +namespace Microsoft.AspNetCore.SignalR.Client.Internal { internal abstract class InvocationRequest : IDisposable { diff --git a/src/Microsoft.AspNetCore.SignalR.Core/Internal/HubConnectionStore.cs b/src/Microsoft.AspNetCore.SignalR.Core/HubConnectionStore.cs similarity index 97% rename from src/Microsoft.AspNetCore.SignalR.Core/Internal/HubConnectionStore.cs rename to src/Microsoft.AspNetCore.SignalR.Core/HubConnectionStore.cs index 57d369b411..a94ccda601 100644 --- a/src/Microsoft.AspNetCore.SignalR.Core/Internal/HubConnectionStore.cs +++ b/src/Microsoft.AspNetCore.SignalR.Core/HubConnectionStore.cs @@ -6,7 +6,7 @@ using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; -namespace Microsoft.AspNetCore.SignalR.Internal +namespace Microsoft.AspNetCore.SignalR { public class HubConnectionStore { diff --git a/src/Microsoft.AspNetCore.SignalR.Core/Hub`T.cs b/src/Microsoft.AspNetCore.SignalR.Core/Hub`T.cs index 3424e77c53..8bce9b3507 100644 --- a/src/Microsoft.AspNetCore.SignalR.Core/Hub`T.cs +++ b/src/Microsoft.AspNetCore.SignalR.Core/Hub`T.cs @@ -1,6 +1,8 @@ // 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.SignalR.Internal; + namespace Microsoft.AspNetCore.SignalR { public class Hub : Hub where T : class diff --git a/src/Microsoft.AspNetCore.SignalR.Core/SignalRMarkerService.cs b/src/Microsoft.AspNetCore.SignalR.Core/Internal/SignalRMarkerService.cs similarity index 81% rename from src/Microsoft.AspNetCore.SignalR.Core/SignalRMarkerService.cs rename to src/Microsoft.AspNetCore.SignalR.Core/Internal/SignalRMarkerService.cs index 592296f03f..06720fe924 100644 --- a/src/Microsoft.AspNetCore.SignalR.Core/SignalRMarkerService.cs +++ b/src/Microsoft.AspNetCore.SignalR.Core/Internal/SignalRMarkerService.cs @@ -1,7 +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. -namespace Microsoft.Extensions.DependencyInjection +namespace Microsoft.AspNetCore.SignalR.Internal { internal class SignalRMarkerService { diff --git a/src/Microsoft.AspNetCore.SignalR.Core/TypedClientBuilder.cs b/src/Microsoft.AspNetCore.SignalR.Core/Internal/TypedClientBuilder.cs similarity index 99% rename from src/Microsoft.AspNetCore.SignalR.Core/TypedClientBuilder.cs rename to src/Microsoft.AspNetCore.SignalR.Core/Internal/TypedClientBuilder.cs index 7cc4352d4d..bcae8fec8c 100644 --- a/src/Microsoft.AspNetCore.SignalR.Core/TypedClientBuilder.cs +++ b/src/Microsoft.AspNetCore.SignalR.Core/Internal/TypedClientBuilder.cs @@ -9,7 +9,7 @@ using System.Reflection; using System.Reflection.Emit; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.SignalR +namespace Microsoft.AspNetCore.SignalR.Internal { internal static class TypedClientBuilder { diff --git a/src/Microsoft.AspNetCore.SignalR.Core/TypedHubClients.cs b/src/Microsoft.AspNetCore.SignalR.Core/Internal/TypedHubClients.cs similarity index 97% rename from src/Microsoft.AspNetCore.SignalR.Core/TypedHubClients.cs rename to src/Microsoft.AspNetCore.SignalR.Core/Internal/TypedHubClients.cs index 00ac573fbe..2906dc7f43 100644 --- a/src/Microsoft.AspNetCore.SignalR.Core/TypedHubClients.cs +++ b/src/Microsoft.AspNetCore.SignalR.Core/Internal/TypedHubClients.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace Microsoft.AspNetCore.SignalR +namespace Microsoft.AspNetCore.SignalR.Internal { internal class TypedHubClients : IHubCallerClients { diff --git a/src/Microsoft.AspNetCore.SignalR.Core/Internal/SerializedHubMessage.cs b/src/Microsoft.AspNetCore.SignalR.Core/SerializedHubMessage.cs similarity index 98% rename from src/Microsoft.AspNetCore.SignalR.Core/Internal/SerializedHubMessage.cs rename to src/Microsoft.AspNetCore.SignalR.Core/SerializedHubMessage.cs index 5b67cbf8b8..5b2d507528 100644 --- a/src/Microsoft.AspNetCore.SignalR.Core/Internal/SerializedHubMessage.cs +++ b/src/Microsoft.AspNetCore.SignalR.Core/SerializedHubMessage.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; using Microsoft.AspNetCore.SignalR.Protocol; -namespace Microsoft.AspNetCore.SignalR.Internal +namespace Microsoft.AspNetCore.SignalR { /// /// This class is designed to support the framework. The API is subject to breaking changes. diff --git a/src/Microsoft.AspNetCore.SignalR.Core/Internal/SerializedMessage.cs b/src/Microsoft.AspNetCore.SignalR.Core/SerializedMessage.cs similarity index 91% rename from src/Microsoft.AspNetCore.SignalR.Core/Internal/SerializedMessage.cs rename to src/Microsoft.AspNetCore.SignalR.Core/SerializedMessage.cs index e591944b06..cf13afcaa3 100644 --- a/src/Microsoft.AspNetCore.SignalR.Core/Internal/SerializedMessage.cs +++ b/src/Microsoft.AspNetCore.SignalR.Core/SerializedMessage.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.SignalR.Internal +namespace Microsoft.AspNetCore.SignalR { public readonly struct SerializedMessage { diff --git a/src/Microsoft.AspNetCore.SignalR.Core/SignalRConnectionBuilderExtensions.cs b/src/Microsoft.AspNetCore.SignalR.Core/SignalRConnectionBuilderExtensions.cs index f2701781a9..8645d2aeff 100644 --- a/src/Microsoft.AspNetCore.SignalR.Core/SignalRConnectionBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.SignalR.Core/SignalRConnectionBuilderExtensions.cs @@ -3,6 +3,7 @@ using System; using Microsoft.AspNetCore.Connections; +using Microsoft.AspNetCore.SignalR.Internal; using Microsoft.Extensions.DependencyInjection; namespace Microsoft.AspNetCore.SignalR diff --git a/test/Microsoft.AspNetCore.SignalR.Client.Tests/HttpConnectionTests.ConnectionLifecycle.cs b/test/Microsoft.AspNetCore.SignalR.Client.Tests/HttpConnectionTests.ConnectionLifecycle.cs index 08710a3228..a115236af8 100644 --- a/test/Microsoft.AspNetCore.SignalR.Client.Tests/HttpConnectionTests.ConnectionLifecycle.cs +++ b/test/Microsoft.AspNetCore.SignalR.Client.Tests/HttpConnectionTests.ConnectionLifecycle.cs @@ -7,9 +7,9 @@ using System.Net; using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Connections; +using Microsoft.AspNetCore.Http.Connections; using Microsoft.AspNetCore.Http.Connections.Client; using Microsoft.AspNetCore.Http.Connections.Client.Internal; -using Microsoft.AspNetCore.Http.Connections.Internal; using Microsoft.AspNetCore.SignalR.Tests; using Microsoft.Extensions.Logging.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.SignalR.Client.Tests/ResponseUtils.cs b/test/Microsoft.AspNetCore.SignalR.Client.Tests/ResponseUtils.cs index c23b216ac2..23ab6d73b5 100644 --- a/test/Microsoft.AspNetCore.SignalR.Client.Tests/ResponseUtils.cs +++ b/test/Microsoft.AspNetCore.SignalR.Client.Tests/ResponseUtils.cs @@ -7,7 +7,6 @@ using System.Net; using System.Net.Http; using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Http.Connections; -using Microsoft.AspNetCore.Http.Connections.Internal; using Newtonsoft.Json; namespace Microsoft.AspNetCore.SignalR.Client.Tests