Skip to content

Build: Drop support for .NET 7#9511

Merged
henon merged 2 commits intoMudBlazor:devfrom
danielchalmers:drop-net7
Oct 10, 2024
Merged

Build: Drop support for .NET 7#9511
henon merged 2 commits intoMudBlazor:devfrom
danielchalmers:drop-net7

Conversation

@danielchalmers
Copy link
Copy Markdown
Member

Description

.NET 7 reached End of Support on May 14, 2024.

Todo:

// ReSharper disable MethodHasAsyncOverload (not available in .net7)
// Cancel the previous debounce task if it exists
_cancellationTokenSource?.Cancel();
// ReSharper restore MethodHasAsyncOverload

// ReSharper disable once MethodHasAsyncOverload - not available in .NET6 & .NET7
_cancellationTokenSource.Cancel();
await DestroyPopoversQuick();
_batchExecutor.Dispose();
// In case someone has custom implementation and didn't unsubscribe
_observerManager.Clear();
_popoverSemaphore.Dispose();
// https://github.com/MudBlazor/MudBlazor/pull/5367#issuecomment-1258649968
// Fixed in NET8
// Do not send CancellationToken as it was cancelled.
#pragma warning disable CA2012 // Use ValueTasks correctly
_ = _popoverJsInterop.Dispose();
#pragma warning restore CA2012 // Use ValueTasks correctly

// When .NET7 is dropped we can use async Dispose, but for now MAUI has bug https://github.com/MudBlazor/MudBlazor/pull/5367#issuecomment-1258649968.
_ = JsRuntime.InvokeVoidAsyncIgnoreErrors("stopWatchingDarkThemeMedia");

// https://github.com/MudBlazor/MudBlazor/pull/5367#issuecomment-1258649968
// Fixed in NET8
_ = _resizeListenerInterop.Dispose();

// https://github.com/MudBlazor/MudBlazor/pull/5367#issuecomment-1258649968
// Fixed in NET8
// Do not send CancellationToken as it was cancelled.
#pragma warning disable CA2012 // Use ValueTasks correctly
_ = _popoverJsInterop.Dispose();
#pragma warning restore CA2012 // Use ValueTasks correctly

How Has This Been Tested?

Type 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)
  • Documentation (fix or improvement to the website or code docs)

Checklist

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

@github-actions github-actions bot added breaking change This change will require consumer code updates (ex: removes/changes a public API) PR: needs review labels Jul 26, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.56%. Comparing base (28bc599) to head (b72ef03).
Report is 525 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #9511      +/-   ##
==========================================
+ Coverage   89.82%   90.56%   +0.73%     
==========================================
  Files         412      406       -6     
  Lines       11878    12708     +830     
  Branches     2364     2462      +98     
==========================================
+ Hits        10670    11509     +839     
+ Misses        681      638      -43     
- Partials      527      561      +34     

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

Comment thread src/MudBlazor/MudBlazor.csproj
#if NET8_0_OR_GREATER
var parametersHandlerShouldFire = _parameterScopeContainers.SelectMany(parameter => parameter)
.Where(parameter => parameter.HasHandler && parameter.HasParameterChanged(parameters))
.ToFrozenSet(ParameterHandlerUniquenessComparer.Default);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Side note: I think the FrozenSet is not the best type here to be used compared to Hashset because it requires more time and allocations to be created.

Method Mean Error StdDev Ratio RatioSD Allocated Alloc Ratio
ToHashSet 2.242 us 0.0150 us 0.0125 us 1.00 0.00 2.23 KB 1.00
ToFrozenSet 48.176 us 0.1614 us 0.1431 us 21.48 0.14 12.45 KB 5.57

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess it makes sense to have HashSet in this place as we just enumerate it and we do not do read individual values where the FrozenSet is faster.

@ScarletKuro
Copy link
Copy Markdown
Member

@ScarletKuro
Copy link
Copy Markdown
Member

Sticky note:

  1. namespace MudBlazorFix // A bug in Blazor requires a different namespace in some scenarios, see: https://github.com/dotnet/aspnetcore/issues/36326 (fixed in .NET 7)

  2. Fix: Server Side DataGrid EventListener Memory Leak #9735

@danielchalmers danielchalmers requested a review from henon October 5, 2024 16:26
@henon henon merged commit e18ba1d into MudBlazor:dev Oct 10, 2024
@henon
Copy link
Copy Markdown
Contributor

henon commented Oct 10, 2024

Thanks @danielchalmers ! Work on v8 is now officially commencing!

@ScarletKuro
Copy link
Copy Markdown
Member

Added to v8.0.0 Migration Guide #9953

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 (ex: removes/changes a public API)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants