Skip to content

Commit 7ce3e97

Browse files
committed
fix: type inconsistency in layoutDependency prop
1 parent 5b8eabd commit 7ce3e97

File tree

3 files changed

+175
-210
lines changed

3 files changed

+175
-210
lines changed

CLAUDE.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
Motion for Vue is a Vue.js port of Framer Motion, providing declarative animations with a hybrid engine combining JavaScript animations and native browser APIs. The library exports components like `motion`, `AnimatePresence`, `LayoutGroup`, `MotionConfig`, and `Reorder` for creating animations, gestures, and layout transitions.
8+
9+
## Key Commands
10+
11+
### Development
12+
- `pnpm dev` - Start development watch mode for motion package
13+
- `pnpm build` - Build the motion package and plugins
14+
- `pnpm test` - Run unit tests for motion package
15+
- `pnpm test:e2e` - Run Playwright end-to-end tests
16+
- `pnpm play` - Start the Nuxt playground for interactive testing
17+
18+
### Documentation
19+
- `pnpm docs:dev` - Start documentation development server
20+
- `pnpm docs:build` - Build documentation site
21+
22+
### Testing
23+
- Single test: `pnpm --filter motion-v test [test-file-name]`
24+
- Coverage: `pnpm --filter motion-v coverage`
25+
- E2E UI: `pnpm test:e2e:ui`
26+
27+
### Linting & Formatting
28+
- ESLint is configured to run automatically on pre-commit via git hooks
29+
- Manual lint: Files are automatically fixed on commit
30+
31+
## Architecture
32+
33+
### Package Structure
34+
The monorepo contains three main packages:
35+
- `packages/motion/` - Core motion library (published as `motion-v`)
36+
- `packages/plugins/` - Nuxt module and resolver for unplugin-vue-components
37+
- `playground/` - Testing environments (Nuxt and Vite playgrounds)
38+
39+
### Core Components Architecture
40+
Motion components are built on top of Framer Motion's core, with Vue-specific adaptations:
41+
42+
1. **Motion Component System** (`packages/motion/src/components/motion/`)
43+
- Creates motion-enabled HTML/SVG elements using dynamic component rendering
44+
- Manages animation state through `useMotionState` composable
45+
- Handles variant propagation and gesture features
46+
47+
2. **Visual Element State** (`packages/motion/src/state/`)
48+
- Creates and manages visual elements with projection nodes for layout animations
49+
- Handles style transformations and animation lifecycles
50+
- Integrates with Framer Motion's store system
51+
52+
3. **Feature System** (`packages/motion/src/features/`)
53+
- Modular feature loading (gestures, animations, layout)
54+
- Each feature extends the visual element with specific capabilities
55+
- Gesture features include drag, hover, press, pan, and in-view detection
56+
57+
4. **Animation Controls** (`packages/motion/src/animation/`)
58+
- Provides imperative animation controls via `useAnimationControls`
59+
- Manages animation sequencing and orchestration across components
60+
61+
5. **Layout Animations** (`packages/motion/src/features/layout/`)
62+
- Handles shared layout animations between components
63+
- Manages projection nodes for FLIP animations
64+
- Supports layout groups for coordinated animations
65+
66+
### Build Configuration
67+
- Uses Vite for building with separate ES and CJS outputs
68+
- Includes complex path aliasing for Framer Motion internals
69+
- Post-build step triggers plugin builds automatically
70+
71+
### Testing Strategy
72+
- Unit tests use Vitest with Vue Test Utils in JSDOM environment
73+
- E2E tests use Playwright for browser-based testing
74+
- Test files are co-located with source code in `__tests__` directories
75+
76+
## Important Implementation Notes
77+
78+
1. **Framer Motion Integration**: The library wraps Framer Motion's core functionality, requiring careful path aliasing to specific internal modules.
79+
80+
2. **Component Rendering**: Motion components use Vue's dynamic component system with render functions to create motion-enabled elements.
81+
82+
3. **State Management**: Visual element state is managed through a combination of Vue reactivity and Framer Motion's store system.
83+
84+
4. **Gesture Handling**: Gesture features are implemented as composables that attach event listeners and manage interaction state.
85+
86+
5. **Performance**: The library uses lazy loading for features and optimizes re-renders through careful state management.
87+
88+
## Development Workflow
89+
90+
1. Always run `pnpm build` after modifying the motion package before testing in playground
91+
2. Use the playground environments to test changes interactively
92+
3. Add tests for new features in the appropriate `__tests__` directory
93+
4. Ensure commits follow conventional commit format (enforced by commitlint)

packages/motion/src/components/motion/props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const MotionComponentProps = {
5252
'layoutRoot': { type: Boolean, default: false },
5353
'data-framer-portal-id': { type: String },
5454
'crossfade': { type: Boolean, default: true },
55-
'layoutDependency': { type: [String, Number, Object, Array] },
55+
'layoutDependency': { type: null },
5656
'onBeforeLayoutMeasure': { type: Function },
5757
'onLayoutMeasure': { type: Function },
5858
'onLayoutAnimationStart': { type: Function },

0 commit comments

Comments
 (0)