From bd54e17c5bf7b1298f6536826cce23d6c5483f69 Mon Sep 17 00:00:00 2001 From: anurag629 Date: Fri, 30 Oct 2026 08:33:44 +0530 Subject: [PATCH] chore(widget): raise the panel budget to 18 kB and the single file to 20 kB --- .size-limit.json | 4 ++-- CONTRIBUTING.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.size-limit.json b/.size-limit.json index 62cb3d72..2cd5f00a 100644 --- a/.size-limit.json +++ b/.size-limit.json @@ -8,7 +8,7 @@ { "name": "widget, chat panel (chatcops.panel.js, loaded on open)", "path": "packages/widget/dist/chatcops.panel.js", - "limit": "17 KB", + "limit": "18 KB", "gzip": true }, { @@ -20,7 +20,7 @@ { "name": "widget, single file (chatcops.full.min.js)", "path": "packages/widget/dist/chatcops.full.min.js", - "limit": "19 KB", + "limit": "20 KB", "gzip": true }, { diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8b8e9de0..29417f8c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -210,7 +210,7 @@ ANTHROPIC_API_KEY=sk-... npx tsx src/examples/express-server.ts `npx` downloads `tsx` the first time. -The widget has a size budget, gzipped: 5 kB for the script tag loader (`dist/chatcops.min.js`), 17 kB for the chat panel it loads when the chat opens (`dist/chatcops.panel.js`), 2 kB for the pre-chat form chunk, 19 kB for the single-file build (`dist/chatcops.full.min.js`) and 30 kB for the unminified ESM build. CI checks them with `pnpm size` after a build (limits in `.size-limit.json`). To save bytes, the minifier renames the private class members listed in `packages/widget/mangle.ts`. A name can go on that list only if the code touches it through `this` and nowhere else, which `tests/mangle.test.ts` checks. A config field, a request body key or a DOM property renamed there would break only the CDN build. +The widget has a size budget, gzipped: 5 kB for the script tag loader (`dist/chatcops.min.js`), 18 kB for the chat panel it loads when the chat opens (`dist/chatcops.panel.js`), 2 kB for the pre-chat form chunk, 20 kB for the single-file build (`dist/chatcops.full.min.js`) and 30 kB for the unminified ESM build. CI checks them with `pnpm size` after a build (limits in `.size-limit.json`). To save bytes, the minifier renames the private class members listed in `packages/widget/mangle.ts`. A name can go on that list only if the code touches it through `this` and nowhere else, which `tests/mangle.test.ts` checks. A config field, a request body key or a DOM property renamed there would break only the CDN build. ### Browser tests