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
READMEfiles to reflect final updates to 4.0.0 which weren't previously accounted for.
Notably, this includes capturing the change from
Ignia.TopicstoOnTopic, which resulted in a lot of outdated namespace references and, importantly, internal links.
- Updated
csprojfiles to remove unnecessary dependencies, or mark them as private assets, to reduce the number of dependencies for downstream projects. - Updated
TopicMappingServiceto support the[MapToParent]and[DisableMapping]attributes, for consistency with theReverseTopicMappingService.
Unit Tests
- Renamed the unit tests to use
METHOD_CONDITION_RESULTconvention. - 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.Sqlis 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
AttributeTypeDescriptorsupport for configuring attributes via topic attributes, instead ofDefaultConfiguration - Fully commented the
OnTopic.ViewModelslibrary 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
Startupconfiguration (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
DeleteTopicandMoveTopicstored procedures - Introduced new
refactorlogfile to simplify updating the SQL Schema - Introduced new
VersionHistoryIndexfor centralizing the logic of pulling the last five version numbers for each topic - Introduced new
ValidateHierarchystored 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.Contractclass - 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.
CultureInfoandStringComparisonto avoid inconsistencies with localization - Ensured all dependencies are marked
readonlyand uninitialized (as they are set in the constructor) - Established new
DummyTopicMappingServiceandDummyTopicRepositoryas placeholders when no data is required - Fully adopted semantic versioning via GitFlow and GitVersion
- Began using
git merge --no-ffso we can better track merges independent from feature commits - Renamed
FakeTopicRepositorytoStubTopicRepository, and placed it in the newOnTopic.TestDoublespackage, allowing reuse between projects
Frontend
- Moved legacy
OnTopic.Webproject to newOnTopic-WebFormsrepository - Moved legacy
OnTopic.Web.MVCproject to newOnTopic-MVCrepository - Introduced barebones
Hostprojects 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.Sqlis nowOnTopic.Data.Sql) - Renamed all namespaces from
Ignia.Topics*toOnTopic*(e.g.,Ignia.Topics.Data.Sqlis nowOnTopic.Data.Sql) - Renamed
OnTopic.ViewModelsnamespace toOnTopic.Modelsto account for new binding models (e.g.,ITopicBindingModel) - Moved topic mapping attributes into new
OnTopic.Mapping.Annotationsnamespace - Moved classes related to topic attributes (namely,
AttributeValueand[AttributeSetter]) into newOnTopic.Attributesnamespace - Moved strongly type
AttributeValueCollectionmethods (e.g.,GetBoolean(),SetBoolean()) into new extensions class inOnTopic.Attributesnamespace - Moved infrastructure related classes into new
OnTopic.Internalnamespace (e.g.,TypeMemberInfoCollection,PropertyConfiguration) - Moved Oroborous Configuration related classes into new
OnTopic.Metadatanamesace (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
ErrorControllerorFallbackController
SQL
- Removed the
topics_prefix from all objects in the SQL Schema (OnTopic.Data.Sql.Database) - Migrated the
GetTopics,CreateTopic, andUpdateTopicstored procedures to use new user-defined table valued types (AttributeValues,TopicList) - Removed unused parameters from
GetTopics,CreateTopic,UpdateTopic(e.g.,@IsDraft) - Renamed
PersistRelationstoUpdateRelationships