Skip to content

Commit e54bca3

Browse files
committed
Remove the hard stop - the whole batch has to finish its rendering.
1 parent bb7c393 commit e54bca3

File tree

4 files changed

+5
-28
lines changed

4 files changed

+5
-28
lines changed

src/Components/Components/src/PublicAPI.Unshipped.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ Microsoft.AspNetCore.Components.SupplyParameterFromPersistentComponentStateAttri
1414
Microsoft.AspNetCore.Components.SupplyParameterFromPersistentComponentStateAttribute.SupplyParameterFromPersistentComponentStateAttribute() -> void
1515
Microsoft.Extensions.DependencyInjection.SupplyParameterFromPersistentComponentStateProviderServiceCollectionExtensions
1616
static Microsoft.AspNetCore.Components.Infrastructure.RegisterPersistentComponentStateServiceCollectionExtensions.AddPersistentServiceRegistration<TService>(Microsoft.Extensions.DependencyInjection.IServiceCollection! services, Microsoft.AspNetCore.Components.IComponentRenderMode! componentRenderMode) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
17-
static Microsoft.Extensions.DependencyInjection.SupplyParameterFromPersistentComponentStateProviderServiceCollectionExtensions.AddSupplyValueFromPersistentComponentStateProvider(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
18-
virtual Microsoft.AspNetCore.Components.RenderTree.Renderer.SignalRendererToFinishRendering() -> void
17+
static Microsoft.Extensions.DependencyInjection.SupplyParameterFromPersistentComponentStateProviderServiceCollectionExtensions.AddSupplyValueFromPersistentComponentStateProvider(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!

src/Components/Components/src/RenderTree/Renderer.cs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public abstract partial class Renderer : IDisposable, IAsyncDisposable
4646
private bool _rendererIsDisposed;
4747

4848
private bool _hotReloadInitialized;
49-
private bool _rendererIsStopped;
5049

5150
/// <summary>
5251
/// Allows the caller to handle exceptions from the SynchronizationContext when one is available.
@@ -665,12 +664,6 @@ internal void AddToRenderQueue(int componentId, RenderFragment renderFragment)
665664
{
666665
Dispatcher.AssertAccess();
667666

668-
if (_rendererIsStopped)
669-
{
670-
// Once we're stopped, we'll disregard further attempts to queue anything
671-
return;
672-
}
673-
674667
var componentState = GetOptionalComponentState(componentId);
675668
if (componentState == null)
676669
{
@@ -737,22 +730,14 @@ private ComponentState GetRequiredRootComponentState(int componentId)
737730
return componentState;
738731
}
739732

740-
/// <summary>
741-
/// Stop adding render requests to the render queue.
742-
/// </summary>
743-
protected virtual void SignalRendererToFinishRendering()
744-
{
745-
_rendererIsStopped = true;
746-
}
747-
748733
/// <summary>
749734
/// Processes pending renders requests from components if there are any.
750735
/// </summary>
751736
protected virtual void ProcessPendingRender()
752737
{
753-
if (_rendererIsDisposed || _rendererIsStopped)
738+
if (_rendererIsDisposed)
754739
{
755-
// Once we're disposed or stopped, we'll disregard further attempts to render anything
740+
// Once we're disposed, we'll disregard further attempts to render anything
756741
return;
757742
}
758743

src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.EventDispatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private async Task SetNotFoundResponseAsync(string baseUri)
9797
// When the application triggers a NotFound event, we continue rendering the current batch.
9898
// However, after completing this batch, we do not want to process any further UI updates,
9999
// as we are going to return a 404 status and discard the UI updates generated so far.
100-
SignalRendererToFinishRenderingAfterCurrentBatch();
100+
SignalRendererToFinishRendering();
101101
}
102102

103103
private async Task OnNavigateTo(string uri)

src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,19 +183,12 @@ protected override void AddPendingTask(ComponentState? componentState, Task task
183183
base.AddPendingTask(componentState, task);
184184
}
185185

186-
private void SignalRendererToFinishRenderingAfterCurrentBatch()
186+
private void SignalRendererToFinishRendering()
187187
{
188188
// sets a deferred stop on the renderer, which will have an effect after the current batch is completed
189189
_rendererIsStopped = true;
190190
}
191191

192-
protected override void SignalRendererToFinishRendering()
193-
{
194-
SignalRendererToFinishRenderingAfterCurrentBatch();
195-
// sets a hard stop on the renderer, which will have an effect immediately
196-
base.SignalRendererToFinishRendering();
197-
}
198-
199192
protected override void ProcessPendingRender()
200193
{
201194
if (_rendererIsStopped)

0 commit comments

Comments
 (0)