Skip to content

refactor: extract resolveInitialValues to shared utility#238

Merged
rick-hup merged 1 commit into
masterfrom
refactor/extract-resolve-initial-values
Feb 13, 2026
Merged

refactor: extract resolveInitialValues to shared utility#238
rick-hup merged 1 commit into
masterfrom
refactor/extract-resolve-initial-values

Conversation

@rick-hup
Copy link
Copy Markdown
Collaborator

Summary

  • Extract resolveInitialValues into state/utils.ts as a shared function used by both MotionState constructor and SSR directive
  • Remove unnecessary MotionState instantiation in resolveSSRStyles — now resolves initial variant values directly
  • Remove private resolveInitialLatestValues method from MotionState class

Test plan

  • All 12 unit test files pass (71 tests)
  • Build succeeds
  • Verify SSR rendering in Nuxt playground produces correct initial styles

🤖 Generated with Claude Code

Avoid creating a full MotionState instance in resolveSSRStyles just to
get initial style values. Extract the variant resolution logic into a
shared resolveInitialValues function in state/utils.ts, used by both
MotionState constructor and the SSR directive path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rick-hup rick-hup merged commit 4b22392 into master Feb 13, 2026
2 checks passed
@rick-hup rick-hup deleted the refactor/extract-resolve-initial-values branch February 24, 2026 14:03
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