…2.5K LOC of unused bridge UI
Three coordinated changes closing the last bullet of perf debt called
out in #3187.
────────────────────────────────────────────────────────────────────────
1. Crypto polyfill: 682KB → 84KB (-600KB, -88%)
Audited every consumer of node:crypto in the eager graph. The whole
600KB was pulled by ethers@5 (transitive crypto-browserify, bn.js,
elliptic, browserify-sign, pbkdf2, public-encrypt, diffie-hellman).
ethers had ZERO live consumers — just three orphan utility files
exported but never imported. Deleted them, dropped ethers + the two
@ethersproject/* packages from package.json, removed 'crypto' from
nodePolyfills.include in both apps.
Residual 84KB chunk is legitimate Buffer/process polyfills that
wagmi/walletconnect actually need. Removing those would require
per-consumer Buffer.from() audit — much smaller payoff (~24KB
gzipped), much bigger risk.
2. Typography unified under one canonical Text component
tangle-cloud had 13 separate local Text shims declaring slightly
different variant unions. Drift made every page look subtly off.
Added apps/tangle-cloud/src/components/Text.tsx with 4 canonical
variants ('h1'-'h4', 'body-lg', 'body', 'body-sm', 'caption') and
6 legacy aliases ('h4' → h2, 'body1' → body-lg, 'body2' → body,
'body3'/'body4' → body-sm) so all 416 existing call sites work
unchanged. Maps to brand 0.3 typography tokens via Tailwind's
font-display + size scale.
Replaced shims in 14 files. SandboxUi.tsx and
SandboxModalPrimitives.tsx now re-export from the canonical so
the deep '@/sandbox/SandboxUi' / './SandboxModalPrimitives' import
paths keep working without churn.
3. BridgeInputs + BridgeFeeDetails + cascade orphans deleted (~2,564 LOC)
Killed 31 dead files now that the bridge surface is fully gone:
- libs/ui-components/src/components/BridgeInputs/ (15 files, 1,542 LOC)
- libs/ui-components/src/containers/BridgeFeeDetails/ (3 files, 174 LOC)
- Cascade orphans (only existed to compose BridgeInputs):
DepositCard/, TransferCard/, WithdrawCard/
- components/DropdownField/DropdownField.tsx (duplicate of
Dropdown/DropdownField.tsx, no consumers)
- 3 orphaned .stories.jsx files
Two transitively-used pieces (AdjustAmount, AnimatedChevronRight)
relocated to their actual consumers (TransactionInputCard, Dropdown)
instead of deleted, tightening the dep graph.
────────────────────────────────────────────────────────────────────────
Cumulative bundle deltas (vs pre-overhaul baseline):
| Asset | Pre-overhaul | Now | Total cut |
| tangle-dapp main `index` | 3.36 MB | 788 KB | -77% |
| crypto polyfill chunk | 682 KB | 84 KB | -88% |
| tangle-cloud font payload | 1.19 MB | 0 | -100% |
| Typography drift | 13 shims | 1 cano | unified |
| LOC removed across all PRs | - | -7,000+ | - |
Verified: typecheck + lint + test + build pass on both apps.
Closes the last bullet of perf debt called out in #3187. Three coordinated changes.
Bundle delta
What ships
@ethersproject/*+ethers@5deleted, taking the entire 600KBcrypto-browserifytransitive tree with it (bn.js,elliptic,browserify-sign,pbkdf2,public-encrypt,diffie-hellman). Audit found ethers had ZERO live consumers — three orphan utility files exported but never imported. Removed 'crypto' fromnodePolyfills.includein both apps' vite configs.Typography unified:
apps/tangle-cloud/src/components/Text.tsxis now the single canonical Text component (4 brand-aligned variants + 6 legacy aliases) consumed by all 416 existing call sites. 13 per-page shims removed; 14 files updated.SandboxUi.tsxre-exports the canonical so deep import paths (@/sandbox/SandboxUi) keep working.Dead bridge UI deleted (~2,564 LOC across 31 files): BridgeInputs/, BridgeFeeDetails/, cascade orphans (DepositCard/, TransferCard/, WithdrawCard/), duplicate DropdownField, orphaned story files. AdjustAmount + AnimatedChevronRight relocated to their actual consumers (TransactionInputCard, Dropdown) instead of deleted — tightens the dep graph.
Cumulative wins (vs pre-overhaul baseline)
index: 3.36MB → 788KB (-77%)Verified: typecheck + lint + test + build pass on both apps.