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

Refactored rendering logic for nav block #33224

Closed

Conversation

pbking
Copy link
Contributor

@pbking pbking commented Jul 6, 2021

Description

Moved rendering logic from navigation.php to the navigation block's SSR
file. This was done so that all of the rendering logic lived inside of
the block and would be subject to the project lifecycle of the block
rather than that of the navigation editor.

How has this been tested?

Activate any theme leveraging __unstableLocation on a navigation block (such as Quadrat).
Note that the navigation block still appropriately renders navigation from the class menu location.

Ensure that the experimental Gutenberg menu editor continues to work as expected.

Types of changes

Code Refactor

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

Moved rendering logic from navigation.php to the navigation block's SSR
file.  This was done so that all of the rendering logic lived inside of
the block and would be subject to the project lifecycle of the block
rather than that of the navigation editor.
The __unstableLocation was removed from the collection of attributes
passed to the block renderer.  This was done to prevent an infinite loop
when __unstableLocation is used, but no menu is assigned to that
location.
@talldan
Copy link
Contributor

talldan commented Jul 7, 2021

I've worked on an alternative approach here - #33244.

@draganescu
Copy link
Contributor

Now that #33244 is merged we can close this one.

@draganescu draganescu closed this Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants