Skip to content

perf(tangle-cloud): zero @polkadot library code in bundle#3192

Merged
drewstone merged 1 commit intodevelopfrom
feat/polkadot-zero-from-cloud
May 7, 2026
Merged

perf(tangle-cloud): zero @polkadot library code in bundle#3192
drewstone merged 1 commit intodevelopfrom
feat/polkadot-zero-from-cloud

Conversation

@drewstone
Copy link
Copy Markdown
Contributor

tangle-cloud doesn't deal with substrate flows — those all live on tangle-dapp's claims/migration page. The four direct polkadot imports were leftovers from the Webb-era shared utilities.

Replacements

  • BlueprintInfoCard: isEthereumAddress(@polkadot/util-crypto)isAddress(viem) with strict: false (preserves polkadot's regex-only semantics)
  • TxHistoryDrawer + rewards/page: BN(@polkadot/util)bigint (formatDisplayAmount already accepts bigint)
  • TotalValueLockedTable: type-only BN dropped; local BigIntish narrowing avoids touching shared StakingVault that tangle-dapp depends on

Verified: zero @polkadot library bytes in any tangle-cloud chunk. The 1.99KB polkadot-*.js chunk that remains is the chain-logo SVG, not library code.

tangle-dapp untouched — still depends on polkadot for substrate flows.

tangle-cloud doesn't deal with substrate flows — those all live on
tangle-dapp's claims/migration page. The four direct polkadot imports
were leftovers from the Webb-era shared utilities.

Replacements:

- BlueprintInfoCard: isEthereumAddress(@polkadot/util-crypto)
  -> isAddress(viem) with strict: false to preserve regex-only
  semantics (accept non-checksummed mixed-case)

- TxHistoryDrawer: BN(@polkadot/util) -> bigint. formatDisplayAmount
  signature narrowed to (bigint, ...). BN.isBN check replaced with
  typeof === 'bigint' (HistoryTxDetail union already excluded BN).

- TotalValueLockedTable: type-only BN import dropped. Local BigIntish
  narrowing alias (bigint | { toString(): string }) avoids touching
  the shared StakingVault type that tangle-dapp also consumes.

- rewards/page: BN -> bigint. Removed new BN(amount.toString())
  wrappers that were round-tripping through string for no reason.

Verified: zero @PolkaDot library bytes in any tangle-cloud chunk
(grep '@PolkaDot\|x-global\|registerGlobal' dist/.../assets/*.js -> 0).
The 1.99KB polkadot-*.js chunk that remains is just the Polkadot
blockchain logo SVG from libs/icons; non-library, lazy-loaded only
for chain selectors that show that ecosystem.

tangle-dapp untouched — still depends on polkadot for substrate
flows; its 697KB polkadot vendor chunk is unchanged.
@drewstone drewstone requested a review from AtelyPham as a code owner May 7, 2026 23:27
@drewstone drewstone merged commit d30c286 into develop May 7, 2026
1 of 7 checks passed
@drewstone drewstone deleted the feat/polkadot-zero-from-cloud branch May 7, 2026 23:27
@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for tangle-dapp failed. Why did it fail? →

Name Link
🔨 Latest commit 5122640
🔍 Latest deploy log https://app.netlify.com/projects/tangle-dapp/deploys/69fd1ff3e9bca90008602701

@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for tangle-cloud failed. Why did it fail? →

Name Link
🔨 Latest commit 5122640
🔍 Latest deploy log https://app.netlify.com/projects/tangle-cloud/deploys/69fd1ff3e9bca90008602705

@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for tangle-leaderboard failed. Why did it fail? →

Name Link
🔨 Latest commit 5122640
🔍 Latest deploy log https://app.netlify.com/projects/tangle-leaderboard/deploys/69fd1ff388f1f40008b36c11

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