-
Notifications
You must be signed in to change notification settings - Fork 16
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
improve header loading process #2427
Conversation
const navLinksFromFlags = featureFlaggedNavLinkConfigs.reduce( | ||
(acc, link) => { | ||
const { flag = "" } = link; | ||
console.log("####", featureFlags[flag]); |
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.
console.log("####", featureFlags[flag]); |
Looks like this got left in here.
Looks good so far. I still see flickering in the navigation, even if the feature flag code is removed. I would think that Next could be more efficient about not needing to re-render navigation. Not going to look further into it myself for the time being. |
Pushing pause on this for now, may need to refactor the useFeatureFlags hook to get this working properly. |
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.
Approving with Aaron's note to remove the stray console
Summary
Fixes (unticketed)
Time to review: 15 mins
Changes proposed
updates to allow header nav items to remain consistent between page navigations.
Context for reviewers
because the list of nav items was being instantiated as empty on first render, when loading the layout on navigation, there would be a flicker of the nav, waiting for the items to be created on the second render. With this change, the nav will be rendered by default without any feature flagged items, and feature flagged items will appear on second render. There are implementations that could prevent flickering, but we'd have to implement feature flags or translation a little differently, I think.
Test steps
Additional information