chore(ErrorLogger): replace concrete ErrorLogger usages with the IErrorLogger#7495
Merged
chore(ErrorLogger): replace concrete ErrorLogger usages with the IErrorLogger#7495
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRenames usages of the ErrorLogger component to use the IErrorLogger interface in consumer components and updates the ErrorLogger initialization callback to expose the interface type, aligning field types and callback signatures with the interface without altering behavior. Class diagram for ErrorLogger to IErrorLogger usage updateclassDiagram
direction LR
class IErrorLogger {
<<interface>>
Register(handlerException)
}
class ErrorLogger {
+Func~IErrorLogger, Task~ OnInitializedCallback
}
class TabItemContent {
-IOptionsMonitor~BootstrapBlazorOptions~ Options
-IErrorLogger _logger
-RenderHandle _renderHandle
BuildRenderTree(builder)
}
class Layout {
-IErrorLogger _errorLogger
-Task OnErrorLoggerInitialized(logger)
}
ErrorLogger ..|> IErrorLogger
TabItemContent --> IErrorLogger : uses_field
TabItemContent --> ErrorLogger : uses_static_names
Layout --> IErrorLogger : uses_field
Layout --> IErrorLogger : init_callback_param
ErrorLogger --> IErrorLogger : OnInitializedCallback_type
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the codebase to use the IErrorLogger interface instead of the concrete ErrorLogger class for field declarations and callback signatures, promoting better abstraction and testability.
Changes:
- Updated private field types from
ErrorLogger?toIErrorLogger?in TabItemContent and Layout components - Updated callback function signatures from
Func<ErrorLogger, Task>toFunc<IErrorLogger, Task>in ErrorLogger component and its consumers
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/BootstrapBlazor/Components/Tab/TabItemContent.cs | Changed private logger field and callback parameter types to use IErrorLogger interface |
| src/BootstrapBlazor/Components/Layout/Layout.razor.cs | Changed private logger field and initialization method parameter to use IErrorLogger interface |
| src/BootstrapBlazor/Components/ErrorLogger/ErrorLogger.cs | Changed OnInitializedCallback parameter type to accept IErrorLogger instead of concrete ErrorLogger class |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link issues
fixes #7494
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Enhancements: