Update 15/01/2020: A show stopping bug has been discovered in this release and we have unpublished the 8.5.0 release from Our.umbraco.com download page and Nuget. We have identified and fixed the issue and have released a 8.5.1 patch. Links in the blog post has been updated to the patched version. Full details on the issue tracker https://github.com/umbraco/Umbraco-CMS/issues/7457
- What’s in Umbraco 8.5
- Modelsbuilder in Umbraco Core
- Fix for deadlock issue
- How to get your hands on Umbraco 8.5
What’s new in Umbraco 8.5
Not to get all long-winded on you but if you’re interested, I’d like to add some historical perspective on the new Modelsbuilder feature in 8.5 (if you’re not into history, feel free to skip this part 😉):
---- Start history lesson ----
Since Umbraco 7.4, released way back in 2016, the ZBU Modelsbuilder package (aka Umbraco Modelsbuilder) has been bundled with Umbraco. This nifty package helped turn content types into models on the fly. The main reason for including it with every Umbraco installation was to allow everyone to use strongly typed models in their templates and move away from using dynamics (oh, the horror 😱).
Previously, dynamics had been the easy and intuitive way of querying content created in Umbraco. If you wanted to output the name of the content item for a page you could simply write @CurrentPage.Name in your view and it would automagically output the name of said item. It even worked for collections and custom properties. So you could iterate through CurrentPage.Children or access a custom property named Page Description by writing CurrentPage.pageDescription. It doesn’t get much easier than that but unfortunately, the dynamic nature of these objects could have a huge impact on performance as they had to be allocated to memory on each use. Using dynamics was also very prone to errors as you had no strongly typed objects to rely on. You would never really know if things were failing until your code was executed.
The correct way of accessing content was to use the IPublishedContent model but prior to Modelsbuilder that was a bit trickier, especially if you were new to Umbraco. Getting a custom property would look something like @Model.Content.GetPropertyValue(“pageDescription”). Not quite as neat and tidy as it could be. This also introduced the “OMG, there’s magic strings everywhere” problem. Many developers turned to writing view models and manually populating these with Umbraco data. A few even created automated models builders or mappers to avoid having to create classes and do these mappings manually. One of these was ZBU Modelsbuilder, an open-source models builder for Umbraco, created by Stephan Gay (link to the repository and more can be found on Stephans website https://www.zpqrtbnk.net/). This was the package that was eventually bundled with Umbraco and made working with IPublishedContent a whole lot nicer.
It also meant that Umbraco could move away from dynamics entirely. From 7.4+ dynamics were no longer recommended or taught on the Umbraco training courses. And with the release of Umbraco 8 in 2019, dynamics were no longer available.
---- End history lesson ----
Modelsbuilder in Umbraco Core
Modelsbuilder was never really included as a real part of Umbraco. We have, however, for many years been treating it like it was and despite not taking ownership of it, Umbraco has been relying heavily on the functionality of this package.
Since this is not an optimal solution for anyone, and because Umbraco 8 is dependent on a modelsbuilder, we decided it was time to take responsibility and make sure that the functionality is now fully supported by Umbraco HQ. The way to do this was to make sure that the minimum requirements for a modelsbuilder is now included as a part of the CMS.
The basic functionality of ZBU Modelsbuilder is now part of the Umbraco Core codebase and will be maintained by Umbraco HQ. It can essentially be looked at as a slimmed-down version of the package that has been used for many years.
For a full overview of available features see the Modelsbuilder documentation which has been updated to reflect the features in the new Core version.
What has changed?
ZBU Modelsbuilder is an amazing tool that does a whole lot of different things. We have decided not to include some of the more advanced functionality such as the ability to automatically generate DLLs (this means we don’t have to ship with the entire Roslyn compiler) and the ability to customize Modelsbuilder models with attributes.
A larger feature-set is great, but unfortunately, it also comes with an added layer of complexity that needs to be maintained over time. We feel that if you have the need for these advanced features, you are better off using the external package where these features are maintained by the people who created them in the first place.
The “new” core Umbraco Modelsbuilder contains the features that are required for Umbraco 8 to run: PureLive mode to generate models at runtime and also AppData mode to create partial classes if you want to work with these in your VS solution. PureLive is still the default mode when you install Umbraco 8.5 and works exactly the same as always and if you want to switch to AppData, this is also done in the same way before by changing the setting in web.config.
Update post release: There's is one notable change though, you can no longer use attributes to control models generation ().
Projects upgrading to Umbraco 8.5
When upgrading existing projects to Umbraco 8.5., you’ll not see any changes and will continue to use the same version of Modelsbuilder as before. Umbraco will automatically detect that you’re using another modelsbuilder and disable the core version, so an upgrade to 8.5 doesn’t mean you automatically switch to Umbraco ModelsBuilder.
If you decide to keep using your existing modelsbuilder with the advanced features, please just be aware that this is a 3rd party package and not directly maintained by Umbraco HQ.
If you are not using any of the advanced features of modelsbuilder, we recommend that you remove the existing one and go with Umbraco Modelsbuilder.
New installations of Umbraco 8.5
All new installations will default to Umbraco ModelsBuilder and you’re then free to switch to the full version if advanced functionality is needed. This can be done by installing the Nuget Package. Umbraco will automatically detect that you’re using another modelsbuilder and disable the core version.
Thanks and a big old h5yr to Stephan for helping to get the embedded version done 🙌🙏
Fix for deadlock issue
Umbraco 8.5 also contains a fix for a deadlock issue that was discovered in Umbraco 8.4. The issue occurs when multiple threads were doing write and read operations and experienced an application shutdown. This led to a deadlock of the cache and meant that the operations would not resume after startup. You can find a (really) detailed description of the issue on the issue tracker: https://github.com/umbraco/Umbraco-CMS/pull/7418
We are also releasing this fix in an 8.4.1 patch release today, and rolling this out to all Umbraco 8 sites on Umbraco Cloud to ensure sites are automatically patched.
How to get your hands Umbraco 8.5
As always, from today, all new Umbraco 8 sites on Umbraco Cloud will be running 8.5. For all our Umbraco Cloud customers with existing projects, this upgrade is only 2 minutes away:
We’ve wrapped it all up for you, so all you have to do now is follow these steps:
- Add a Development Environment to your project, if you do not already have one (Add a Development environment by clicking “Manage Environments” in the project view)
- Make sure you also restore the content to the Development Environment from your Live.
- When the Development Environment is all set up and you’ve made sure you don’t have any pending changes on the Development Environment - you are all ready to upgrade to Umbraco 8.x!
- It's as easy as clicking a button - like, literally clicking the "Upgrade Available" button on the Development Environment. The auto-upgrader will take care of everything from here! 🚀
- Once it's done, check the Development Environment to make sure everything is looking right.
- When that's confirmed, you are ready to deploy the upgrade to the next environment - Live or Staging, and start taking full advantage of all the new features.
Non-Cloud and release notes:
As always, installation and release notes can be found on Our: https://our.umbraco.com/contribute/releases/851
This release is also available from Nuget: https://www.nuget.org/packages/UmbracoCms/8.5.1