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

Components: remove Framer Motion #60975

Open
1 of 29 tasks
DaniGuardiola opened this issue Apr 22, 2024 · 4 comments
Open
1 of 29 tasks

Components: remove Framer Motion #60975

DaniGuardiola opened this issue Apr 22, 2024 · 4 comments
Assignees
Labels
[Feature] Component System WordPress component system [Package] Components /packages/components

Comments

@DaniGuardiola
Copy link
Contributor

DaniGuardiola commented Apr 22, 2024

This is a tracking issue. There has been some discussion of removing Framer Motion (the use of motion especially), citing a few arguments:

Current situation

Framer Motion is wrapped in the components package (packages/components/src/animation/index.tsx). A few utilities are re-exported from it, including the motion component.

Those wrappers are then used both internally and externally in a few places. This issue tracks those instances as we transition out of them.

Strategy

A good start would be removing all instance of internal usage within the components package.

In a second stage, external uses within Gutenberg could be removed as well.

Then, we should set the component as deprecated and nudge potential consumers (if any) towards either using CSS directly (preferred), using a lightweight alternative like motion.dev, or at least using framer-motion directly, as we don't want to officially support it anymore from the components package.

Finally, the re-exports should be deleted, or if we feel like an intermediate phase is useful, replaced by mock functions that throw errors asking users to migrate before completely deleting a few versions after.

Internal instances

External instances

@youknowriad
Copy link
Contributor

youknowriad commented Apr 22, 2024

If we are able to achieve the same results, I think that's fine but I think we should probably leave the deprecation as the last step after removing all usage in Gutenberg. We don't want core's codebase to trigger deprecation messages.

@DaniGuardiola
Copy link
Contributor Author

@youknowriad agreed, updated the strategy in the issue description.

@DaniGuardiola
Copy link
Contributor Author

Another reason: it seems like it won't support React 19 for a good while, as the maintainers have run into a lot of trouble

@diegohaz discussed this on the bird platform: https://x.com/diegohaz/status/1793164208571638155

@anomiex
Copy link
Contributor

anomiex commented Sep 9, 2024

I note that framer-motion v11.5.0 has deprecated their motion() function in favor of motion.create(). Given the plans in this issue to remove framer-motion entirely I don't know whether you'll want to fix that or ignore it / stick with 11.4.0 until this is completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Component System WordPress component system [Package] Components /packages/components
Projects
None yet
Development

No branches or pull requests

5 participants