:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
perf(frontend): load the support side panel on demand (#105130)
Paul D'Ambra34906dfaf973
diff --git a/frontend/src/layout/navigation-3000/sidepanel/SidePanel.tsx b/frontend/src/layout/navigation-3000/sidepanel/SidePanel.tsxindex 3fe0346dd462..5b5f826150f9 100644--- a/frontend/src/layout/navigation-3000/sidepanel/SidePanel.tsx+++ b/frontend/src/layout/navigation-3000/sidepanel/SidePanel.tsx@@ -10,10 +10,15 @@ import { ResizerLogicProps, resizerLogic } from 'lib/components/Resizer/resizerLimport { Spinner } from 'lib/lemon-ui/Spinner'import { cn } from 'lib/utils/css-classes'import { lazyWithRetry } from 'lib/utils/retryImport'+import { ChunkLoadErrorBoundary } from 'scenes/ChunkLoadErrorBoundary'const NotebookPanel = lazyWithRetry(() =>import('scenes/notebooks/NotebookPanel/NotebookPanel').then((m) => ({ default: m.NotebookPanel })))+// The support panel renders the ticket editor, which pulls in tiptap extensions and lowlight.+const SidePanelSupport = lazyWithRetry(() =>+ import('./panels/support/SidePanelSupport').then((m) => ({ default: m.SidePanelSupport }))+)import { useWindowSize } from 'lib/hooks/useWindowSize'@@ -31,7 +36,6 @@ import { SidePanelDiscussion, SidePanelDiscussionIcon } from './panels/discussioimport { SidePanelExports, SidePanelExportsIcon } from './panels/exports/SidePanelExports'import { SidePanelInfo, SidePanelInfoIcon } from './panels/info/SidePanelInfo'import { SidePanelMax } from './panels/max/SidePanelMax'-import { SidePanelSupport } from './panels/support/SidePanelSupport'import { sidePanelLogic } from './sidePanelLogic'import { SidePanelNavigation } from './SidePanelNavigation'import { sidePanelStateLogic } from './sidePanelStateLogic'@@ -192,9 +196,12 @@ export function SidePanel({ className }: { className?: string }): JSX.Element |{PanelContent && (<SidePanelNavigation activeTab={activeTab as SidePanelTab} onTabChange={(tab) => openSidePanel(tab)}><ErrorBoundary>- <Suspense fallback={<Spinner className="text-4xl mx-auto mt-16" />}>- <PanelContent />- </Suspense>+ {/* Keep chunk-load failures out of the panel error reporter so stale assets reload once instead. */}+ <ChunkLoadErrorBoundary>+ <Suspense fallback={<Spinner className="text-4xl mx-auto mt-16" />}>+ <PanelContent />+ </Suspense>+ </ChunkLoadErrorBoundary></ErrorBoundary></SidePanelNavigation>)}