Skip to content

Reflex support#111

Merged
bazyleu merged 5 commits intomainfrom
feature/reflex-support
Mar 7, 2026
Merged

Reflex support#111
bazyleu merged 5 commits intomainfrom
feature/reflex-support

Conversation

@bazyleu
Copy link
Copy Markdown
Owner

@bazyleu bazyleu commented Mar 6, 2026

Complete full support of Reflex DI container
Resolves #99
Resolves #95

@bazyleu bazyleu self-assigned this Mar 6, 2026
@bazyleu bazyleu added the enhancement New feature or request label Mar 6, 2026
Copilot AI review requested due to automatic review settings March 6, 2026 21:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes the Reflex DI container integration for UniState, resolving GitHub issues #95 and #99. It refactors the existing experimental Reflex support to be production-ready (removing the experimental disclaimer from the README) and adds comprehensive test coverage mirroring what already existed for Zenject and VContainer.

Changes:

  • Core extension refactoring: ReflexBuildExtensions.cs is overhauled so AddState(Type) now registers a state against all its interfaces and itself (via a new GetStateContracts helper), and state machine registration is unified through a custom ReflexStateMachineResolver that handles both transient and singleton lifetimes with proper disposable tracking.
  • Full test suite: Eight new Reflex test classes are added (GoTo, GoBack, GoBackTo, Execution, BehaviorAttribute, History, Recovery, SubState), each backed by the new ReflexTestsBase helper class, matching coverage provided for Zenject and VContainer.
  • README update: Removes the "experimental" warning, adds a documentation note explaining the single- vs two-parameter AddState/AddSingletonState overloads, and updates the code example to use an abstract base class instead of an interface in the two-parameter overload (reflecting the actual new intended use case).

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
README.md Removes experimental disclaimer; adds documentation for new AddState behavior and corrects the two-parameter overload example
Assets/UniStateTests/PlayMode/UniStateTests.PlayMode.asmdef Adds Reflex assembly reference to the PlayMode test assembly
Assets/UniStateTests/Common/TestFixture/ReflexTestsBase.cs New base class for all Reflex tests; manages container setup/teardown and provides RunAndVerify helper
Assets/UniState/Runtime/Integrations/Reflex/ReflexBuildExtensions.cs Core refactoring: AddState now registers all interfaces, new ReflexStateMachineResolver handles lifetime and disposable management
Assets/UniStateTests/PlayMode/GoToStateTests/GoToReflexTests.cs New Reflex GoTo state test
Assets/UniStateTests/PlayMode/GoBackTests/GoBackReflexTests.cs New Reflex GoBack state test
Assets/UniStateTests/PlayMode/GoBackToTests/GoBackToReflexTests.cs New Reflex GoBackTo state test
Assets/UniStateTests/PlayMode/ExecutionTests/ExecutionReflexTests.cs New Reflex execution lifecycle test
Assets/UniStateTests/PlayMode/BehaviorAttributeTests/BehaviorAttributeReflexTests.cs New Reflex behavior attribute test
Assets/UniStateTests/PlayMode/HistoryTests/HistorySizeReflexTests.cs New Reflex history size test
Assets/UniStateTests/PlayMode/RecoveryTransitionTests/RecoveryReflexTests.cs New Reflex recovery transition test
Assets/UniStateTests/PlayMode/SubStateTests/SubStateReflexTests.cs New Reflex sub-state test
.meta files Unity asset tracking metadata for all new files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bazyleu bazyleu merged commit 2c0fa51 into main Mar 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reflex tests Reflex DI Integration

2 participants