Conversation
9a909e1 to
ea05b4b
Compare
There was a problem hiding this comment.
It's something that needs more updates, documentation need to be aligned:
https://github.com/WordPress/gutenberg/tree/master/packages/components/src/animateIn general, I agree with the sentiment but in practice it might start printing those depreciations in the JS console if its usage isn't updated in Gutenberg. So I would be very careful changing the public API. It also needs to be announced as Dev Note when a new version of WordPress is released so plugins could update.
There was a problem hiding this comment.
Thanks, @gziolo. What's required for a dev note?
|
I've been testing storybook and there's a regression I'll fix… |
|
Size Change: +93 B (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
This reverts commit 6e8d8b95fca0f30af4d85b2910f114c42917a930.
002608e to
263d043
Compare
|
I created a hook in #26201 with the intention of deprecating the |
|
Oh, and stabilise the animate hook of course. The reason I didn't do it in the other PR is that it wasn't clear to me what package it should be in. There's no hooks in the components package yet, and usually we add new hook to |
|
no strong opinions but the hook definitely look better in "components" because it has styles. |
Suggested here: #26965 (comment)
|
I'm working on the proposed alternative in #27123 |
Suggested here: #26965 (comment)
Suggested here: #26965 (comment)
Suggested here: #26965 (comment)
Description
Animatecomponent.Animatecomponent API.useAnimateaccepts anoptionsobject which is a stringtype+ some options based on the type.Animatecomponent acceptedtypeproperty (the same) anoptionsobject (the other options) and achildrenrender function property.The options prop doesn't correspond to
useAnimateoptions (it doesn't include the type) and there seems to be no benefit to wrapping the options in an object.Animatecan pass its props (excludingchildren) touseAnimate.Options are still accepted although deprecated and scheduled for removal in 9.6.
Supersedes #26176
I've replaced the usage in Gutenberg that I found (just one case).
I've also updated the Animate storybook. It now uses knobs to adjust the options on the fly.
How has this been tested?
Types pass.
Storybook examples work as expected.
Screenshots
When using
optionsprop, you'll see this deprecation warning (it says 9.4 but I've changed it to 9.6):Types of changes
New feature: Add types to the Animate component.
This change deprecates the
Animateoptions prop and schedules it to be removed in two releases: 9.6. It will be a breaking change when this is removed.Checklist: