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
[Query block]: Add Posts List variation #26990
[Query block]: Add Posts List variation #26990
Changes from all commits
37e725c
01f5ed3
3c427c1
de7d6fa
920db6a
8412804
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
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 pretty unfortunate that it needs to be all duplicated here because of how the query object was shaped:
gutenberg/packages/block-library/src/query/block.json
Lines 12 to 23 in 9438924
It raises a question of whether all those settings shouldn't be top-level attributes. It's clearly out of scope for this PR but I wanted to mention it. I understand that it's simpler to pass
query
through context this way, but at the same time, we lose some benefits that more granular attributes provide, like type validation, the flexibility to change the default value without breaking backward compatibility, less metadata saved in the content when defaults are used. An interesting fact is that the Latest Posts block defines all attributes as top-level fields:gutenberg/packages/block-library/src/latest-posts/block.json
Lines 5 to 83 in d3fd39a
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.
Yeah, I know but this applies for all blocks with
object
properties. We had discussed that in my PR for this:#26162, but for back compat it was closed.This is something to consider for sure. With my work on Query, I don't think it will have many other properties, so a rework could be considered.