-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Implement delayed execution in BaseAfterRenderComponent #4331
Conversation
Am I missing something, isn't this basically what we had previously? |
Almost, yes. ShouldDelayExecution is the only thing that separates it, but without it, it doesn't work as expected. At least I didn't find a way still. |
Are you sure you're not looking at the wrong commit again? The |
Haha ignore my last message. I didn't push all :D |
Other than that, I'm not sure how to reliabily reproduce the previous bugs, but everything seems to be working fine, so looks good. And Implemention got way cleaner. |
Now another question is.. Why would this not be on "globally" by default? For "being safe" purposes? |
What do you mean have it globally? You mean to always do that? |
Yes that. |
@David-Moreira PR description edited to include test code. Cleaned the lifecycle to not depend on |
PS. as long as we use |
So there's a chance we might miss use the components initialize? How would we break it then? |
I went and double-check. Even if we don't use THIS WILL NOT WORK protected override async Task OnAfterRenderAsync( bool firstRender )
{
await base.OnAfterRenderAsync( firstRender );
if ( firstRender )
{
// try initializing here
}
} THIS WILL WORK protected override async Task OnAfterRenderAsync( bool firstRender )
{
if ( firstRender )
{
// try initializing here
}
await base.OnAfterRenderAsync( firstRender );
} which makes sense 100%. So we're good to go. We can make it a good convention to use |
Did you commit everything, what's the weatherforecast controller for? |
LGTM |
Just a thing for us if we ever need to test components with connections to the api. In its own doesn't do much but I don't want to recreate it every time. Other than that we can consider having more use cases in the demo app where rest api is used. |
Test for #4075
This test can be run only on Blazorise.Demo.Bootstrap.Server because it only has the controller with the endpoint
weatherforecast/getforecast"
.Test for #4114