Conversation
|
Size Change: +1.52 kB (0%) Total Size: 1.43 MB
ℹ️ View Unchanged
|
Why does this happen though? Is it a bug/oversight? Should we fix at source? |
|
Looks like I would like to know why One reason might be if |
|
On further investigation _locale is actually added to both requests, so I think this can be merged if we think the change to useEntityRecords is cleaner? |
|
Flaky tests detected in 66927ec. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5545301978
|
3bf7694 to
6929278
Compare
useEntityRecords so that we only need to preload one endpoint|
I changed the purpose of this PR to be focussed on a refactor rather than preloading. |
| const permissions = useResourcePermissions( 'navigation', ref ); | ||
|
|
||
| return useSelect( | ||
| const useSelectResult = useSelect( |
There was a problem hiding this comment.
I think you should just extract the vars here. This const isn't a typical pattern and it's not even warranted now the result of the useSelect is much reduced by recent changes to this PR.
…dd/defer-script-loading-strategy * 'trunk' of https://github.com/WordPress/gutenberg: (24 commits) Add filter to turn off Interactivity API for a block (#52579) Search: Remove unnecessary useEffect (#52604) Navigation: Simplify the useSelect for useNavigationMenus (#51977) Item: Unify focus style and add default font styles (#52495) Update Changelog for 16.2.1 Bump plugin version to 16.2.1 Avoid passing undefined `selectedBlockClientId` in `BlockActionsMenu` (#52595) Cover Block: Fix block deprecation when fixed background is enabled (#51612) Nav block: link text color inheritance fixes and tests (#51710) Stabilize defaultBlock, directInsert API's and getDirectInsertBlock selector (#52083) Fix console warning by improving error handling in Nav block classic menu conversion (#52591) Fix: Remove link action of Link UI for draft pages created from Nav block does not correctly remove link. (#52415) Lodash: Remove remaining `_.get()` from block editor and deprecate (#52561) Fix importing classic menus (#52573) ResizableFrame: Make keyboard accessible (#52443) Site Editor: Fix navigation menu sidebar actions order and label (#52592) correct a typo: sapce -> space (#52578) Avoid errors in Dimension visualizers when switching between iframed and non-iframed editors (#52588) Patterns: Add client side pagination to patterns list (#52538) Site Editor: Make sidebar back button go *back* instead of *up* if possible (#52456) ...
What?
The useSelect for useNavigationMenus is unnecessarily complex - this simplifies it.
Why?
Makes the code easier to read and change.
How?
Refactoring.
Testing Instructions
Check that the navigation block continues to behave as before
Check the tests pass