Make the widget bundle at least 600 bytes smaller (gzipped) without changing behavior
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Refactoring
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript, vite
- Bereich
- frontend, performance
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 13
- Forks
- 7
- Ø Merge
- 4 Std. 11 Min.
- Gemergte PRs (30 T.)
- 122
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus codercops/chatcops
-
enhancement hacktoberfest help wanted server
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Document the pre-chat formEvtl. vergeben @masyarakatai hat das vor 5 Tagen übernommen. Offendocumentation good first issue hacktoberfest widget
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
codercops/chatcops#70 · 3 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement hacktoberfest help wanted server
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
Maintainer antworten meist innerhalb von 1 Tag
-
Create @chatcops/store-redis for Upstash and other Redis clientsEvtl. vergeben @bhushan4work hat das vor 1 Tag übernommen. Offenenhancement hacktoberfest help wanted server
codercops/chatcops#248 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Create @chatcops/store-sqlite, a store for single-server setupsEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenenhancement hacktoberfest help wanted server
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in codercops/chatcops
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
endora-commerce/endora-commerce#397 ·
Maintainer antworten meist innerhalb von 1 Tag
-
level/task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
wazuh/wazuh-dashboard-plugins#9472 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 63/100
Maintainer antworten meist innerhalb von 1 Tag
-
ready-for-agent
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
xavxyz/bei-shan-lin-shui#57 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
opennextjs/opennextjs-cloudflare#1461 ·
Maintainer antworten meist innerhalb von 1 Tag