-
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
Deprecate useBlockEditContext in favour of useBlockClientId #29309
Conversation
Size Change: +93 B (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
Not sure where to failures are coming from so splitting into smaller PRs to pinpoint. |
ce585e1
to
53eb9ce
Compare
👋 I think I've found the reason of the failure of the I'm not sure why this prop is now receiving the opposite value but it would be nice to investigate it further just in case it produces any undesired side effects. Regarding the failure, this uncovered a problem we have in the unit tests because the I'm going to open a PR adding the proper mock for the |
Upon further investigation I realised that the root cause of all the issues is related to how we calculate if a block is selected, specifically for the Previous to these changes, the value was passed through the block edit context which is not being used when running unit tests so that value was always Now as the value is fetched directly via the selector, it's returning a different value. The cause of this is that the blocks rendered within unit tests don't have a It would be nice if we add this case to the selector and check if the Apart from that I think the changes are safe from the mobile version perspective 🎊 . |
I created this PR that fixes the mentioned issue. |
👋 I created this PR that should fix the errors when running the native unit tests of this PR. My approach, as described in the PR, is to basically render the |
8b9505a
to
7d91aa2
Compare
@fluiddot I got rid of the problem by returning early in case there is no client ID: f0a0056#diff-d5252e488c7dc0d44aba3d01d607ba2d77100d56d7513d82fc3839142ecf6347R27 |
I'm afraid that won't fix all the errors because the problem is related to not having a defined The PR I made for fixing this is ready to merge so once the PR check passes, I'll merge it and you could include the changes in this branch. |
@ellatrix the fixes for the iOS e2e tests have been merged into |
7d91aa2
to
11efbe1
Compare
Description
Ideally the only piece of context is the block client ID and everything else is derived from that. Unfortunately
useBlockEditContext
is exported at the package level (not sure why because it's only used within the package), but it can be rewritten withuseSelect
.How has this been tested?
Screenshots
Types of changes
Checklist: