Skip to content

: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.

fix(web-analytics): load conversion recordings modal lazily (#112190)

posthog[bot]4bd400a9691e
diff --git a/frontend/bin/check-eager-graph.mjs b/frontend/bin/check-eager-graph.mjs
index 6cbeb0813e7f..68b34b9d6c2c 100644
--- a/frontend/bin/check-eager-graph.mjs
+++ b/frontend/bin/check-eager-graph.mjs
@@ -128,9 +128,12 @@ const ROOTS = [
{
root: 'src/scenes/dashboard/Dashboard.tsx',
label: 'dashboard scene',
- // 2026-10-01: 12.25 MiB (4720 files), linked stylesheet included. ~10% headroom.
- budgetBytes: 14_130_000,
- forbidden: [],
+ // 2026-10-05: 9.93 MiB (3517 files), linked stylesheet included. ~10% headroom.
+ budgetBytes: 11_450_000,
+ forbidden: [
+ // Neither scene plays recordings. A hit means a static import pulled the playlist and player onto it.
+ 'src/scenes/session-recordings/playlist/SessionRecordingsPlaylist.tsx',
+ ],
},
{
root: [
@@ -149,9 +152,12 @@ const ROOTS = [
{
root: 'src/scenes/activity/explore/EventsScene.tsx',
label: 'events scene',
- // 2026-10-01: 11.48 MiB (4382 files), linked stylesheet included. ~10% headroom.
- budgetBytes: 13_250_000,
- forbidden: [],
+ // 2026-10-05: 9.55 MiB (3371 files), linked stylesheet included. ~10% headroom.
+ budgetBytes: 11_020_000,
+ forbidden: [
+ // Neither scene plays recordings. A hit means a static import pulled the playlist and player onto it.
+ 'src/scenes/session-recordings/playlist/SessionRecordingsPlaylist.tsx',
+ ],
},
{
root: 'src/scenes/session-recordings/detail/SessionRecordingDetail.tsx',
diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/components/MarketingAnalyticsTable/MarketingAnalyticsTable.tsx b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/components/MarketingAnalyticsTable/MarketingAnalyticsTable.tsx
index 1a239a96097e..0231d962ef31 100644
--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/components/MarketingAnalyticsTable/MarketingAnalyticsTable.tsx
+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/components/MarketingAnalyticsTable/MarketingAnalyticsTable.tsx
@@ -1,12 +1,14 @@
import './MarketingAnalyticsTableStyleOverride.scss'
import { BuiltLogic, LogicWrapper, useActions, useValues } from 'kea'
-import { useId, useMemo, useState } from 'react'
+import { Suspense, useId, useMemo, useState } from 'react'
import { IconGear, IconInfo } from '@posthog/icons'
import { LemonButton, LemonInput, LemonSelect, Tooltip } from '@posthog/lemon-ui'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
+import { lazyWithRetry } from 'lib/utils/retryImport'
+import { DashboardModalLoading } from 'scenes/dashboard/DashboardModalLoading'
import { teamLogic } from 'scenes/teamLogic'
import { isSharedView } from '~/exporter/exporterViewLogic'
@@ -28,7 +30,6 @@ import { useMarketingAnalyticsPrecompute } from '~/scenes/marketing-analytics/us
import { webAnalyticsDataTableQueryContext } from '~/scenes/web-analytics/tiles/WebAnalyticsTile'
import { InsightLogicProps } from '~/types'
-import { ConversionRecordingsModal } from 'products/marketing_analytics/frontend/ConversionRecordingsModal'
import {
conversionRecordingsRequest,
conversionRecordingsTableQuery,
@@ -47,6 +48,13 @@ import {
import { AdLevelInfoBanner } from './AdLevelInfoBanner'
import { MarketingAnalyticsColumnConfigModal } from './MarketingAnalyticsColumnConfigModal'
+// The modal pulls in the recordings playlist and player, so keep it off the dashboard and events eager paths.
+const ConversionRecordingsModal = lazyWithRetry(() =>
+ import('products/marketing_analytics/frontend/ConversionRecordingsModal').then((module) => ({
+ default: module.ConversionRecordingsModal,
+ }))
+)
+
export type MarketingAnalyticsTableProps = {
query: DataTableNode
insightProps: InsightLogicProps
@@ -190,7 +198,11 @@ export const MarketingAnalyticsTable = ({
return (
<div className="bg-surface-primary">
- {recordings && <ConversionRecordingsModal {...recordings} onClose={() => setConversionRecordings(null)} />}
+ {recordings && (
+ <Suspense fallback={<DashboardModalLoading isOpen onClose={() => setConversionRecordings(null)} />}>
+ <ConversionRecordingsModal {...recordings} onClose={() => setConversionRecordings(null)} />
+ </Suspense>
+ )}
<div className="p-4 border-b border-border bg-bg-light">
<div className="flex flex-wrap gap-4 justify-between items-center">
<div className="flex items-center gap-2">