Skip to content

Commit 05e3a06

Browse files
bloveclaude
andauthored
docs(chat): explain the dual ensureChatRootStyles path (unblocks demo redeploy) (#379)
* chore(docs): regenerate telemetry api-docs (unblocks deploy job) apps/website/content/docs/telemetry/api/api-docs.json drifted 19 lines on main — a recent telemetry change added a public API entry but didn't regenerate the docs. The `Verify generated API docs are committed` step in Website — lint / build has been failing on every push to main since, and that job gates the entire Deploy → Vercel job (which is the one that auto-deploys demo.cacheplane.ai + cacheplane.ai + cockpit.cacheplane.ai + examples.cacheplane.ai). Result: the demo has been stuck on a stale build despite the auto- deploy wiring being correct. Regenerated via `npm run generate-api- docs`; diff is purely additive (19 inserts, 0 deletes). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(chat): explain the dual ensureChatRootStyles path Document why we keep both the module-eval side-effect call AND the explicit constructor calls in the top-level chat compositions: the side-effect is the fast path for source-resolution consumers, the constructor calls are the guaranteed path for production-bundled consumers where tree-shaking can drop the side effect. Also: this commit's libs/ change unblocks the canonical-demo Vercel redeploy that's been stuck since v0.0.32 (the prior libs/ commits all failed CI's website-lint-build api-docs check; #377 fixed that but its diff didn't trigger demo_changed=true). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 917e5af commit 05e3a06

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

libs/chat/src/lib/styles/chat-tokens.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,4 +382,15 @@ export function ensureChatRootStyles(): void {
382382
// Auto-inject on module evaluation. Every chat component imports
383383
// `CHAT_HOST_TOKENS` from this file, so the first chat component to load
384384
// triggers this once. Safe to evaluate eagerly: idempotent + SSR-guarded.
385+
//
386+
// Note: this side-effect call is the "fast path" — it normally fires
387+
// during the first chat-component import on the client. But production
388+
// bundlers with aggressive tree-shaking can drop it if they treat the
389+
// published artifact as side-effect-free (the published `sideEffects`
390+
// field doesn't match the bundled fesm filename, and TS-path consumers
391+
// route through the source where it does match). The top-level chat
392+
// compositions (`ChatComponent`, `ChatPopupComponent`,
393+
// `ChatSidebarComponent`, `ChatDebugComponent`) also call this from
394+
// their constructors so the injection is guaranteed even when the
395+
// module-eval call gets stripped. Both paths are idempotent.
385396
ensureChatRootStyles();

0 commit comments

Comments
 (0)