Skip to content

Defer eager boot-service config data (feeds.ts, bases-expanded/military-surge, proto client) #4410

Description

@koala73

Follow-up to #4404 (closed). The lazy-only config-table deferrals are done (#4407/#4408/#4409, ~330 KB raw off the eager path). What remains is a different, harder class: large data pinned eager by eager boot services, not by lazy consumers. Each needs a behavioral refactor (lazy-load the table out of a synchronous boot path), so each is /ce-plan-worthy with real regression surface — not a clean lazy-cache like the shipped tables.

⚠️ Pursue only if a post-#4409 prod measurement shows a mobile LCP/TBT gap. If the ~330 KB already shipped hit the target, the risk here isn't worth it.

Targets

Module Raw Eager pin Why it's hard
config/feeds.ts ~99 KB App (source-cap / default-disabled), rss, correlation, breaking-news-alerts Feed catalog drives news fetch + settings + alerts at boot. Lazy-loading risks delaying first news / breaking settings. Likely needs a boot-critical vs deferrable split.
config/bases-expanded.ts (MILITARY_BASES_EXPANDED) ~47 KB data-loader → military-surge (findNearbyBases / analyzeFlightsForSurge / detectForeignMilitaryPresence) Sync surge / foreign-presence detection in the boot data-load cycle → empty until loaded. (Note: deferring the thin MILITARY_BASES export alone is a ~2.6 KB no-op — the weight is here, via military-surge.)
proto IntelligenceServiceClient (src/generated/client/.../intelligence/v1/service_client.ts) ~42 KB ~10 eager consumers (country-intel, cached-risk-scores, gdelt-intel, satellites, correlation-engine, social-velocity, security-advisories, …) using different RPC methods Generated gRPC client; "split for per-consumer tree-shaking" = codegen / generated-file surgery, uncertain payoff.

Out of scope (confirmed not deferrable)

panels.ts (~57 KB, panel-layout at boot), map-layer-definitions (~28 KB, sanitizeLayersForVariant() at App init), entities.ts (~20 KB, marginal + eager via cached-risk-scores).

Approach when prioritized

  1. Measure prod mobile LCP/TBT (median-of-3, cold, throttled) after perf(dashboard): defer geo-map table bulk off the eager path (#4404) #4409 deploys — establish the gap, if any.
  2. If a gap exists, /ce-plan the largest tractable target (likely feeds.ts via a boot-critical/deferrable catalog split).
  3. Per-target: lazy-load the table inside the eager service (empty-until-loaded + retryable, the perf(dashboard): defer the ai-datacenters config table off the eager path (#4404) #4408/perf(dashboard): defer geo-map table bulk off the eager path (#4404) #4409 pattern), verify build (off dashboard.html modulepreload, not imported by main, 0 circular chunks) + runtime (the boot feature still populates) + the deferred path on Vercel preview where API-gated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions