Skip to content

Migrate from MediatR to TimeWarp.Mediator and modernize codebase#567

Merged
StevenTCramer merged 23 commits into
masterfrom
Cramer/2025-08-12/032migrate-from-mediatr-to-timewarp-mediator
Jan 22, 2026
Merged

Migrate from MediatR to TimeWarp.Mediator and modernize codebase#567
StevenTCramer merged 23 commits into
masterfrom
Cramer/2025-08-12/032migrate-from-mediatr-to-timewarp-mediator

Conversation

@StevenTCramer

Copy link
Copy Markdown
Collaborator

Summary

  • Migrate from MediatR to TimeWarp.Mediator library (13.0.0)
  • Migrate from FluentAssertions to Shouldly
  • Adopt kebab-case naming convention for files and directories
  • Migrate PowerShell build scripts to .NET 10 C# single file apps
  • Update to .NET 9 with comprehensive dependency updates
  • Add extensive integration tests for store lifecycle, subscriptions, state transactions, action tracking, cacheable state, and render subscription context

Key Changes

  • MediatR Migration: Replace MediatR with TimeWarp.Mediator across all projects
  • Testing Framework: Switch from FluentAssertions to Shouldly for assertions
  • Naming Convention: Standardize on kebab-case for all non-C# files and directories
  • Build Modernization: Replace PowerShell scripts with .NET 10 C# runfiles using TimeWarp.Amuru
  • CI/CD: Consolidate GitHub workflows into a single ci-cd.yml
  • Integration Tests: Add comprehensive pipeline and store integration tests

Breaking Changes

  • Package references changed from MediatR to Mediator namespace
  • Global usings updated for new namespace structure

- Create tests/client-integration-tests/store/ directory
- Add store-lifecycle-tests.cs with 8 tests covering:
  - GetState: same instance on repeated calls, different instances for different types, initialization on first access
  - Reset: creates new instance after reset
  - RemoveState: creates new instance after removal
  - PreviousState: null before actions, tracks state after action, new Guid after action
- Add global using for Blue namespace
- All tests passing
- Create tests/client-integration-tests/subscriptions/ directory
- Add subscriptions-tests.cs with 6 tests covering:
  - Add subscription and trigger re-render
  - Prevent duplicate subscriptions for same component/state
  - Remove all subscriptions for a component
  - Respect ShouldReRender return value
  - Only re-render matching state type subscribers
  - Re-render multiple components for same state
- Add Subscriptions property to BaseTest
- Add Counter namespace to global-usings.cs
- All 6 tests passing (previously zero coverage)
- Create tests/client-integration-tests/pipeline/ directory
- Add state-transaction-tests.cs with 5 tests covering:
  - Clone state before handler executes
  - Preserve changes on successful action
  - Rollback state on exception
  - Publish exception notification on exception
  - Continue working after exception
- All 5 tests passing
- Create action-tracking-tests.cs in pipeline/ directory with 4 tests:
  - NotBeActive_Initially
  - TrackAction_DuringExecution
  - ReturnFalse_ForUnknownActionType
  - TrackMultipleActions_Independently
- Update testing-convention.cs to include TimeWarp.State.Plus assembly and ActiveActionBehavior
- Add ActionTracking and Purple namespaces to global-usings.cs
- Fix flaky store lifecycle test affected by test execution order
- All 4 action tracking tests passing
- Create tests/client-integration-tests/caching/ directory
- Add cacheable-state-tests.cs with 4 tests:
  - HaveNullCacheKey_Initially
  - SetCacheKey_AfterFetch
  - SetTimestamp_AfterFetch
  - ReturnCachedData_WhenCacheValid
- All 4 tests passing
- Create render-subscription-context-tests.cs in pipeline/ directory with 4 tests:
  - ReturnTrue_ForUnregisteredAction
  - ReturnFalse_WhenRegisteredWithFalse
  - ReturnTrue_WhenRegisteredWithTrue
  - ReturnTrue_AfterReset
- Add RenderSubscriptionContext property to BaseTest
- Add global using for TimeWarp.Features.RenderSubscriptions
- All 4 tests passing
Update package references to migrate from TimeWarp.Mediator to the
martinothamar/Mediator library:
- Directory.Packages.props: Add Mediator.Abstractions and Mediator.SourceGenerator 3.0.1
- timewarp-state.csproj: Replace TimeWarp.Mediator with Mediator packages
- test-app-contracts.csproj: Replace TimeWarp.Mediator with Mediator.Abstractions
- Use explicit versions (3.0.1) due to CPM NU1011 floating version restriction

Also standardize kanban placeholder files to .gitkeep convention
@StevenTCramer
StevenTCramer merged commit bf3990b into master Jan 22, 2026
2 of 3 checks passed
@StevenTCramer
StevenTCramer deleted the Cramer/2025-08-12/032migrate-from-mediatr-to-timewarp-mediator branch January 22, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant