Skip to content

Releases: skybrud/Skybrud.Umbraco.Spa

v3.0.0

12 Sep 15:21
Compare
Choose a tag to compare

Installation

Install via NuGet - either via the .NET CLI:

dotnet add package Skybrud.Umbraco.Spa --version 3.0.0

or the NuGet package manager:

Install-Package Skybrud.Umbraco.Spa -Version 3.0.0

Skybrud.Umbraco.Spa v3.0.0-beta014

26 Oct 13:29
Compare
Choose a tag to compare

Installation

Changes

  • 🆗 Implemented setter method for SpaRequestHelper.OverwriteStatusCodes property (see cd5f6e3 and #14)
    It should be possible to set the property, but it didn't have a setter method.

Skybrud.Umbraco.Spa v3.0.0-beta013

13 Jul 15:04
Compare
Choose a tag to compare

Installation

Breaking changes

  • 🅱️ GetData endpoint should always return 200 OK (see c941eb1 and #12)

Other changes

  • 🆗 Cached 404 page requests return status code 200 (see c941eb1 and #13)

  • 🆕 Added support for variants (see c3c760e)

Skybrud.Umbraco.Spa v3.0.0-beta012

23 Mar 15:35
Compare
Choose a tag to compare

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

17 Feb 10:38
Compare
Choose a tag to compare

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 and PostInitModels 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

29 Jan 10:02
Compare
Choose a tag to compare

Installation

Changelog

  • Added null check to TryGetPreview method (see 60b44ff)
    The SPA endpoint may be requested with a nodeId parameter instead of the normal url parameter. If this was the case, the TryGetPreview would fail as url 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 from request.Arguments, which would result in a new exception if the original exception was thrown before request.Arguments had been populated.

  • Made methods of SpaRequestHelper class virtual (see 79254ae)
    The SpaRequestHelper 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 the GetResponse 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 new HandleGetResponseException, which can be overridden i sub classes.

  • Introduced new AddTrailingSlash and RemoveTrailingSlash 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 of SpaRequestHelper.

  • 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

26 Jan 15:18
Compare
Choose a tag to compare
Pre-release

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

28 Sep 15:19
Compare
Choose a tag to compare
Pre-release

Installation

Breaking changes

  • 🅱️ HttpContext property should be of type HttpContextBase instead of HttpContextWrapper (see e7d2084)
    The HttpContextWrapper class' purpose is wrapping an instance of HttpContext, but can't really be used for creating fake requests - eg. used for testing purposes. As HttpContextWrapper inherits from HttpContextBase, and you can make your own classes inheriting from HttpContextBase, the property type really should be HttpContextBase instead.

Skybrud.Umbraco.Spa v3.0.0-beta007

16 Jul 15:06
Compare
Choose a tag to compare
Pre-release

Installation

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

  • Fixed 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.

Skybrud.Umbraco.Spa v3.0.0-beta006

23 Mar 10:53
Compare
Choose a tag to compare
Pre-release

Installation

Changelog

  • Updated SpaPublishedContentContractResolver to support serializing instances of HtmlString and IHtmlString (see 962b728 and 1d38052)
    By default, JSON.net will serialize instances to an empty JSON object. With this release and when using SpaPublishedContentContractResolver, instances will now be serialized to a string with the actual HTML value.

  • Added null check because context.Response may be null in some cases when using the AccessControlAllowOrigin attribute (see 64eba8c)
    If an API method, where the AccessControlAllowOrigin attribute is used, throws an exception, context.Response will be null. 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 and text/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.