Docs: Add Services page#11967
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces documentation pages for several MudBlazor services, including BrowserViewportService, ResizeObserver, ScrollManager, and ScrollListener. The changes involve adding new Razor components to demonstrate the usage of these services and updating the MenuService to include a link to the new 'Services' documentation page. I have identified a potential issue with the ResizeObserverExample.razor component where the OnResized event is not properly unsubscribed, which could lead to memory leaks. I have also identified an issue with the ScrollListener where the selector is set in the OnAfterRenderAsync method, which might cause issues if the component is re-rendered.
src/MudBlazor.Docs/Pages/Features/Services/Examples/ResizeObserverExample.razor
Outdated
Show resolved
Hide resolved
src/MudBlazor.Docs/Pages/Features/Services/Examples/ScrollListenerExample.razor
Outdated
Show resolved
Hide resolved
jperson2000
left a comment
There was a problem hiding this comment.
I think this is a great addition to the docs! I had just a few comments to consider.
src/MudBlazor.Docs/Pages/Features/Services/Examples/BrowserViewportServiceExample.razor
Outdated
Show resolved
Hide resolved
src/MudBlazor.Docs/Pages/Features/Services/Examples/BrowserViewportServiceExample.razor
Outdated
Show resolved
Hide resolved
src/MudBlazor.Docs/Pages/Features/Services/Examples/ResizeObserverExample.razor
Show resolved
Hide resolved
…into feature/add-services-into-docs
It does under If we want to have a dedicated page for this, probably should show two ways of using the service, with implementing |
src/MudBlazor.Docs/Pages/Features/Services/Examples/BrowserViewportServiceExample.razor
Outdated
Show resolved
Hide resolved
src/MudBlazor.Docs/Pages/Features/Services/Examples/BrowserViewportServiceExample.razor
Outdated
Show resolved
Hide resolved
src/MudBlazor.Docs/Pages/Features/Services/Examples/BrowserViewportServiceExample.razor
Outdated
Show resolved
Hide resolved
|
Another issue is that we don't actually recommend using: Instead, we recommend using: Due to this problem #4631 The |
|
@ScarletKuro Thank you, didn't know that, thought the framework would handle the disposing of all disposable services => updated the examples to use the factories. |
|
@versile2
=> As the current one is closed: Should I just create a new small branch "Service page additions"? |
|
Yes new PR for adjustments. |




MudBlazor provides several general useful services, but they aren't mentioned within the documentation. This PR adds a new point
ServicesunderFeatures. TheServicespage describes currently following services:These where the services that I identified as being non-specific enough to be general useful outside of the MudBlazor project.