Skip to content

perf: kill LiFi bridge, drop unused fonts, lazy-load polkadot#3187

Merged
drewstone merged 1 commit intodevelopfrom
feat/close-perf-debt
May 7, 2026
Merged

perf: kill LiFi bridge, drop unused fonts, lazy-load polkadot#3187
drewstone merged 1 commit intodevelopfrom
feat/close-perf-debt

Conversation

@drewstone
Copy link
Copy Markdown
Contributor

Closes the residual perf debt from #3186.

Bundle delta (cumulative since pre-overhaul)

Asset Pre-overhaul After this PR Total cut
tangle-dapp main index 3.36 MB 755 KB −78%
tangle-cloud fonts 1.19 MB 0 −100%
Dead-code chunks (hyperlane+livepeer+astar+lifi) 282 KB+ gone

What ships

  1. @lifi/widget + /bridge route deleted (~313 LOC). The bridge UI was a half-finished pivot. Removed: pages/bridge/ directory, features/bridge/LiFiBridgeContainer, sidebar entry, PagePath.BRIDGE enum, @lifi/widget dependency.

  2. Cousine/Satoshi fonts off tangle-cloud (−445 KB). Fonts were leaking via ui-components/css/typography.css. Split into opt-in typography-fonts.css sidecar; tangle-dapp imports it, tangle-cloud skips it. Bonus fix: nested @font-face blocks for Satoshi-Variable that browsers had been ignoring are now top-level and actually work.

  3. @polkadot/* lazy-loaded for EVM users (−640 KB main chunk on tangle-dapp). Identicon wrapped in React.lazy, useActiveAccountAddress no longer cross-prefix re-encodes, useEvmAddress / useAgnosticAccountInfo use subpath imports, formatDisplayAmount converted to pure-bigint via new formatBigInt (byte-identical output), isSolanaAddress is now a base58 regex (strict variant exposed for callers that need ed25519 on-curve check). Polkadot chunk now only loads when a user hits a substrate route.

    Plus new vendor-chunk pins in vite.config.ts (rxjs, crypto-polyfill, noble, utils) so Rollup can't fold shared CJS deps back into polkadot.

Verified

tangle-cloud and tangle-dapp both pass typecheck + lint + test + build.

Closes the residual perf debt from the omnibus overhaul.

────────────────────────────────────────────────────────────────────

1. LiFi widget + bridge page deleted (~313 LOC)
   The bridge surface was a half-finished pivot off hyperlane to LiFi.
   Now it's a half-finished pivot off LiFi to nothing. apps/tangle-dapp
   loses the /bridge route, BridgePage component, LiFiBridgeContainer,
   sidebar entry, BRIDGE PagePath enum, and the @lifi/widget dependency.

2. Cousine/Satoshi dropped from tangle-cloud (-445 KB)
   The fonts were leaking into tangle-cloud transitively via
   ui-components/src/css/typography.css. Split @font-face declarations
   into typography-fonts.css (opt-in sidecar). tangle-dapp imports it
   explicitly in main.tsx; tangle-cloud doesn't and stops shipping
   them. Bonus fix: the original typography.css had nested @font-face
   blocks for Satoshi-Variable that browsers ignored — moving them
   to top-level in the new file actually makes font-satoshi-var work
   for the first time.

3. @polkadot/* lazy-loaded for EVM users (-640 KB main chunk)
   tangle-dapp main index drops from 1.39MB to 755KB (-46%) by
   defer-importing polkadot from eager paths:
   - <Identicon> wrapped in React.lazy(@polkadot/react-identicon)
   - useActiveAccountAddress no longer cross-prefix re-encodes
     (purely cosmetic; same underlying account)
   - useEvmAddress + useAgnosticAccountInfo use subpath imports
   - formatDisplayAmount converts BN -> bigint via .toString and
     uses a new pure-bigint formatBigInt (byte-identical output)
   - isSolanaAddress now base58-regex; isSolanaAddressStrict is
     opt-in lazy for callers needing on-curve validation
   Substrate-only consumers (claim migration, native staking) keep
   working — they're already behind route-level React.lazy boundaries
   so polkadot loads only when the user navigates there.

   New vendor-chunk pins in vite.config.ts (rxjs, crypto-polyfill,
   noble, utils) prevent Rollup from re-folding shared CJS deps back
   into the polkadot chunk.

────────────────────────────────────────────────────────────────────

Combined bundle deltas (vs pre-overhaul):

| Asset                                      | Before  | After  | Total |
|--------------------------------------------|---------|--------|-------|
| tangle-dapp main index (PRE-overhaul)      | 3.36 MB | 755 KB | -78%  |
| tangle-cloud font payload                  | 1.19 MB | 0      | -100% |
| Combined dead-code (hyperlane+livepeer+    | 282 KB  | 0      | gone  |
| astar+lifi)                                |         |        |       |

Verified: typecheck + lint + test + build all pass on both apps.
@drewstone drewstone requested a review from AtelyPham as a code owner May 7, 2026 20:37
@drewstone drewstone merged commit 7852d10 into develop May 7, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for tangle-dapp ready!

Name Link
🔨 Latest commit d157f99
🔍 Latest deploy log https://app.netlify.com/projects/tangle-dapp/deploys/69fcf7f3b3a4330008e9334d
😎 Deploy Preview https://deploy-preview-3187--tangle-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for tangle-leaderboard ready!

Name Link
🔨 Latest commit d157f99
🔍 Latest deploy log https://app.netlify.com/projects/tangle-leaderboard/deploys/69fcf7f39c760700099d3056
😎 Deploy Preview https://deploy-preview-3187--tangle-leaderboard.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@drewstone drewstone deleted the feat/close-perf-debt branch May 7, 2026 20:37
@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for tangle-cloud ready!

Name Link
🔨 Latest commit d157f99
🔍 Latest deploy log https://app.netlify.com/projects/tangle-cloud/deploys/69fcf7f362ad5e00089a1a81
😎 Deploy Preview https://deploy-preview-3187--tangle-cloud.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant