Skip to content

Fix compatibility issue with Reflex 14.3.0#116

Merged
bazyleu merged 1 commit intomainfrom
feature/reflex-new-version-support
Apr 4, 2026
Merged

Fix compatibility issue with Reflex 14.3.0#116
bazyleu merged 1 commit intomainfrom
feature/reflex-new-version-support

Conversation

@bazyleu
Copy link
Copy Markdown
Owner

@bazyleu bazyleu commented Apr 4, 2026

Resolves #114 #115

@bazyleu bazyleu self-assigned this Apr 4, 2026
@bazyleu bazyleu added the bug Something isn't working label Apr 4, 2026
Copilot AI review requested due to automatic review settings April 4, 2026 15:22
@bazyleu bazyleu merged commit 6f0bf6f into main Apr 4, 2026
5 checks passed
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

Updates UniState’s Reflex integration to compile and work against Reflex 14.3.0, addressing the interface/API changes introduced in Reflex 14.x (per issues #114 and #115).

Changes:

  • Bump Reflex dependency from 11.0.0 to 14.3.0 in Unity package manifest + lockfile.
  • Replace legacy AddState*/AddSingleton* binding helpers with RegisterState*/RegisterStateMachine* APIs (keeping the old names as [Obsolete] wrappers).
  • Update Reflex-based examples and playmode tests to use the new registration APIs and required enums (Lifetime, Resolution).

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Updates Reflex DI registration documentation to use RegisterState* / RegisterStateMachine* and Lifetime.
Packages/packages-lock.json Locks Reflex to git tag 14.3.0.
Packages/manifest.json Updates Reflex dependency to 14.3.0.
Assets/UniStateTests/PlayMode/SubStateTests/SubStateReflexTests.cs Migrates test bindings to RegisterState* APIs.
Assets/UniStateTests/PlayMode/RecoveryTransitionTests/RecoveryReflexTests.cs Migrates bindings and registers helper via RegisterType(..., Lifetime, Resolution).
Assets/UniStateTests/PlayMode/HistoryTests/HistorySizeReflexTests.cs Migrates bindings and registers helper via RegisterType(..., Lifetime, Resolution).
Assets/UniStateTests/PlayMode/GoToStateTests/GoToReflexTests.cs Migrates bindings to RegisterState* APIs.
Assets/UniStateTests/PlayMode/GoBackToTests/GoBackToReflexTests.cs Migrates bindings and registers helper via RegisterType(..., Lifetime, Resolution).
Assets/UniStateTests/PlayMode/GoBackTests/GoBackReflexTests.cs Migrates bindings and registers helper via RegisterType(..., Lifetime, Resolution).
Assets/UniStateTests/PlayMode/ExecutionTests/ExecutionReflexTests.cs Migrates bindings and registers helper via RegisterType(..., Lifetime, Resolution).
Assets/UniStateTests/PlayMode/BehaviorAttributeTests/BehaviorAttributeReflexTests.cs Migrates bindings and registers helper via RegisterType(..., Lifetime, Resolution).
Assets/UniStateTests/Common/TestFixture/ReflexTestsBase.cs Migrates base fixture logger registration to RegisterType(..., Lifetime, Resolution).
Assets/UniState/Runtime/Integrations/Reflex/ReflexBuildExtensions.cs Implements new RegisterState* / RegisterStateMachine* helpers and adds [Obsolete] wrappers for old APIs.
Assets/Examples/Infrastructure/Reflex/DiceInstaller.cs Updates example installer registrations to new APIs (including factory registration).

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

_lifetime = lifetime;
throw new ArgumentException(
$"RegisterStateMachine<{stateMachineImplementation.Name}>: Type parameters must differ : " +
"use RegisterStateMachine() where stateMachineImplementation implements stateMachineContract.\");");
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The ArgumentException message for the stateMachineImplementation == stateMachineContract case contains stray escaped characters (\");");) that will show up in the runtime error text and make it confusing. Clean up the string literal so the message reads as intended (and doesn’t include leftover quotes/parentheses/semicolons).

Suggested change
"use RegisterStateMachine() where stateMachineImplementation implements stateMachineContract.\");");
"use RegisterStateMachine() where stateMachineImplementation implements stateMachineContract.");

Copilot uses AI. Check for mistakes.
{
throw new ArgumentException(
$"AddState({state.Name}): Type parameter state must implement IState<TPayload>");
$"RegisterState({state.Name}): Type parameter state must implement IState<TPayload>");
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

ValidateStateBindingInput(Type state) checks IExecutableState, but the thrown message says the type must implement IState<TPayload>. Since non-IState<TPayload> types can still be valid IExecutableState (e.g., sub-state containers), the message is misleading—update it to reference IExecutableState (or whatever the actual required contract is).

Suggested change
$"RegisterState({state.Name}): Type parameter state must implement IState<TPayload>");
$"RegisterState({state.Name}): Type parameter state must implement IExecutableState.");

Copilot uses AI. Check for mistakes.
@bazyleu
Copy link
Copy Markdown
Owner Author

bazyleu commented Apr 4, 2026

@copilot apply changes based on the comments in this thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compilation Issues with Latest Version of Reflex

2 participants