Migration and version notes for motion-v
Upgrading from v1 to v2
Breaking changes in v2.0.0, summarized from the official release notes:
- Gesture shorthand props
focus,hover,press,inViewwere removed. UsewhileFocus,whileHover,whilePress,whileInViewfor animation. Use event props likeonHoverStartandonPressStartfor logic. - CommonJS support was dropped. The package ships ESM (
.mjs) only. Confirmed by the exports map, package.json:20-33. AnimatePresencenow discovers children lazily through adata-apDOM attribute.MotionPlugin,createMotionDirective, andcreatePresetDirectivewere added for thev-motiondirective.motionGlobalConfigexport was added.- Later refinement in 2.2.1: the
data-apattribute is only added insideAnimatePresence, keeping other DOM clean.
Release notes: https://github.com/motiondivision/motion-vue/releases/tag/v2.0.0
Older v1 changes worth knowing when touching legacy code:
staggerChildrenandstaggerDirectiontransition options are deprecated since v1.4.0. Use thestagger()utility insidetransitioninstead, typically withdelayChildren.useScrollaccepts Vue refs forcontainerandtargetsince v1.6.0.
Changes from 2.2.1 to 2.4.4
Baseline of the previous Skill was 2.2.1. The prepared source is 2.4.4.
2.3.0
arc()enables motion along an arc. Use it astransition: { path: arc({ rotate: 90 }) }. The type layer pins thepathkey toMotionPathsoarc()is accepted (dist/es/types/state.d.ts:33-44).useAnimaterespectsMotionConfig skipAnimations. Release: https://github.com/motiondivision/motion-vue/releases/tag/v2.3.0
2.4.0
Reordersupports multidimensional reorder. Setaxis="xy"onReorder.Group. The axis type isx,y, orxy(dist/es/components/reorder/types.d.ts:2). Release: https://github.com/motiondivision/motion-vue/releases/tag/v2.4.0
2.4.1
- Layout fixes: promote and relegate are guarded by lead status.
MotionStatestrict mode type errors resolved. Release: https://github.com/motiondivision/motion-vue/releases/tag/v2.4.1
2.4.2
- Exit and enter animations work again for
KeepAlivecached components. If you skippedAnimatePresencearound cached views because of this, retry now. Release: https://github.com/motiondivision/motion-vue/releases/tag/v2.4.2
2.4.3
- Layout: stale root scroll cache is refreshed before shared node mount. Fixes wrong shared layout measurements after page scroll. Release: https://github.com/motiondivision/motion-vue/releases/tag/v2.4.3
2.4.4
- Nuxt module:
motion-vremoved from build transpile. Release: https://github.com/motiondivision/motion-vue/releases/tag/v2.4.4
Deprecations in current types
MotionConfigpropreduceMotionis deprecated. UsereducedMotion(dist/es/components/motion-config/types.d.ts:9-13).animationControls()is deprecated. UseuseAnimationControls()(dist/es/animation/hooks/animation-controls.d.ts:3-5).