From 09a4ec641b6c3779470a2a09a923267e040ff9f3 Mon Sep 17 00:00:00 2001 From: anurag629 Date: Sat, 31 Oct 2026 07:37:19 +0530 Subject: [PATCH] ci: room in the widget budgets for the reply actions and the header menu --- .size-limit.json | 6 +++--- CONTRIBUTING.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.size-limit.json b/.size-limit.json index 2cd5f00a..7fe13649 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": "18 KB", + "limit": "19 KB", "gzip": true }, { @@ -20,13 +20,13 @@ { "name": "widget, single file (chatcops.full.min.js)", "path": "packages/widget/dist/chatcops.full.min.js", - "limit": "20 KB", + "limit": "22 KB", "gzip": true }, { "name": "widget, ESM (unminified: sites bundle and minify it, so this only catches runaway growth)", "path": "packages/widget/dist/chatcops.esm.js", - "limit": "30 KB", + "limit": "32 KB", "gzip": true } ] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 29417f8c..61363fba 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`), 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. +The widget has a size budget, gzipped: 5 kB for the script tag loader (`dist/chatcops.min.js`), 19 kB for the chat panel it loads when the chat opens (`dist/chatcops.panel.js`), 2 kB for the pre-chat form chunk, 22 kB for the single-file build (`dist/chatcops.full.min.js`) and 32 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