Caliburn.Micro icon indicating copy to clipboard operation
Caliburn.Micro copied to clipboard

Why are there breaking changes in the 4.0.210 patch release?

Open mgroetan opened this issue 2 years ago • 6 comments

There is at least one breaking change in this patch(!) release, where the "BootstrapperBase.DisplayRootViewFor" method has been (correctly) renamed to "DisplayRootViewForAsync". Such a change belongs in a major version update, though, and neither is it mentioned in the release notes.

I also note that the .NET Framework requirement has been changed from 4.6.1 to 4.6.2, most likely due to #802. Isn't this too a potential breaking change? NuGet-updating tools like "dotnet-outdated" will now fail to detect an applicable update, due to the way that tool treats framework dependencies (if you're a bit slow on the uptake, and still have some .NET Framework 4.6.1 apps lying about...).

Judging by the release notes, you've also added .NET 6 support. Isn't this also something that would normally warrant a major version release? Just asking for a friend...

mgroetan avatar Aug 04 '22 11:08 mgroetan

Thank you for your feedback.

When we released Caliburn.Micro 4 the DisplayRootViewFor was an async function. I just renamed it to keep with async conventions. It is a best practice to await async functions

As for dropping support for 4.6.1 that was to keep in line with Microsoft's supported .net framework versions. I am sure there are plenty of apps that use .net framework 4.6.1 and older. Keep in mind apps using .net framework 4.6.1 and earlier still can use Caliburn.Micro 4.0.173 or earlier

  NET Framework 4.5.2, 4.6, and 4.61 retire on April 26, 2022. These specific releases were previously signed using
  Secure Hash Algorithm (SHA-1) certificates. This algorithm is no longer deemed secure. 

image

https://docs.microsoft.com/en-us/lifecycle/products/microsoft-net-framework

https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core#:~:text=Out%20of%20support%20versions%20%20%20%20Version,August%2021%2C%202021%20%203%20more%20rows%20

I do need to drop support for .net 5 and .net core 3.1 will be out of support in December 2022

Caliburn Micro 5 will include support WinUI, Maui, and AvaloniaUI

vb2ae avatar Aug 05 '22 00:08 vb2ae

Thanks for the reply. I appreciate all the good work going into the project, and I don’t have any objections to any of the actually changes as such.

My concern was merely the fact that breaking changes like these do not seem to warrant more than a patch release from you. When updating a NuGet package, you normally don’t expect any breaking changes unless it’s a major version. What I’m trying to achieve by my question is to hear the rationale for NOT making it a major version upgrade. I DO realize that there’s probably parallel ongoing work with the next major version, so having a preemptive one might not fit into into the project plans. But maybe then the breaking changes could have waited for it, If they don’t fix any critical issues?

mgroetan avatar Aug 05 '22 20:08 mgroetan

Dear @vb2ae,

Please tell me how to modify the old code broken after updating the NuGet package:

protected override void OnStartup(object sender, StartupEventArgs e)
{
    DisplayRootViewFor<ShellViewModel>();
}

We usually call DisplayRootViewFor in the sync OnStartup. Unfortunately, there is no OnStartupAsync to await DisplayRootViewForAsync. Should I just use the following line?

    DisplayRootViewForAsync<ShellViewModel>().Wait();

BTW, the current documentation still refers to DisplayRootViewFor, not DisplayRootViewForAsync, see https://caliburnmicro.com/documentation/configuration.

iberisoft avatar Aug 22 '22 15:08 iberisoft

I'd like to echo iberisoft's comment, as I made the coding-after-midnight mistake of just changing a project's existing code to "async void", which the caller won't wait on: https://github.com/tgjones/gemini/pull/345. Changes worked well enough when running the project's demo at the time, but it's not the right fix.

That change should have also corrected all of the samples. E.g. this still uses the now removed API: https://github.com/Caliburn-Micro/Caliburn.Micro/blob/master/samples/scenarios/Scenario.Functional.App/Bootstrapper.cs#L26

kornman00 avatar Aug 22 '22 18:08 kornman00

Thank you @kornman00, protected override async void OnStartup(object sender, StartupEventArgs e) is a solution.

iberisoft avatar Aug 22 '22 19:08 iberisoft

@kornman00 will work on updating the samples

vb2ae avatar Aug 23 '22 10:08 vb2ae