Skip to content

Blazor API Review: Misc M.A.Components.Server #12221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rynowak opened this issue Jul 16, 2019 · 2 comments
Closed

Blazor API Review: Misc M.A.Components.Server #12221

rynowak opened this issue Jul 16, 2019 · 2 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components Done This issue has been fixed

Comments

@rynowak
Copy link
Member

rynowak commented Jul 16, 2019

Summary

These are miscellaneous types from the M.A.Components.Server assembly that aren't used in startup code.

Circuits

namespace Microsoft.AspNetCore.Components.Server.Circuits
{
    public sealed partial class Circuit
    {
        internal Circuit() { }
        public string Id { get { throw null; } }
    }
    public abstract partial class CircuitHandler
    {
        protected CircuitHandler() { }
        public virtual int Order { get { throw null; } }
        public virtual System.Threading.Tasks.Task OnCircuitClosedAsync(Microsoft.AspNetCore.Components.Server.Circuits.Circuit circuit, System.Threading.CancellationToken cancellationToken) { throw null; }
        public virtual System.Threading.Tasks.Task OnCircuitOpenedAsync(Microsoft.AspNetCore.Components.Server.Circuits.Circuit circuit, System.Threading.CancellationToken cancellationToken) { throw null; }
        public virtual System.Threading.Tasks.Task OnConnectionDownAsync(Microsoft.AspNetCore.Components.Server.Circuits.Circuit circuit, System.Threading.CancellationToken cancellationToken) { throw null; }
        public virtual System.Threading.Tasks.Task OnConnectionUpAsync(Microsoft.AspNetCore.Components.Server.Circuits.Circuit circuit, System.Threading.CancellationToken cancellationToken) { throw null; }
    }
}

LOL

namespace Microsoft.AspNetCore.Components.Server
{
    public static partial class WasmMediaTypeNames
    {
        public static partial class Application
        {
            public const string Wasm = "application/wasm";
        }
    }
}

Prerendering

namespace Microsoft.AspNetCore.Components.Server
{
    public partial class ComponentPrerenderingContext
    {
        public ComponentPrerenderingContext() { }
        public System.Type ComponentType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
        public Microsoft.AspNetCore.Http.HttpContext Context { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
        public Microsoft.AspNetCore.Components.ParameterCollection Parameters { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
    }
    public sealed partial class ComponentPrerenderResult
    {
        internal ComponentPrerenderResult() { }
        public void WriteTo(System.IO.TextWriter writer) { }
    }
    public partial interface IComponentPrerenderer
    {
        System.Threading.Tasks.Task<Microsoft.AspNetCore.Components.Server.ComponentPrerenderResult> PrerenderComponentAsync(Microsoft.AspNetCore.Components.Server.ComponentPrerenderingContext context);
    }
}
namespace Microsoft.AspNetCore.Components.Server.Circuits
{
    public partial class RemoteUriHelper : Microsoft.AspNetCore.Components.UriHelperBase
    {
        public RemoteUriHelper(Microsoft.Extensions.Logging.ILogger<Microsoft.AspNetCore.Components.Server.Circuits.RemoteUriHelper> logger) { }
        public bool HasAttachedJSRuntime { get { throw null; } }
        public override void InitializeState(string uriAbsolute, string baseUriAbsolute) { }
        protected override void NavigateToCore(string uri, bool forceLoad) { }
        [Microsoft.JSInterop.JSInvokableAttribute("NotifyLocationChanged")]
        public static void NotifyLocationChanged(string uriAbsolute, bool isInterceptedLink) { }
    }
}
namespace Microsoft.AspNetCore.Components.Web.Rendering
{
    public partial class RemoteRendererException : System.Exception
    {
        public RemoteRendererException(string message) { }
    }
}
@rynowak
Copy link
Member Author

rynowak commented Jul 16, 2019

Circuits

I think this is working for us. The idea is that if we need to expose functionality to CiruitHandler then we'll add those methods on Circuit. I don't see anything to change here.

LOL

  • Make WasmMediaTypeNames internal.

Prerendering

  • Move RemoteRendererException to M.A.Components.Server
  • Why does RemoteUriHelper need to be public? This doesn't seem good.
  • Find out why we need the HttpContext in ComponentPrerenderingContext (good reasons)

I don't feel like any of these APIs are elegant and cool, but the usage here is really for infrastructure (between MVC and components). I don't feel a need to polish these to a mirror sheen because they will scale well.

I think the argument could be made here to move these to a separate namespace. If you count RRE then that's 4 types that would live there.

@rynowak rynowak added API Review area-blazor Includes: Blazor, Razor Components labels Jul 16, 2019
@rynowak rynowak self-assigned this Jul 16, 2019
@rynowak rynowak added this to the 3.0.0-preview8 milestone Jul 16, 2019
@danroth27 danroth27 mentioned this issue Jul 16, 2019
20 tasks
rynowak pushed a commit that referenced this issue Jul 18, 2019
Part of: #12221

This was part of a previous PR, but I accidentally removed it during a
rebase :(
Server/ref/Microsoft.AspNetCore.Components.Server.netcoreapp3.0.cs
@rynowak
Copy link
Member Author

rynowak commented Jul 18, 2019

Closing this. I'll address the RemoteUriHelper thing as part of UriHelper API review.

@rynowak rynowak closed this as completed Jul 18, 2019
@rynowak rynowak added the Done This issue has been fixed label Jul 18, 2019
rynowak pushed a commit that referenced this issue Jul 18, 2019
Part of: #12221

This was part of a previous PR, but I accidentally removed it during a
rebase :(
Server/ref/Microsoft.AspNetCore.Components.Server.netcoreapp3.0.cs
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components Done This issue has been fixed
Projects
None yet
Development

No branches or pull requests

1 participant