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.
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
Check for allowed blocks recursively in patterns #30366
Check for allowed blocks recursively in patterns #30366
Changes from all commits
bd06b18
1d2a707
109c98b
b0e1c35
5038470
4cd5b4d
0c36222
6380fd0
d934014
cf1eaa6
c953c6f
eec6c1d
341b3ea
f83e430
6513185
854d9e9
3109b0d
7e7d9c3
fb6af97
70d80c2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm noting that if we leave off the boolean-blinded
true
as the default value, we can trap the exact condition in the response of "If this block was explicitly rejected" vs. "if this block wasn't explicitly allowed" (which is what we have at the moment)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that make any difference though? 🤔 This is the same way we use it in
canInsertBlockTypeUnmemoized
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it only impacts code readability, not behavior. I brought up the idea because the dangling
true
confused me, hence "boolean blindness."There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would we not want this to be recursive? Would it make sense to leave the call the same, that is,
checkAllowList
, instead of creating a new idea/term/function to call?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the
checkAllowList
incanInsertBlockTypeUnmemoized
. It was never a recursive function.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, I get that we might use this already, but is there a reason they shouldn't be recursive? It sounds like you identified an issue because it wasn't recursive, and do we end up with special rules for different circumstances?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not an issue. IncanInsertBlockTypeUnmemoized
only works with block types, so it can't work in a recursive way.Patterns are special in this case, since they contain multiple block types. We don't have any other way to insert multiple kinds of block types in a single action.That was my thought, but reusable blocks are pretty similar 🤔 Like saving a Group as reusable block and then inserting it. This needs more testing and we shouldn't do such a huge change to the core in this PR.