-
-
Notifications
You must be signed in to change notification settings - Fork 12
[2.x] Rewrite navigation internals #1568
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 2.x-dev #1568 +/- ##
============================================
Coverage 99.97% 99.97%
+ Complexity 3504 1775 -1729
============================================
Files 364 184 -180
Lines 9474 4791 -4683
============================================
- Hits 9472 4790 -4682
+ Misses 2 1 -1 ☔ View full report in Codecov by Sentry. |
a038839 to
ae98599
Compare
a294739 to
786bdf6
Compare
emmadesilva
commented
Feb 13, 2024
| * @covers \Hyde\Framework\HydeServiceProvider | ||
| * @covers \Hyde\Framework\Concerns\RegistersFileLocations | ||
| * @covers \Hyde\Foundation\Providers\ConfigurationServiceProvider | ||
| * @covers \Hyde\Foundation\Providers\NavigationServiceProvider |
Member
Author
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.
Should be in its own test
6515174 to
b617d88
Compare
emmadesilva
commented
Feb 13, 2024
packages/framework/src/Framework/Features/Navigation/NavItem.php
Outdated
Show resolved
Hide resolved
dfc8d29 to
1df9636
Compare
emmadesilva
commented
Feb 14, 2024
9515635 to
82ee80d
Compare
emmadesilva
commented
Feb 14, 2024
packages/framework/src/Framework/Features/Navigation/GeneratesMainNavigationMenu.php
Outdated
Show resolved
Hide resolved
emmadesilva
commented
Feb 14, 2024
packages/framework/src/Framework/Features/Navigation/NavItem.php
Outdated
Show resolved
Hide resolved
9469d52 to
f2becad
Compare
emmadesilva
commented
Feb 14, 2024
packages/framework/src/Framework/Features/Navigation/NavigationMenu.php
Outdated
Show resolved
Hide resolved
While the built-in views does not support it (and the generators won't use it), the group class itself now supports containing groups as it's children, allowing developers to utilise the system to create more complex navigation menus.
…-design [2.x] Extract trait for shared code with navigation menu class
This reverts commit 6b7cc4a.
This partially reverts commit bccde3d.
This reverts commit fa70254.
…-design [2.x] Merge trait back into menu class and make navigation groups extend the menu class
[2.x] Simplify and normalize public navigation APIs
d0bc2d4 to
cc2756e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TLDR: This breaks... everything. The entire Navigation API is essentially rewritten. The easiest way to upgrade is going to be reimplementing existing code from scratch.
New attempt at fixing #1508 after closing #1538. It targets HydePHP v2 #1565
With this, NavigationMenu classes are no longer responsible for generating the menus, instead the API is changed so that they are just data containers. This better follows SOLID principles, and changes the point where we generate the menus in a way that's more controllable.
This rewrites the navigation internals in a few breaking ways. (Note that this list may be incomplete/outdated, the final version will be present in the release notes)
docs.sidebar_ordertodocs.sidebar.orderdocs.table_of_contentstodocs.sidebar.table_of_contentsNavItem::fromRoute()method is nowNavItem::forRoute()docs.sidebar.footerno longer supportstrueas a valueNavigationMenutoMainNavigationMenuMainNavigationMenu(essentially replaced/rewritten to the newNavigationMenuclass)BaseNavigationMenuDropdownNavItemBaseNavigationMenu::$itemsprotectedNavItem::$destinationis now a Route instead of string (This is necessary in order to defer route resolving to compile time)DocumentationSidebar::getGroupsDocumentationSidebar::getItemsInGroupDocumentationSidebar::makeGroupTitleBaseNavigationMenuMainNavigationMenuDocumentationSidebarDropdownNavItemDocumentationSidebar::makeGroupTitle()DropdownNavItemfeatures into mainNavItemclassChanges:
NavItemclasses to manage dropdownsNavItem::dropdown()facade helpernullinstead of'other'#1572docs.sidebar_ordertodocs.sidebar.order#1583docs.table_of_contentstodocs.sidebar.table_of_contents#1584NavigationElementcontract #1640Since the navigation menu is now essentially cached in the kernel, instead of being created each time the component is rendered, the kernel must be cleared during some tests.