fix(core): lazy-load usePopover in SideNavHeading (#264)#4310
Open
jibin7jose wants to merge 1 commit into
Open
fix(core): lazy-load usePopover in SideNavHeading (#264)#4310jibin7jose wants to merge 1 commit into
jibin7jose wants to merge 1 commit into
Conversation
jibin7jose
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
July 25, 2026 04:54
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
July 25, 2026 04:54
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
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.
Summary
This PR resolves issue #264 by lazy-loading the heavy
usePopoverand Layer engine resources inside theSideNavHeadingcomponent.Changes Made
SideNavHeading.stylex.tsto prevent circular dependencies.SideNavHeadingStatic.tsx.SideNavHeadingWithMenu.tsx.SideNavHeading.tsxto conditionally loadSideNavHeadingWithMenuusing Reactlazy()and<Suspense>, falling back to the static rendering logic if nomenuprop is provided.Impact
Previously,
SideNavHeadingeagerly imported the Popover engine, bloating the initial bundle size for all users—even when no menu was provided. With this change, applications that use a simple, static SideNav without menus will completely skip downloading the popover logic, resulting in a much smaller bundle size and faster load times.Fixes #264