Make the widget bundle at least 600 bytes smaller (gzipped) without changing behavior
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Refactorisation
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- typescript, vite
- Domaine
- frontend, performance
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- TypeScript
- Étoiles
- 13
- Forks
- 7
- Merge moyen
- 3 h 15 min
- PR mergées (30 j)
- 198
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de codercops/chatcops
-
Suggested questions as buttons in an empty chatPeut-être pris @srujankaleru2007 l’a pris il y a 1 jour. Ouverteenhancement hacktoberfest widget
codercops/chatcops#343 · 2 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Announce each reply once instead of every streamed chunkPeut-être pris @kachamsiddarth l’a pris il y a 1 jour. Ouverteaccessibility enhancement hacktoberfest widget
codercops/chatcops#338 · 2 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
One visible focus ring for every widget control (--cc-focus-ring)Peut-être pris @anurag2787 l’a pris il y a 1 jour. Ouverteaccessibility enhancement good first issue hacktoberfest widget
codercops/chatcops#337 · 2 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Make the welcome bubble a real buttonPeut-être pris @kachamsiddarth l’a pris il y a 1 jour. Ouverteaccessibility enhancement good first issue hacktoberfest widget
codercops/chatcops#336 · 3 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Hacktoberfest 2026: start hereOuvertehacktoberfest
Difficulté 1/5 Moins d'une heure Accessibilité débutants 35/100
codercops/chatcops#73 · 6 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de codercops/chatcops
Issues similaires
-
category::task code priority::normal
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
e0ipso/strikethroo#145 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 1-3 heures Accessibilité débutants 85/100
cocos/cocos-docs#3333 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
RevenueCat/react-native-purchases#2079 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
RevenueCat/purchases-hybrid-common#2039 ·
Les mainteneurs répondent en général sous 1 jour
-
agent-reported area/react bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour