Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Update SlotFillProvider to the new context API #11123
To be merged after #11314 lands.
This PR updates the SlotFillProvider to the stable React's context API.
I'd rather have this upgrade in 5.0. Using legacy APIs inside Gutenberg justifies its use within third-party (plugins, etc), which are a lot harder to migrate. Also, when we upgrade React we might end doing things differently (hooks anyone? where
Wanted to note that this PR is blocked until the tests are fixed.
The reason why they fail is that we are using an old version of enzyme that doesn't support the new React Context API. Updating
referenced this pull request
Oct 30, 2018
It would be nice to move all test updates to their own PR. Ensure it works with
master and then upgrade Slot and Fill to the new Context API. Otherwise, it's not that obvious if we didn't break anything.
I also would love to avoid using snapshots for
Slot tests as they become very hard to reason after changes introduced. In general they are awesome for UI components, but
Slot is more container which doesn't care as much about UI but to ensure that all fills are properly rendered.