-
Notifications
You must be signed in to change notification settings - Fork 57
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
refactor(file-router): make route with non-null children detected as a layout #2493
Conversation
Quality Gate passedIssues Measures |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2493 +/- ##
=======================================
Coverage 95.02% 95.02%
=======================================
Files 66 66
Lines 4546 4546
Branches 658 659 +1
=======================================
Hits 4320 4320
Misses 182 182
Partials 44 44
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
There is this method called isMainLayout
in the ClientRouteRegistry
which is dependent on the children to be not null (could be empty array, but not null) for deciding about an entry being a MainLayout. The correct detection of a MainLayout is critical for the Flow views to be added to the menu. A case comes to mind that an application has a MainLayout in Hilla, but no Hilla views, and only some Flow views. Is this changes currently supporting that?
Nope. I guess, I can just exclude it from filtering and add as a route |
Probably, adding an exception case for MainLayout is the best choice for the short term. TBH, this part is a bit messy regarding what should be on Hilla side, and what should be on Flow side, and there are some related changes introduced in the #2449. Anyway, IMO it's best not to break the currently agreed functionality. |
Hmm, maybe then it would be better to filter in the Hilla menu instead of a server? |
Or... It is about the menu display, right? So, we basically don't care if the layout is excluded from the menu but continue existing in the real routing. |
Seems so, as this line suggests: https://github.com/vaadin/hilla/pull/2493/files#diff-fd76ca650f85b66ff69dfdb7b1ff3248840101fef661307b71bb79bced728c10R90
|
So let me approve again, as according to my understanding, this change makes it more consistent, and the expectation for the main layout is fulfilled. |
Hi @Lodin and @taefi, when i performed cherry-pick to this commit to 24.4, i have encountered the following issue. Can you take a look and pick it manually? |
Fixes #2379.