-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[Blazor] Startup APIs API review #49754
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
Comments
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
API Review Notes:
Here is our progress so far. In the next meeting will discuss a few more minor things like whether // Microsoft.AspNetCore.Components.Endpoints.dll
namespace Microsoft.AspNetCore.Components.Endpoints;
public interface IRazorComponentsBuilder
{
public IServiceCollection Services { get; }
}
public sealed class WebAssemblyComponentsEndpointOptions
{
public PathString PathPrefix { get; set; }
}
namespace Microsoft.AspNetCore.Builder;
public class RazorComponentEndpointConventionBuilder : IEndpointConventionBuilder
{
// internal ctor
public ComponentApplicationBuilder ApplicationBuilder { get; }
public RazorComponentEndpointConventionBuilder AddWebAssemblyRenderMode();
public RazorComponentEndpointConventionBuilder AddServerRenderMode();
public void Add(Action<EndpointBuilder> convention);
public void Finally(Action<EndpointBuilder> finallyConvention);
}
namespace Microsoft.Extensions.DependencyInjection;
public static class RazorComponentsServiceCollectionExtensions
{
public static IRazorComponentsBuilder AddRazorComponents(this IServiceCollection services, Action<RazorComponentOptions>? configure = null);
}
public class RazorComponentOptions
{
public int MaxFormMappingCollectionSize { get; set; }
public int MaxFormMappingRecursionDepth { get; set; }
public int MaxFormMappingErrorCount { get; set; }
public int MaxFormMappingKeySize { get; set; }
}
// Microsoft.AspNetCore.Components.WebAssembly.Server.dll
namespace Microsoft.Extensions.DependencyInjection;
public static class RazorComponentsBuilderExtensions
{
public static IRazorComponentsBuilder AddWebAssemblyComponents(this IRazorComponentsBuilder builder, Action<WebAssemblyComponentsEndpointOptions>? configure = null)
}
// Microsoft.AspNetCore.Components.Server.dll
namespace Microsoft.Extensions.DependencyInjection;
public static class RazorComponentsBuilderExtensions
{
public static IRazorComponentsBuilder AddServerComponents(this IRazorComponentsBuilder builder, Action<CircuitOptions>? configure = null);
} |
// Microsoft.AspNetCore.Components.Endpoints.dll
-namespace Microsoft.AspNetCore.Components.Endpoints;
+namespace Microsoft.Extensions.DependencyInjection;
public interface IRazorComponentsBuilder
{
public IServiceCollection Services { get; }
}
-namespace Microsoft.AspNetCore.Components.Endpoints;
+namespace Microsoft.AspNetCore.Components.WebAssembly.Server;
+public sealed class WebAssemblyComponentsEndpointsOptions
{
public PathString PathPrefix { get; set; }
}
// Move to `WebAssembly.Server` if possible
namespace Microsoft.AspNetCore.Builder;
+public sealed class RazorComponentsEndpointConventionBuilder : IEndpointConventionBuilder
{
// internal ctor
- public ComponentApplicationBuilder ApplicationBuilder { get; }
public RazorComponentsEndpointConventionBuilder AddWebAssemblyRenderMode();
public RazorComponentsEndpointConventionBuilder AddServerRenderMode();
public void Add(Action<EndpointBuilder> convention);
public void Finally(Action<EndpointBuilder> finallyConvention);
}
namespace Microsoft.Extensions.DependencyInjection;
public static class RazorComponentsServiceCollectionExtensions
{
- public static IRazorComponentsBuilder AddRazorComponents(this IServiceCollection services)
+ public static IRazorComponentsBuilder AddRazorComponents(this IServiceCollection services, Action<RazorComponentsOptions>? configure = null);
}
-namespace Microsoft.Extensions.DependencyInjection;
+namespace Microsoft.AspNetCore.Components.Endpoints;
+ public sealed class RazorComponentsOptions
{
public int MaxFormMappingCollectionSize { get; set; }
public int MaxFormMappingRecursionDepth { get; set; }
public int MaxFormMappingErrorCount { get; set; }
public int MaxFormMappingKeySize { get; set; }
- public bool FormMappingUseCurrentCulture { get; set; }
}
// Microsoft.AspNetCore.Components.WebAssembly.Server.dll
namespace Microsoft.Extensions.DependencyInjection;
+public static class WebAssemblyRazorComponentsBuilderExtensions
{
+ public static IRazorComponentsBuilder AddWebAssemblyComponents(this IRazorComponentsBuilder builder)
}
// Microsoft.AspNetCore.Components.Server.dll
namespace Microsoft.Extensions.DependencyInjection;
+public static class ServerRazorComponentsBuilderExtensions
{
public static IRazorComponentsBuilder AddServerComponents(this IRazorComponentsBuilder builder, Action<CircuitOptions>? configure = null);
} |
Post API Review fixup notes:
To be continued. |
Post API Review fixup notes (cont.):
|
Background and motivation
These set of APIs define how Razor Component Endpoints are configured in DI and how endpoints to server Razor Component Applications are defined.
Proposed APIs
Usage examples
Canonical scenarios
Server Side Rendered components
Server Side rendering + Interactive server components
Server Side rendering + Interactive webassembly components
Server Side rendering + Interactive server and webassembly components
Other advanced scenarios
Configuring global options
Configuring server component options
Risks
The text was updated successfully, but these errors were encountered: