Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

ralph(M15-205): Delete the unused responsive-react-email dependency - it drags react-email, next and both @next/swc into the production api image, 35.4% of it

ralph9ec2ef4b6bea
diff --git a/bun.lock b/bun.lock
index 9e7a55b58..c833506e6 100644
--- a/bun.lock
+++ b/bun.lock
@@ -381,7 +381,6 @@
"react": "catalog:",
"react-dom": "catalog:",
"resend": "4.0.1",
- "responsive-react-email": "0.0.5",
"zod": "catalog:",
},
"devDependencies": {
@@ -5214,8 +5213,6 @@
"resolve-workspace-root": ["[email protected]", "", {}, "sha512-nR23LHAvaI6aHtMg6RWoaHpdR4D881Nydkzi2CixINyg9T00KgaJdJI6Vwty+Ps8WLxZHuxsS0BseWjxSA4C+w=="],
- "responsive-react-email": ["[email protected]", "", { "peerDependencies": { "react": "18.x", "react-email": "1.x" } }, "sha512-r+Z6Yp6G3Sm9eKmttsb8GVij25rXJGN2eoQ9OfMcuVMfBfq1NdytIFLBo/6wdMW1zw+ko1FEUG/zgRyK9UuYLw=="],
-
"restore-cursor": ["[email protected]", "", { "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" } }, "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA=="],
"retext": ["[email protected]", "", { "dependencies": { "@types/nlcst": "^2.0.0", "retext-latin": "^4.0.0", "retext-stringify": "^4.0.0", "unified": "^11.0.0" } }, "sha512-sbMDcpHCNjvlheSgMfEcVrZko3cDzdbe1x/e7G66dFp0Ff7Mldvi2uv6JkJQzdRcvLYE8CA8Oe8siQx8ZOgTcA=="],
diff --git a/docs/TECH_DEBT.md b/docs/TECH_DEBT.md
index aa388ade4..7eb9606d3 100644
--- a/docs/TECH_DEBT.md
+++ b/docs/TECH_DEBT.md
@@ -2167,3 +2167,60 @@ M15-201's target and widening the scan is a change to what that gate asserts.
moved onto the jobs themselves; the export is gone and the script dies on
`sch.CRON_SCHEDULES.map`. Verified pre-existing by stashing this task's diff
and re-running: same failure at `20f63a8f`.
+
+## 2026-09-11 — M15-205, `responsive-react-email` deleted; api image measured before/after
+
+`docs/DOCKER_SLIMMING.md` §2.2 (M14-203) had already proved the cause: a
+*production* dependency, `packages/email/package.json:19`'s
+`[email protected]`, pulls `[email protected]` in as a peer, which
+pulls `[email protected]` and both `@next/swc-linux-x64-*` binaries — none of it
+imported anywhere (`grep -rn "responsive-react-email"` over `packages/` and
+`apps/` found only the manifest line). This task deletes the line and
+regenerates `bun.lock` + `tooling/gates/p13-lock-snapshot.json` in the same
+commit.
+
+**Measured here, following `DOCKER_SLIMMING.md` §0's method exactly** — two
+whole `openpanel-api` images, both built from `apps/api/Dockerfile` at the
+same commit (`d8e50c2f`), differing only in this task's three-file diff, never
+from an edited file in the tracked tree (the diff was `git stash`-held during
+the "before" build and restored once the build context had been read):
+
+```
+docker build -f apps/api/Dockerfile -t <tag> \
+ --build-arg DATABASE_URL=postgresql://p13-gate:[email protected]:1/p13-gate .
+```
+
+| Image | COMPRESSED (`docker image inspect .Size`) | UNCOMPRESSED (`docker history` layer sum) |
+|---|---:|---:|
+| before — `d8e50c2f`, dependency present | **341,481,099 B** (341.5 MB) | **1,472,071,590 B** (1.47 GB) |
+| after — this task's diff applied | **242,937,660 B** (242.9 MB) | **963,071,590 B** (963.1 MB) |
+| **delta** | **−98,543,439 B (−28.9 %)** | **−509,000,000 B (−34.6 %)** |
+
+The uncompressed figure is `docker history --no-trunc --format '{{.Size}}'`
+summed from Docker's rounded human units (same caveat `DOCKER_SLIMMING.md` §0
+notes about its own per-layer table), so treat it to three significant
+figures; the compressed figure is the exact byte count everything else here
+is keyed to.
+
+`docker history` on the two images is identical line-for-line except one:
+
+```
+COPY --chown=bun:bun /app/node_modules ./node_modules 1.17GB → 661MB
+```
+
+— confirming the whole delta is the one dependency edge, nothing else moved.
+Inside the "after" image's `node_modules/.bun` store: 884 entries (was 951,
+−67); `next`, `react-email` (bare) and both `@next/swc-linux-x64-*` are
+absent; `@react-email/*` (the real, still-declared production dependency of
+`packages/email`) is unaffected. The after image boots: `docker run
+--network host` against this box's Postgres/ClickHouse/Redis gives
+`/healthz/ready` → `200` with no `Cannot find module` lines in the log.
+
+This delta (−98.5 MB compressed here) is smaller than §2.2's own
+`bun install --production` probe delta (144,263,771 B) because
+`apps/api/Dockerfile`'s `prod-deps` stage already prunes `*musl*` store
+entries (including `@next/swc-linux-x64-musl`, 54,344,971 B compressed of
+§2.2's four-entry total) as one of M15-203's cuts — that entry was already
+gone from the "before" image measured here, so this task cannot re-save it.
+The `react-email` + `next` + `@next/swc-linux-x64-gnu` chain is what remained
+to cut, and cutting it is exactly what this task does.
diff --git a/packages/email/package.json b/packages/email/package.json
index 8519ddd55..7a561cc4f 100644
--- a/packages/email/package.json
+++ b/packages/email/package.json
@@ -16,7 +16,6 @@
"react": "catalog:",
"react-dom": "catalog:",
"resend": "4.0.1",
- "responsive-react-email": "0.0.5",
"zod": "catalog:"
},
"devDependencies": {
diff --git a/tooling/gates/p13-lock-snapshot.json b/tooling/gates/p13-lock-snapshot.json
index 9dae8c32b..14726e7e4 100644
--- a/tooling/gates/p13-lock-snapshot.json
+++ b/tooling/gates/p13-lock-snapshot.json
@@ -346,7 +346,6 @@
"react-dom": "19.2.3",
"react-email": "3.0.4",
"resend": "4.0.1",
- "responsive-react-email": "0.0.5",
"typescript": "5.9.3",
"zod": "4.3.6"
},