EventUtil: Propagate exceptions.#9967
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #9967 +/- ##
==========================================
+ Coverage 89.82% 90.77% +0.94%
==========================================
Files 412 407 -5
Lines 11878 12578 +700
Branches 2364 2454 +90
==========================================
+ Hits 10670 11418 +748
+ Misses 681 598 -83
- Partials 527 562 +35 ☔ View full report in Codecov by Sentry. |
|
We could also leave the old one in place, and then it wouldn't be a breaking change, but I feel like the original one is broken and it not what you would want most of the time and we should not encourage it's usage. |
|
Changed my mind, and decided to go for |
|
The last one that's still impacting me is the menu items. They're still triggering renders even with |
Interesting, maybe something else there triggering re-render? |
|
Are we removing |
That was my question in #9967 (comment) |
|
Added to v8.0.0 Migration Guide #9953 |
Description
Finall, fixes: #8437
See dotnet/aspnetcore#54543 for more details about the problem.
Now, instead of calling:
you should call it as:
Because it is now an extension method that requires a reference of
ComponentBase.Why is theIComponentExceptionnecessary?TheDispatchExceptionAsyncmethod ofComponentBaseis protected, meaning we cannot call it directly from outside ofComponentBase. While we could have madeAsNonRenderingEventHandlerspecific toMudComponentBaseand added our own internalDispatchExceptionAsync, I opted for the interface approach. This allows users to utilize it with their ownComponentBaseimplementations. Alternatively, we could have usedUnsafeAccessorand useComponentBasedirectly, eliminating the need for an interface. However, I chose the interface route is better.Changed my mind and decided to go for
ComponentBase+UnsafeAccessor, because of this: #9967 (comment).How Has This Been Tested?
Existing unit tests that I wrote back then.
Type of Changes
Checklist
dev).