LottePitcher / opinionated-package-starter

Get a head start when creating Umbraco Packages
MIT License
33 stars 8 forks source link

Settle on version for the Umbraco dependencies #10

Closed abjerner closed 1 year ago

abjerner commented 1 year ago

Feature summary

Current the template specifically targets Umbraco 10.4:

<PackageReference Include="Umbraco.Cms.Web.Website" Version="10.4.0" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="10.4.0" />

But across my packages, I haven't encountered a case yet where I have to target a specific version of Umbraco 10 (although you might have to if you need to do something with the block grid).

Anyways, my point is that maybe the Umbraco version should be lowered. Eg. if the package has a dependency for 10.4.0, people with older versions of Umbraco 10 will have to update. But if the package doesn't need anything specifically from 10.4.0, it might as well be 10.0.0 instead. This then allows people to still use the package if they're on 10.0.0, but it also allows them to use a newer version of Umbraco 10.

However by adding a dependency for a version like 10.0.0, we're allowing people to upgrade to any newer version of Umbraco. A package for Umbraco 10 will very likely also work for Umbraco 10. It'll probably also work for Umbraco 12, but we don't know for sure yet as Umbraco 12 isn't out yet. And with the announced changed in Umbraco 13, it's probably not very likely that it works there. So maybe we should specify a version range instead - eg. like:

<PackageReference Include="Umbraco.Cms.Web.Website" Version="[10.0.0,12.0)" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="[10.0.0,12.0)" />

This indicates that the package supports Umbraco 10 and 11, but not Umbraco 12 or newer. I think the new Marketplace also relies on this for determining the version a given package supports.

Additional details

No response

LottePitcher commented 1 year ago

Thanks @abjerner - finally found time to spend some time again on this project!

What you say makes complete sense. For now I'm going to lower the dependency to 10.0.0 - and I'll put a note in the instructions about people paying attention to that.

Take your point about putting an upper limit on it but as we're a way off Bellissima, think I'll keep it simple for now :)

abjerner commented 1 year ago

There are both pros and cons for adding an upper bound, so either should be fine πŸ‘

I started to add an upper bound because the Umbraco Marketplace uses this information. There is a bit discussion on that here as well: https://github.com/umbraco/Umbraco.Marketplace.Issues/issues/52

Adding an upper bound does however also put some more work on developers - eg. when Umbraco 12 came out, I had to bump the upper bound of a lot of our packages 😁

I also learned that package references like below exclude Umbraco 12.0.0, but not any of the 12.0.0 release candidates (or pre-releases in general) 😱

<PackageReference Include="Umbraco.Cms.Web.Website" Version="[10.0.0,12.0)" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="[10.0.0,12.0)" />

So since Umbraco 12 is now out, I have this instead:

<PackageReference Include="Umbraco.Cms.Web.Website" Version="[10.0.0,12.999)" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="[10.0.0,12.999)" />

I doubt Umbraco will ever get a 12.999 release, so this should in theory allow all versions from 10 to 12 both including, but not 13 (stable and pre-releases).