perf: kill LiFi bridge, drop unused fonts, lazy-load polkadot#3187
Merged
perf: kill LiFi bridge, drop unused fonts, lazy-load polkadot#3187
Conversation
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.
✅ Deploy Preview for tangle-dapp ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for tangle-leaderboard ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for tangle-cloud ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This was referenced May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the residual perf debt from #3186.
Bundle delta (cumulative since pre-overhaul)
indexWhat ships
@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.BRIDGEenum,@lifi/widgetdependency.Cousine/Satoshi fonts off tangle-cloud (−445 KB). Fonts were leaking via
ui-components/css/typography.css. Split into opt-intypography-fonts.csssidecar; 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.@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-cloudandtangle-dappboth pass typecheck + lint + test + build.