[RNMobile] Remove unneeded memoization dependency from useBlockEditorSettings#35289
Merged
Merged
Conversation
|
Size Change: -2 B (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
getdave
reviewed
Oct 1, 2021
Contributor
Author
I haven't tested thoroughly but I followed the testing instructions from #35083 and verified that the feature works (@getdave amazing work there btw, the feature is awesome 🎊 ). |
2 tasks
guarani
approved these changes
Oct 1, 2021
Contributor
guarani
left a comment
There was a problem hiding this comment.
Tested on iOS and Android and all looks good 👍
guarani
pushed a commit
that referenced
this pull request
Oct 1, 2021
guarani
pushed a commit
that referenced
this pull request
Oct 6, 2021
* Release script: Update react-native-editor version to 1.63.0 * Release script: Update with changes from 'npm run core preios' * Update react-native-editor changlog for 1.63.0 * [RNMobile] Remove unneeded memoization dependency from useBlockEditorSettings (#35289) Co-authored-by: Carlos Garcia <fluiddot@gmail.com>
dcalhoun
added a commit
that referenced
this pull request
Oct 13, 2021
* Release script: Update react-native-editor version to 1.63.0 * Release script: Update with changes from 'npm run core preios' * Update react-native-editor changlog for 1.63.0 * [RNMobile] Remove unneeded memoization dependency from useBlockEditorSettings (#35289) * Release script: Update react-native-editor version to 1.63.1 * Release script: Update with changes from 'npm run core preios' * Fix overflowing content for native Help screen (#35552) * Fix overflowing content for Help screen When navigating to a Help section child screen, the parent screen would remain visible outside of the container. Hiding the overflow of the containing element fixes this. The reason this occurred for the first time now is likely because it is the first time we have utilized the default navigation transitions for the platforms, which is provided by React Navigation. This means the screen animates from right to left on iOS, rather than a cross-fade. * Update change log * Fix invisible bottom sheet backdrop on Android (#35557) * Fix invisible bottom sheet backdrop on Android Animating the opacity for the initial modal results in the backdrop provided by `react-native-modal` to never transition from transparent to partially opaque black. The core issue was not idenfited, but it may relate to the experimental state of LayoutAnimation for Android. https://reactnative.dev/docs/layoutanimation * Update change log * Empty commit to trigger rebuilds Attempt to resolve flaky, failing e2e tests. Co-authored-by: Paul Von Schrottky <paul.von.schrottky@automattic.com> Co-authored-by: Carlos Garcia <fluiddot@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gutenberg Mobile PR: wordpress-mobile/gutenberg-mobile#4064
Fixes #35283
Description
This PR removes the dependency
createPageEntityrecently introduced in #35083 from the array of dependencies of theuseMemofunction used inuseBlockEditorSettings. The reason for this change is that the value ofcreatePageEntityis a function that is created on every call touseBlockEditorSettings, so the memoized value will be recomputed on every call as well.gutenberg/packages/editor/src/components/provider/use-block-editor-settings.js
Lines 81 to 88 in d079ba2
I couldn't find why this was producing the issue described here, as far as I investigated, it looks related to a potential race condition issue between the force render triggered by
useSelectand theEditorProviderre-renders. Before applying this change, when switching to visual mode after having modified the HTML produces the following trace:stopEditingis called when switching back to visual mode.gutenberg/packages/components/src/mobile/html-text-input/index.native.js
Lines 68 to 73 in e441367
onPersistis called and dispatches theresetEditorBlocksaction that internally dispatches theeditPostaction with the blocks modified from the HTML changes.gutenberg/packages/components/src/mobile/html-text-input/index.native.js
Lines 136 to 139 in e441367
gutenberg/packages/editor/src/store/actions.js
Lines 564 to 606 in e441367
EditorProviderwe use the hookuseEntityBlockEditorto get fetch the blocks that will be rendered in the editor.gutenberg/packages/editor/src/components/provider/index.js
Lines 46 to 50 in e441367
useEntityBlockEditorwe use theuseSelecthook to get the new blocks of the post from the state. At this point by debugging the code, I verified that themapSelectfunction passed to the hook, it was being called due to theeditPostaction, however, theblocksvalue returned by the hook were the old ones previous to the HTML modification 🙃 .Code reference
How has this been tested?
Verify that HTML changes in HTML mode are reflected when going back to visual mode
<p>element.Verify that "Enable ability to create Pages from the inline Link UI" feature is not broken
Follow the testing steps described in #35083.
Screenshots
N/A
Types of changes
Bug fix
Checklist:
*.native.jsfiles for terms that need renaming or removal).