Releases: OnTopicCMS/OnTopic-Library
Releases · OnTopicCMS/OnTopic-Library
v4.0.1
This patch primarily provides cleanup of items that were overlooked as part of the 4.0.0 release. For implementers, the main highlight is that it greatly reduces the number of dependencies required by the NuGet packages.
Change Log
- Updated
README
files to reflect final updates to 4.0.0 which weren't previously accounted for.
Notably, this includes capturing the change from
Ignia.Topics
toOnTopic
, which resulted in a lot of outdated namespace references and, importantly, internal links.
- Updated
csproj
files to remove unnecessary dependencies, or mark them as private assets, to reduce the number of dependencies for downstream projects. - Updated
TopicMappingService
to support the[MapToParent]
and[DisableMapping]
attributes, for consistency with theReverseTopicMappingService
.
Unit Tests
- Renamed the unit tests to use
METHOD_CONDITION_RESULT
convention. - Broke quite a few unit tests down into more granular tests which focused on one narrower condition.
- Broke quite a few view models used for tests into test-specific models, instead of trying to address the needs of multiple tests with one complex view model (e.g.,
SampleTopicViewModel
).
Bug Fixes
- Resolved an issue where
Contract.Assume(false)
would fail to throw an exception, because it was being picked up byContract.Assume(object)
.
v4.0.0
The 4.0.0 release represents a significant update to the OnTopic library, both in terms of API as well as functionality. It contains major features, refactorings, and updates introduced over the last year.
Highlights
- Migrated library from .NET Framework 4.7 to .NET Standard 2.x
- Introduced entirely new ASP.NET Core 3.1 presentation layer (
OnTopic.AspNetCore.Mvc
) - Introduced Reverse Topic Mapping Service, for mapping from data transfer objects back to topics
- Renamed all namespaces from
Ignia.Topics*
toOnTopic*
(e.g.,Ignia.Topics.Data.Sql
is nowOnTopic.Data.Sql
)
New Features
Library
- Introduced Reverse Topic Mapping Service, for mapping from data transfer objects back to topics
- Introduced Hierarchical Topic Mapping Service for mapping constrained hierarchies (e.g. menus)
- Introduced support for mapping
double
,Uri
, as well as nullable types (e.g.Int?
,DateTime?
) - Introduced new
AttributeTypeDescriptor
support for configuring attributes via topic attributes, instead ofDefaultConfiguration
- Fully commented the
OnTopic.ViewModels
library to provide e.g. Visual Studio IntelliSense support
Frontend
- Introduced entirely new ASP.NET Core 3.1 presentation layer (
OnTopic.AspNetCore.Mvc
) - Introduced support for view components in ASP.NET Core 3.x implementation (e.g.,
MenuViewComponentBase<T>
) - Introduced new extensions to simplify
Startup
configuration (e.g.,IMvcBuilder.AddTopicSupport()
,IEndpointRouteBuilder.MapTopicRoute()
) - Expanded conventions for view locations to include areas, nested shared folders (e.g.,
/view/ContentType/Shared/
) - Moved topic validation logic for controllers to a new
[ValidateTopic]
attribute, allowing it to be applied on a per-action basis - Moved all sitemap logic into the
SitemapController
, so it no longer requires a (complicated) view
SQL
- Introduced locks and transactions to
DeleteTopic
andMoveTopic
stored procedures - Introduced new
refactorlog
file to simplify updating the SQL Schema - Introduced new
VersionHistoryIndex
for centralizing the logic of pulling the last five version numbers for each topic - Introduced new
ValidateHierarchy
stored procedure for detecting potential problems with the nested set model
Code Changes
Library
- Migrated library from .NET Framework 4.7 to .NET Standard 2.x
- Replaced legacy Code Contracts (RIP) with
OnTopic.Internal.Diagnostics.Contract
class - Migrated to C# 8.0's new nullable annotation context
- Migrated to Visual Studio 2019's support for
<inheritDoc />
on XMLDOCs - Migrated to Visual Studio 2017's new project format
- Adopted Visual Studio's code analysis conventions such as expression bodied members
- Consistently applied e.g.
CultureInfo
andStringComparison
to avoid inconsistencies with localization - Ensured all dependencies are marked
readonly
and uninitialized (as they are set in the constructor) - Established new
DummyTopicMappingService
andDummyTopicRepository
as placeholders when no data is required - Fully adopted semantic versioning via GitFlow and GitVersion
- Began using
git merge --no-ff
so we can better track merges independent from feature commits - Renamed
FakeTopicRepository
toStubTopicRepository
, and placed it in the newOnTopic.TestDoubles
package, allowing reuse between projects
Frontend
- Moved legacy
OnTopic.Web
project to newOnTopic-WebForms
repository - Moved legacy
OnTopic.Web.MVC
project to newOnTopic-MVC
repository - Introduced barebones
Host
projects for testingOnTopic.Web
,OnTopic.Web.Mvc
, andOnTopic.AspNetCore.Mvc
SQL
- Migrated to tab spaces of 8 characters—now enforced via a
.editorconfig
—to simplify alignment - Standardized the nomenclature around relationship types as
relationshipKey
(was previouslyscope
,key
, ornamespace
)
Breaking Changes
Library
- Renamed all packages from
Ignia.Topics*
toOnTopic*
(e.g.,Ignia.Topics.Data.Sql
is nowOnTopic.Data.Sql
) - Renamed all namespaces from
Ignia.Topics*
toOnTopic*
(e.g.,Ignia.Topics.Data.Sql
is nowOnTopic.Data.Sql
) - Renamed
OnTopic.ViewModels
namespace toOnTopic.Models
to account for new binding models (e.g.,ITopicBindingModel
) - Moved topic mapping attributes into new
OnTopic.Mapping.Annotations
namespace - Moved classes related to topic attributes (namely,
AttributeValue
and[AttributeSetter]
) into newOnTopic.Attributes
namespace - Moved strongly type
AttributeValueCollection
methods (e.g.,GetBoolean()
,SetBoolean()
) into new extensions class inOnTopic.Attributes
namespace - Moved infrastructure related classes into new
OnTopic.Internal
namespace (e.g.,TypeMemberInfoCollection
,PropertyConfiguration
) - Moved Oroborous Configuration related classes into new
OnTopic.Metadata
namesace (e.g.,ContentTypeDescriptor
,AttributeDescriptor
)
Frontend
- Dependencies for some services and controllers may have been updated to reflect new features
- The new ASP.NET Core 3.1 presentation layer no longer includes an
ErrorController
orFallbackController
SQL
- Removed the
topics_
prefix from all objects in the SQL Schema (OnTopic.Data.Sql.Database
) - Migrated the
GetTopics
,CreateTopic
, andUpdateTopic
stored procedures to use new user-defined table valued types (AttributeValues
,TopicList
) - Removed unused parameters from
GetTopics
,CreateTopic
,UpdateTopic
(e.g.,@IsDraft
) - Renamed
PersistRelations
toUpdateRelationships