-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Comments
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. |
@youknowriad agreed, updated the strategy in the issue description. |
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 |
I note that |
This is a tracking issue. There has been some discussion of removing Framer Motion (the use of
motion
especially), citing a few arguments:motion
component is 40.2kb or about x13 productionreact
s (all gzipped and minified!).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 themotion
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
DropZone
#62044 in progress by @fullofcaffeine)gutenberg/packages/components/src/drop-zone/index.tsx
Lines 21 to 24 in e8878c1
gutenberg/packages/components/src/snackbar/list.tsx
Lines 16 to 19 in e8878c1
gutenberg/packages/components/src/popover/utils.ts
Line 5 in e8878c1
gutenberg/packages/components/src/toggle-group-control/toggle-group-control/component.tsx
Line 6 in e8878c1
gutenberg/packages/components/src/toggle-group-control/toggle-group-control-option-base/component.tsx
Line 8 in e8878c1
External instances
block-editor
gutenberg/packages/block-editor/src/components/block-inspector/index.js
Line 10 in e8878c1
gutenberg/packages/block-editor/src/components/block-popover/drop-zone.js
Line 6 in e8878c1
gutenberg/packages/block-editor/src/components/block-tools/insertion-point.js
Line 11 in e8878c1
gutenberg/packages/block-editor/src/components/inspector-controls/slot.js
Line 6 in e8878c1
gutenberg/packages/block-editor/src/components/link-control/settings-drawer.js
Lines 6 to 7 in e8878c1
edit-post
gutenberg/packages/edit-post/src/components/header/index.js
Line 18 in e8878c1
gutenberg/packages/edit-post/src/components/header/fullscreen-mode-close/index.js
Line 13 in e8878c1
edit-site
gutenberg/packages/edit-site/src/components/editor/index.js
Lines 12 to 13 in e8878c1
gutenberg/packages/edit-site/src/components/global-styles/highlighted-colors.js
Line 4 in e8878c1
gutenberg/packages/edit-site/src/components/global-styles/preview-colors.js
Line 6 in e8878c1
gutenberg/packages/edit-site/src/components/global-styles/preview-iframe.js
Line 9 in e8878c1
gutenberg/packages/edit-site/src/components/global-styles/preview-styles.js
Line 8 in e8878c1
gutenberg/packages/edit-site/src/components/global-styles/typography-example.js
Line 5 in e8878c1
gutenberg/packages/edit-site/src/components/header-edit-mode/index.js
Line 13 in e8878c1
gutenberg/packages/edit-site/src/components/layout/index.js
Lines 11 to 12 in e8878c1
gutenberg/packages/edit-site/src/components/resizable-frame/index.js
Line 13 in e8878c1
gutenberg/packages/edit-site/src/components/site-hub/index.js
Lines 12 to 13 in e8878c1
editor
gutenberg/packages/editor/src/components/document-bar/index.js
Lines 14 to 15 in e8878c1
gutenberg/packages/editor/src/components/post-publish-panel/maybe-upload-media.js
Lines 8 to 9 in e8878c1
interface
gutenberg/packages/interface/src/components/complementary-area/index.js
Lines 14 to 15 in e8878c1
gutenberg/packages/interface/src/components/interface-skeleton/index.js
Lines 12 to 13 in e8878c1
The text was updated successfully, but these errors were encountered: