Skybrud.Umbraco.Spa v3.0.0-beta007
Pre-releaseInstallation
Breaking changes
-
🅱️ Renamed theInitArguments
method toUpdateArguments
(see 1e2c50d)
The method's purpose is to update theSpaRequestOptions
instance with the initial arguments for the request, but not actually initializing theSpaRequestOptions
instance it self. A newInitArguments
method has been introduced with the purpose of initializing an instanceSpaRequestOptions
(or a sub class thereof).The reason for this change is that the default implementation provided by this package updates a few of the argument properties. You may not want to change this implementation, but still provide another type than the
SpaRequestOptions
class, in which case the newInitArguments
lets you initialize your own class inheriting fromSpaRequestOptions
instead. -
🅱️ Rewrote and restructured parts of the JSON contract resolver (see #10 and e8f7003)
With the old implementation, all property names that matched the ignore rules would be ignored - regardless of the class they we're defined in. For instance,Children
is an ignored name as we don't want the JSON to output the children of anIPublishedContent
, but it might still be a valid scenario to have aChildren
property on your own types. With this change, most of the ignored properties in the default implementation are only ignored if declared on a type in theUmbraco.Core.Models.PublishedContent
namespace.The logic in the contract resolver has also been updated a bit, meaning that validating should ideally be against
member.Name
(upper camel cased) instead ofproperty.PropertyName
(now lower camel cased). This is a breaking change if you previously relied onproperty.PropertyName
being upper camel cased.
Other changes
-
Fixed an issue with
SpaNavigationitem
and nav levels (see 02dfb82)
TheSpaNavigationitem
class didn't properly pass on the level to child items, leading to unexpected results. -
Improved preview detection (see #9 and ea0b281)
In earlier version, the preview detecting was handled by two extension. This was based on the idea that the structure of preview URLs in Umbraco wouldn't change. But there may be other factors to handle, so with this release, the preview detection is now handled byTryGetPreviewId
in theSpaRequestHelper
class. The method is virtual, meaning you can override it if you need to do something beyond the default implmentation. -
Added better support for custom models / parts (see 2621a11)
The default implementation allows for three different parts - that is Site, Navigation and Content. As there may be scenarios where other parts are returned as well, a newInitCustomModels
has been introduced.The
SpaDataModel
class now also has a new constructor overload taking another instance ofSpaDataModel
it's only parameter. As theSpaDataModel
instance of a request may be cached, the new constructor let's you create a copy that you then can make changes to - without modifying the cached version.