Add client lifecycle handler registration boundary#124
Merged
Conversation
This was referenced May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the SDK-facing registration boundary for stateful client lifecycle handlers.
This introduces:
ClientLifecycleHandlerAvatarLifecycleRegistrationExt::register_client_lifecycle_handlerModContext/ModContextBackendplumbing for runtime implementationsThis is the SDK half of #123 and is needed before implementing bounded Vanilla client terrain intent aggregation in frevenengine/freven-vanilla#94.
Why
Vanilla block interaction currently uses stateless function hooks:
on_start_client(fn)on_tick_client(fn)That is not sufficient for small deterministic per-client-session state such as a bounded near-frame terrain intent cancel window. Using process-global state in Vanilla would be the wrong long-term boundary.
This PR adds a typed SDK registration surface so the runtime can own one mutable client lifecycle handler per mod/client session.
Boundaries
Validation
cargo +stable check --locked -p freven_avatar_apicargo +stable check --locked -p freven_world_apicargo +stable test --locked --workspacecargo +stable clippy --locked --workspace --all-targets -- -D warningscargo +stable fmt --all -- --checkgit --no-pager diff --checkRelated