Releases: skybrud/Skybrud.Umbraco.Spa
v3.0.0
Skybrud.Umbraco.Spa v3.0.0-beta014
Installation
Changes
Skybrud.Umbraco.Spa v3.0.0-beta013
Skybrud.Umbraco.Spa v3.0.0-beta012
Installation
Changelog
-
Fixed preview logic (see 37e7e8a)
A part of the preview logic used a bugged extension method. The extension method has now been removed, and said logic has been updated to correctly detect preview requests. -
Added
<pre>
wrapper element around debug exception message (see 641c4d7 and #11)
When accessing the SPA API directly in the browser, and a request fails, the SPA will show a HTML based error page. Each exception message shown on this error page is now wrapped in a<pre>
element to better show multiline exception messages.
Skybrud.Umbraco.Spa v3.0.0-beta011
Installation
Changelog
-
Introduced new
HandleOutboundRedirects
method in the SPA page flow (see 09a8a59)
The method will handle outbound redirects set via Skybrud.Umbraco.Redirects' Outbound redirect property editor. -
Introduced new
PreInitModels
andPostInitModels
method in the SPA page flow (5e7ed19)
The two methods don't really do anything by default, but add two extra points for hooking into the page flow. -
Fixed SPA navigation item issue (see aa75cae)
A bug fix seems to have introduced a new bug instead in the way the current level of an item is calculated. With this release, the new bug should be fixed as well.
Skybrud.Umbraco.Spa v3.0.0-beta010
Installation
Changelog
-
Added null check to
TryGetPreview
method (see 60b44ff)
The SPA endpoint may be requested with anodeId
parameter instead of the normalurl
parameter. If this was the case, theTryGetPreview
would fail asurl
would be null. -
Added null check as
Arguments
property may not have been initialized yet (db45f4b)
Should an exception occur, and depending on the setup/request, the SPA may generate a HTML error message with details about the request and the exception. The method responsible for this would attempt to read multiple properties fromrequest.Arguments
, which would result in a new exception if the original exception was thrown beforerequest.Arguments
had been populated. -
Made methods of
SpaRequestHelper
class virtual (see 79254ae)
TheSpaRequestHelper
class has a lot of virtual methods, but there were some left that weren't marked as virtual. With this release, those methods are now virtual as well so they can be overridden in sub classes. -
Improved error handling (see 5afcd35, cacb594 and f64fe87)
When calls inside theGetResponse
method throws an exception, information about that exception is added to the Umbraco log. With this release, the error message now contains a few more details about the request. In addition to that, the error handling is now partially handled by a newHandleGetResponseException
, which can be overridden i sub classes. -
Introduced new
AddTrailingSlash
andRemoveTrailingSlash
helper methods (see 5a2715a)
The new methods can be used for either adding trailing slashes to the end of URLs or removing them instead. The methods are not called directly by the SPA package, but may be used by sub classes ofSpaRequestHelper
. -
Updated Skybrud.Umbraco.Redirects dependency (see aed83b4)
The dependency for Skybrud.Umbraco.Redirects has now been updated to the latest version.
Skybrud.Umbraco.Spa v3.0.0-beta009
Installation
Changelog
-
Fixed an issue with how
SpaRequestHelper
is writing to the Umbraco log (see 23fb4d7)
The exception should be passed as the first parameter - otherwise it won't be properly added to the log, and it won't be possible to see the inner exception. -
Updated Skybrud.Essentials dependency (995d494)
The dependency for Skybrud.Essentials has now been updated to the latest version.
Skybrud.Umbraco.Spa v3.0.0-beta008
Installation
Breaking changes
🅱️ HttpContext
property should be of typeHttpContextBase
instead ofHttpContextWrapper
(see e7d2084)
TheHttpContextWrapper
class' purpose is wrapping an instance ofHttpContext
, but can't really be used for creating fake requests - eg. used for testing purposes. AsHttpContextWrapper
inherits fromHttpContextBase
, and you can make your own classes inheriting fromHttpContextBase
, the property type really should beHttpContextBase
instead.
Skybrud.Umbraco.Spa v3.0.0-beta007
Installation
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.
Skybrud.Umbraco.Spa v3.0.0-beta006
Installation
Changelog
-
Updated
SpaPublishedContentContractResolver
to support serializing instances ofHtmlString
andIHtmlString
(see 962b728 and 1d38052)
By default, JSON.net will serialize instances to an empty JSON object. With this release and when usingSpaPublishedContentContractResolver
, instances will now be serialized to a string with the actual HTML value. -
Added null check because
context.Response
may benull
in some cases when using theAccessControlAllowOrigin
attribute (see 64eba8c)
If an API method, where theAccessControlAllowOrigin
attribute is used, throws an exception,context.Response
will benull
. With this release, using the attribute will no longer trigger a null reference exception. -
Value used in
AccessControlAllowOriginAtttibute
class shouldn't be hardcoded (see 996f942)
A constructor overload allows developers to set their own value for the header, but the value used when setting the header was still hardcoded to*
. With this release, the used value now reflects the value set via the constructor. -
Added some error handling to the
SpaRequestHelper.GetResponse
method (see e11c692)
If debug is enabled andtext/html
is present in the accept header of the request, the SPA API will now return a friendly HTML error page if the API throws an exception.