Block Editor: Consider RECEIVE_BLOCKS as non-persistent change#14108
Merged
Block Editor: Consider RECEIVE_BLOCKS as non-persistent change#14108
Conversation
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.
This pull request seeks to update the block editor's
withPersistentBlockChangeto considerRECEIVE_BLOCKSas a non-persistent change. This is intended to mimic the equivalent behavior which had existed prior to #13088, where the block editor dispatches aRECEIVE_BLOCKSaction when receiving reusable blocks. The data for reusable blocks is kept alongside other blocks data, though changes to this data should not be interpreted as the result of a user interaction.It's hoped that these changes should bring some improved stability "Undo" end-to-end tests, where on a hunch I suspect the failures may be a result of delayed responses from reusable blocks fetch which occurs upon focusing a paragraph block (from the blocks autocomplete inserter). (Related Slack conversation)
As noted at #13088 (comment) , the separation of reusable blocks across the
editorandblock-editormodules does not seem cohesive. As described above, the blocks data for reusable blocks is kept in the block editor'sstate.blocksstate, but is cross-referenced on the editor module'sreusableBlocksstate.