-
-
Notifications
You must be signed in to change notification settings - Fork 515
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
WIP: ComponentParameterInfo #4308
base: master
Are you sure you want to change the base?
Conversation
Yes, that is exactly the idea I had in mind. I did this quick prototype in half an hour to not forget it. But yeah, I think it is much cleaner to read and write than the three-value system glutio had. I agree with changing it to the struct type. But as always, it might be good to benchmark it and see if it changes anything. Do you want to do that part? |
Yea I can benchmark it. |
@stsrki are you going to change anything, try record / struct implementation? Or want me to do some benchmarking first? |
I will. Just that I had other stuff in the way. But you can try benchmarking if you want. |
# Conflicts: # Source/Blazorise/Components/Button/Button.cs
I have noticed on the Button component( and in other places, too ) that we have an invalid condition for the
Disabled
parameter.protected bool IsDisabled => ParentDropdown?.Disabled ?? Disabled;
the order should be reversed
protected bool IsDisabled => Disabled ?? ParentDropdown?.Disabled;
But the problem is that
Button.Disabled
parameter isbool
type, and if we change it tobool?
then it would break any component that tries to set it with a simplified syntax, eg.<Button Disabled>
And so I'm now experimenting with a new concept of receiving the parameters. That is the new
ComponentParameterInfo
type. It tells us if the parameter is being received through the Blazor pipeline. No need to have abool? Disabled
parameter.We can also have some other optimizations, like only calling
DirtyClasses()
if any of the wanted parameters is really received.At the moment, the code is relatively crude. I need to see if it makes sense at all.