Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: separate component logic, add <MotionGroup> and tests #187

Merged

Conversation

BobbieGoede
Copy link
Member

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme or JSDoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This is both the continuation and replacement of #186, after a closer look it appeared that the <Motion> component broke by the dependency updates. As mentioned there, these changes resolve #45, and remove a type (SVGAttributes in MotoonProperties type) of which I'm not sure what the impact is on existing projects.

Since the <Motion> component isn't really documented at the moment I figured it would be safe to give it a refactor and see if some changes could be made. I separated its logic and added another component <MotionGroup>, this component is used when wanting to apply motion configuration on its child nodes/slots, which I removed from the <Motion> component, this makes it possible to no longer require is property as well. Please let me know if you have any feedback!

I spent some time to figure out how to test both the v-motion directive as well as the <Motion> component, hopefully we can expand on it more to keep things stable as we make changes.

📝 Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

@BobbieGoede BobbieGoede self-assigned this Apr 21, 2024
Copy link
Member

@Tahul Tahul left a comment

Choose a reason for hiding this comment

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

This is really great ; amazing work as always @BobbieGoede :)

Should we document the component now that you even tested it?

@BobbieGoede
Copy link
Member Author

This is really great ; amazing work as always @BobbieGoede :)

Should we document the component now that you even tested it?

@Tahul
I would like to fix the visibility variant tests before documenting it, which I'll do in a separate PR!

Also, while I was writing tests I noticed the onComplete function is called on completion for each animated property (see https://github.com/vueuse/motion/pull/187/files#diff-a7b34acf51de8436e2ca88b53a6aedbe534a5e0fba8949e24a8a820157843a6cR42-R46), shouldn't this happen just once for the variant itself?

@BobbieGoede BobbieGoede merged commit 5e2346a into vueuse:main Apr 25, 2024
5 checks passed
@BobbieGoede BobbieGoede deleted the fix/motion-component-not-rendering branch April 25, 2024 08:47
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.

feat(docs): algolia doc search
2 participants