Make the widget bundle at least 600 bytes smaller (gzipped) without changing behavior
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript, vite
- 领域
- frontend, performance
调研方向
Build the widget with pnpm --filter @chatcops/widget build, then run pnpm size and inspect the bundle using npx size-limit --why or source-map-explorer. Focus on markdown.ts, theme.ts, the listed dom files, i18n.ts, styles/widget.css and vite.config.ts; leave the three named files untouched. Done means at least 600 gzipped bytes saved with identical behavior, unchanged unit and browser tests passing, before and after size output in the PR, one-line reasons for changes, and a patch changeset.
由索引模型根据 Issue 内容生成。
描述
The script tag bundle (packages/widget/dist/chatcops.min.js) has to stay under 14 kB gzipped, and CI checks it with pnpm size (limits in .size-limit.json). It's at about 13.5 kB today. The next two releases add a new stream parser and session handling to the widget, which will take most of what's left. This issue frees up room before that.
This is for someone who has had at least 3 PRs merged here. Shaving bytes is easy to overdo, and every change has to keep the widget working exactly the same.
What to do
- Run
pnpm --filter @chatcops/widget buildandpnpm size, then look at what's big.npx size-limit --whyor source-map-explorer on the build both work. - Find savings in
markdown.ts,theme.ts,dom/prechat-form.ts,dom/panel.ts,dom/bubble.ts,i18n.tsorstyles/widget.css. Typical wins: duplicated helpers, CSS rules nobody uses, long repeated strings, code thatvite.config.tscould minify better. - Leave
api/client.ts,widget.tsanddom/messages.tsalone. I'm rewriting those next month. - No new dependencies, no build tool change, and no behavior change. Visible text, class names, CSS custom properties and the public API stay the same.
Acceptance criteria
-
dist/chatcops.min.jsis at least 600 bytes smaller gzipped. Put thepnpm sizeoutput from before and after in the PR - Every unit test and every browser test (
pnpm e2e) passes unchanged. Changing a test to make it pass doesn't count - Each change has a one-line reason in the PR description
- Changeset for
@chatcops/widget(patch)
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.
- 主要语言
- TypeScript
- 星标
- 13
- 派生
- 7
- 平均合并
- 3 小时 41 分钟
- 30 天内合并 PR
- 155
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codercops/chatcops 的其他 Issue
-
Document the pre-chat form可能已有人在做 @masyarakatai 于 5 天前认领。 未关闭documentation good first issue hacktoberfest widget
难度 2/5 1-3 小时 新手友好度 88/100
codercops/chatcops#70 · 5 条评论 ·
维护者通常 1 天内回复
-
docs: update the providers page for openai-compatible, registerProvider and provider imports可能已有人在做 @prakashNalla 今天认领。 未关闭documentation good first issue hacktoberfest website
难度 3/5 1-2 天 新手友好度 76/100
codercops/chatcops#291 · 1 条评论 ·
维护者通常 1 天内回复
-
docs: add a protocol reference page for custom clients可能已有人在做 @kachamsiddarth 今天认领。 未关闭documentation good first issue hacktoberfest website
codercops/chatcops#286 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Create @chatcops/store-cloudflare (D1, KV and a Durable Object counter)可能已有人在做 @bhushan4work 今天认领。 未关闭enhancement hacktoberfest help wanted server
难度 5/5 一周以上 新手友好度 25/100
codercops/chatcops#249 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Create @chatcops/store-sqlite, a store for single-server setups可能已有人在做 @srikar-naidu 今天认领。 未关闭enhancement hacktoberfest help wanted server
难度 5/5 一周以上 新手友好度 35/100
codercops/chatcops#247 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 codercops/chatcops 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 72/100
zts212653/clowder-ai#1678 ·
维护者通常 1 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 64/100
Progressive-Victory/the-website#680 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100