Skip to content

MudThemingProvider: MudThemeProvider without MudPopoverProvider#8102

Merged
mikes-gh merged 1 commit intoMudBlazor:devfrom
mikes-gh:mudthemingprovider
Jan 28, 2024
Merged

MudThemingProvider: MudThemeProvider without MudPopoverProvider#8102
mikes-gh merged 1 commit intoMudBlazor:devfrom
mikes-gh:mudthemingprovider

Conversation

@mikes-gh
Copy link
Contributor

@mikes-gh mikes-gh commented Jan 27, 2024

Description

A long time ago we added <MudPopoverProvider/> and wanted to ship it without user code changes.
Since everyone had <MudThemeProvider/> in their code we decided to add it to that provider so the new feature would light up automatically.
This has proved to be problematic in net8 where new scenarios would require these providers to be separate.
A common requirement would be to use <MudThemingProvider/> in the layout which could be statically rendered whilst requiring <MudPopoverProvider/> in an interactive page. Install the MudBlazor.Templates for some examples of the render mode scenarios.
There is a way of disabling <MudPopoverProvider/> inside <MudThemeProvider/> but its not intuitive.

So we decided after much discussion to create a new provider <MudThemingProvider/> (note the ing) in order to not break everyone who is relying on the current behaviour.

Unfortunately we can't obsolete a component due to it not being supported in razor.
One idea is to Log a warning at runtime.
I'd be interested if anyone has a better solution.

How Has This Been Tested?

<MudThemeProvider/> is now inherited from <MudThemingProvider/> so the current tests should test both.
@henon can you think of some additional tests we need?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@mikes-gh mikes-gh requested a review from henon January 27, 2024 14:51
@github-actions github-actions bot added enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library PR: needs review labels Jan 27, 2024
@codecov
Copy link

codecov bot commented Jan 27, 2024

Codecov Report

Attention: Patch coverage is 93.79310% with 18 lines in your changes missing coverage. Please review.

Project coverage is 88.11%. Comparing base (1e6db68) to head (897b56a).
Report is 1294 commits behind head on dev.

Files with missing lines Patch % Lines
...mponents/ThemeProvider/MudThemingProvider.razor.cs 93.72% 1 Missing and 17 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #8102   +/-   ##
=======================================
  Coverage   88.11%   88.11%           
=======================================
  Files         394      394           
  Lines       11760    11760           
  Branches     2384     2384           
=======================================
  Hits        10362    10362           
  Misses        871      871           
  Partials      527      527           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@henon henon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea to derive the old ThemeProvider from the new ThemingProvider. LGTM

@mikes-gh mikes-gh merged commit 90a4ac5 into MudBlazor:dev Jan 28, 2024
@mikes-gh mikes-gh deleted the mudthemingprovider branch January 29, 2024 17:22
@TDroogers
Copy link
Contributor

TDroogers commented Jan 30, 2024

@mikes-gh

As a dirty workaround you can show an message in the ide with [EditorRequired]

[Parameter, EditorRequired] public string Deprecated_use_MudThemingProvider { get; set; }

@iR3turnZ
Copy link

iR3turnZ commented Feb 7, 2024

This merge broke backwards compatibility. If you have a library that was built bevor the MudThemingProvider was introduced it can't be used after this update. Blazor just doesn't recognize components that inherit from BaseMudThemeProvider anymore. Would be nice to note this change as a breaking change.

Example repo: https://github.com/HoeblingerDaniel/MudBlazorBugShowcase

@henon
Copy link
Contributor

henon commented Feb 7, 2024

Sorry @HoeblingerDaniel, we didn't hink about that. If'd known it will break user code we wouldn't have done it

@henon henon added the breaking change This change will require consumer code updates label Feb 7, 2024
@henon henon mentioned this pull request Mar 26, 2024
biegehydra pushed a commit to biegehydra/MudBlazor that referenced this pull request Apr 26, 2024
@danielchalmers danielchalmers added regression Previously worked and now doesn't and removed accidental break labels Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change This change will require consumer code updates enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library regression Previously worked and now doesn't

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants