Skip to content

Commit

Permalink
Make [StreamRendering] default to true
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveSandersonMS committed Aug 23, 2023
1 parent 902da87 commit d54e3b9
Show file tree
Hide file tree
Showing 21 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/Components/Components/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Microsoft.AspNetCore.Components.Sections.SectionOutlet.SectionOutlet() -> void
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddComponentParameter(int sequence, string! name, object? value) -> void
Microsoft.AspNetCore.Components.StreamRenderingAttribute
Microsoft.AspNetCore.Components.StreamRenderingAttribute.Enabled.get -> bool
Microsoft.AspNetCore.Components.StreamRenderingAttribute.StreamRenderingAttribute(bool enabled) -> void
Microsoft.AspNetCore.Components.StreamRenderingAttribute.StreamRenderingAttribute(bool enabled = true) -> void
Microsoft.AspNetCore.Components.SupplyParameterFromQueryProviderServiceCollectionExtensions
Microsoft.Extensions.DependencyInjection.CascadingValueServiceCollectionExtensions
override Microsoft.AspNetCore.Components.EventCallback.GetHashCode() -> int
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Components/src/StreamRenderingAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public class StreamRenderingAttribute : Attribute
/// <summary>
/// Constructs an instance of <see cref="StreamRenderingAttribute"/>
/// </summary>
/// <param name="enabled">A flag to indicate whether this component and its descendants should stream their rendering.</param>
public StreamRenderingAttribute(bool enabled)
/// <param name="enabled">A flag to indicate whether this component and its descendants should stream their rendering. The default value is true.</param>
public StreamRenderingAttribute(bool enabled = true)
{
Enabled = enabled;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
@if (loaded)
{
<text>Loaded</text>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
@ChildContent
@code {
[Parameter] public RenderFragment ChildContent { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
Loading task status: @LoadingTask.Status
@code {
[Parameter] public Task LoadingTask { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
@inject NavigationManager Nav
Some output
@code {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
Some output
@code {
protected override async Task OnInitializedAsync()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
[LoadingTask: @LoadingTask.Status]
<StreamingComponentChild SomeParameterToEnsureRerendering="@(new object())" />
@code {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
@ChildContent
@code {
[Parameter] public RenderFragment ChildContent { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/nav/scroll-to-hash"
@attribute [StreamRendering(true)]
@attribute [StreamRendering]

<PageTitle>Page for scrolling to hash</PageTitle>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/nav/do-redirection-while-streaming"
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
@inject NavigationManager Nav
<h1>Please wait...</h1>
@code {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/nav/throw-while-streaming"
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
<p>Please wait...</p>
@code {
protected override async Task OnInitializedAsync()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/forms/error-in-error-boundary-streaming"
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
@using Microsoft.AspNetCore.Components.Forms

<h3>Error in error boundary (streaming)</h3>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/forms/error-outside-error-boundary-streaming"
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
@using Microsoft.AspNetCore.Components.Forms

<h3>Error outside error boundary (streaming)</h3>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/forms/antiforgery-after-response-started"
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
@using Microsoft.AspNetCore.Components.Forms

<h2>Default form</h2>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/forms/modify-http-context/{OperationId}"
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
@inject AsyncOperationService AsyncOperation
@inject NavigationManager Navigation
@* This is not the recommended way to access the HttpContext in Blazor, this is just for test purposes *@
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@page "/forms/post-redirect-get-streaming"
@using Microsoft.AspNetCore.Components.Forms
@inject NavigationManager Nav
@attribute [StreamRendering(true)]
@attribute [StreamRendering]

<h3>Post/Redirect/Get</h3>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/forms/streaming-rendering/{OperationId}"
@attribute [StreamRendering(true)]
@attribute [StreamRendering]
@inject AsyncOperationService AsyncOperation
@inject NavigationManager Navigation;
@using Components.TestServer.Services;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/large-streaming"

@attribute [StreamRendering(true)]
@attribute [StreamRendering]

<h1>Streaming Rendering</h1>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/streaming"

@attribute [StreamRendering(true)]
@attribute [StreamRendering]

<h1>Streaming Rendering</h1>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/streaming-interactivity"

@attribute [StreamRendering(true)]
@attribute [StreamRendering]

<h1>Streaming Rendering with Interactivity</h1>

Expand Down

0 comments on commit d54e3b9

Please sign in to comment.