Meet the future of Umbraco: v6 beta

Friday, January 11, 2013 by Sebastiaan Janssen


It's a new year, high time for a new Umbraco version number!

Short version: Umbraco 6.0.0 beta is out, it's awesome for developers, go download it!

What to expect

v6 has very strong ties to v4, in fact we've been building 6 while v4 was under development and have very regularly synced the changes from 4 into 6. So everything will look and feel the same, but a lot of things have changed under the covers.

This makes v6 a very developer-centric version, here's what you get:

  • Completely rewritten API's for working with Content and Media in your custom code and packages (some documentation will come later, but make sure to explore the ApplicationContext.Current.Services.ContentService and ApplicationContext.Current.Services.MediaService)
  • The API makes use of PetaPoco a tiny object relational mapper. We've also built a layer on top of that so that all the syntax difference between SQL, SQL CE and MySQL have been abstracted away, so no more need to write three different queries
  • With the above change it was also fairly easy to write a little migration framework that can take care of database updates, again: no more need to have upgrade scripts per database type
    • PetaPoco and the migrations framework are public, so you can use them in your custom code as well!
  • We now support Partial View macro's if you're using MVC in Umbraco, these macro's supercede Razor macro's (although, don't worry, you can still use them and you will be able to use them for a long time to come!)

These are the most important and big new changes to v6, check out all the links on the release page as well.

Breaking changes

There are some breaking changes in this release, the most important one is the way that properties are saved has changed. Previously, we had this insane thing going on where when you did this:

doc.getProperty("pageTitle").Value = "Hello World";
doc.getProperty("dogName").Value = "Lassie";
doc.getProperty("iLove").Value = "Umbraco";
 

every line of this code would update the document, so 3 updates to the database where you only really want one.

In v6, you can finally just update all your properties first and then save them all in one go. But it means that if you want them saved, you have to explicitly call the save function:

doc.Save(); 

And now you've saved the document with the 3 changes above in one nice update statement!

So.. if you're not using .Save() already, start doing it for everything: content, media, members, etc. Everywhere you set properties, add a .Save().

Currently the behavior has only changed for Content and Media, but it will change for the other API's as well.

Go get it!

Remember that this is a beta and not everything is perfect yet. But I did drive Morten insane by breaking all kinds of things and installing all of the popular packages, most of which should work in v6. So please, create new issues in the issue tracker when you spot them and set the "Affected Version" field to 6.0.0 so it's clear that they popped up in that release.

Other than that, I think internally we're all very, very excited about this release, paving the way to the future of Umbraco. Surprisingly little seems to have actually broken and that's a great thing!

So head on over to CodePlex and give it a whirl! Bonus tip: You can even upgrade v4 to v6 easily!

7 comment(s) for “Meet the future of Umbraco: v6 beta”

  1. Gravatar ImageEd Says:

    Funny, i just said to a developer that doc.getProperty("iLove").Value = "Umbraco"; was so expensive.. and now it's fixed! :)

  2. Gravatar ImageAsbjørn Says:

    Awesome! The new API is a great improvement. One thing that has always bugged me about Umbraco is the idiosyncrasies and inconsistencies in the API. v6 pretty much resolves that. Great work!
    One question - will the final version of v6 have the new API for all types of content, ie. Members, Users, Relations etc.? I know it's currently just Media and Content (which is a great start). But again, consistency is key here...

  3. Gravatar ImageStuart Quinn Says:

    Did you consider creating a new method (and deprecating the old) for setting the value after a doc.Save() rather than changing the existing behaviour?

    This seems quite likely to cause issues on upgrades, as no exceptions will be thrown, just data will stop being updated. Don't get me wrong, this is a positive change, just concerned about the way it's being rolled out.

  4. Gravatar ImageEran Says:

    looking forward for this release !

  5. Gravatar ImageMerijn van Mourik Says:

    I personnally think Lassie property values are so cool! Thanks for the 6 goodness coming to us. It's hard to keep up with you guys!!!!

  6. Gravatar ImageJames Says:

    how does this relate to Umbraco V5? As far as i understand it V5 was retooling the platform to MVC. The fact that V6 is said to be aligned with V4 makes me a little confused.

  7. Gravatar ImageSebastiaan Janssen Says:

    @James A lot of v5 code has been used for the MVC side of things in both v4 and v6. This means that a lot of the MVC concepts with regards to routing, templating and forms handling are very much like v5.

Leave a comment