Date | 2020-07-16 (1,583 days ago) |
---|---|
Downloads | 762 downloads |
NuGet | View on NuGet |
GitHub | View on GitHub |
Target Frameworks | .NET 4.7.2 |
Umbraco Versions | Umbraco 8 |
#installation
">Installation#breaking
-changes">Breaking changes🅱️ Renamed the InitArguments
method to UpdateArguments
(see 1e2c50d
)
The method's purpose is to update the SpaRequestOptions
instance with the initial arguments for the request, but not actually initializing the SpaRequestOptions
instance it self. A new InitArguments
method has been introduced with the purpose of initializing an instance SpaRequestOptions
(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 new InitArguments
lets you initialize your own class inheriting from SpaRequestOptions
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 an IPublishedContent
, but it might still be a valid scenario to have a Children
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 the Umbraco.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 of property.PropertyName
(now lower camel cased). This is a breaking change if you previously relied on property.PropertyName
being upper camel cased.
#other
-changes">Other changesFixed an issue with SpaNavigationitem
and nav levels (see 02dfb82
)
The SpaNavigationitem
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 by TryGetPreviewId
in the SpaRequestHelper
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 new InitCustomModels
has been introduced.
The SpaDataModel
class now also has a new constructor overload taking another instance of SpaDataModel
it's only parameter. As the SpaDataModel
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.