Skip to content
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

Theme JSON: include block style variations in path only output of get_block_nodes #66948

Merged
merged 4 commits into from
Nov 13, 2024

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Nov 13, 2024

What?

Follow up to #66002

Including variations in the nodes array when 'include_node_paths_only' => true

Discussed here: https://github.com/WordPress/gutenberg/pull/66731/files#r1830311575

cc @mukeshpanchal27

Why?

#66002 added and $include_node_paths_only option to get_block_nodes() to improve performance.

When true this option tells the function to only return paths, and not selectors, for consumers that only needed paths to style values.

For one of the conditional blocks, block style variations wasn't included.

This PR adds them to the array of paths following the existing model $node[]['path' => [], 'variations' => ['path' => []]]

How?

Just adding the same loop but in the $include_node_paths_only condition block.

Testing Instructions

PHP unit tests should pass.
Smoke test the editor. Should be all 👍🏻

Including variations in the nodes array when 'include_node_paths_only' => true
@ramonjd ramonjd added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Nov 13, 2024
@ramonjd ramonjd self-assigned this Nov 13, 2024
Copy link

github-actions bot commented Nov 13, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

Flaky tests detected in 5a5a99b.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11810291831
📝 Reported issues:

Copy link
Contributor

@aaronrobertshaw aaronrobertshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this up @ramonjd 👍

✅ Unit tests are passing
✅ Variation paths in include_node_paths_only flow are now consistent
✅ Smoke tested mostly in TT5 focusing on block style variations etc. No issues found.

LGTM 🚢

@ramonjd
Copy link
Member Author

ramonjd commented Nov 13, 2024

Thanks for the quick review!

@ramonjd ramonjd merged commit d0a190b into trunk Nov 13, 2024
64 checks passed
@ramonjd ramonjd deleted the add/get_block_nodes-paths-only-variations branch November 13, 2024 22:59
@github-actions github-actions bot added this to the Gutenberg 19.8 milestone Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants