Skip to content

Performance: code-split markdown renderer, lazy-load on first interaction, Lighthouse CI gate #71

Description

@PAMulligan

Summary

Keep the host page fast by lazy-loading the chat panel and its heavy dependencies (markdown renderer, syntax highlighter) only when the user actually opens the widget. Lock in the win with a Lighthouse CI gate.

Motivation

The bubble itself should add near-zero overhead to the host page's TTI/LCP. The current bundle includes the markdown stack up-front; deferring it would meaningfully improve Lighthouse scores for sites embedding Claudius.

Acceptance Criteria

  • Initial bundle contains only the floating bubble + open trigger; the chat panel is dynamically imported on first open
  • Markdown renderer and any code-highlight bundle code-split out of the initial chunk
  • Prefetch on mouseenter of the bubble to mask the latency on intentional opens
  • Lighthouse CI runs on every PR against the playground site; fails if Performance score drops below 90
  • Bundle-size budget (issue: size-limit) updated to reflect the new initial chunk

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformancePerformance improvementswidgetChat widget UI and embed functionality

    Type

    No type

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions