perf: lazy-load interactive Demo components on faucet page#256
Open
perf: lazy-load interactive Demo components on faucet page#256
Conversation
Use React.lazy() + Suspense to dynamically import the heavy wagmi/viem wallet UI so static MDX content (title, description, table) paints first. Co-authored-by: Brendan Ryan <1572504+brendanjryan@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d6e1a-2a8e-7257-a027-d6c2cb562b8b
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Brendan Ryan <1572504+brendanjryan@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d6e1a-2a8e-7257-a027-d6c2cb562b8b
Replace faucet-specific LazyFaucetWalletDemo with a generic clientOnly() helper that wraps React.lazy() + Suspense. Apply it to all pages with heavy interactive components: - faucet, add-funds: FaucetWalletDemo - connection-details, integrate-tempo, connect-to-wallets: ConnectWallet - embed-passkeys: EmbedPasskeys, SignInButtons - embed-tempo-wallet: AccountsSignIn - accounts: Demo + Steps - tokenlist: TokenListDemo Co-Authored-By: Brendan Ryan <1572504+brendanjryan@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d6e1a-2a8e-7257-a027-d6c2cb562b8b
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.
Add a generic
clientOnly()/clientOnlyNamed()helper (src/components/ClientOnly.tsx) that wrapsReact.lazy()+<Suspense>with a dashed-border placeholder. Use it across all pages with heavy interactive components so static MDX content paints immediately.Pages updated
quickstart/faucetFaucetWalletDemoguide/use-accounts/add-fundsFaucetWalletDemoquickstart/connection-detailsConnectWalletquickstart/integrate-tempoConnectWalletguide/use-accounts/connect-to-walletsConnectWallet,ConnectToWalletsDemoguide/use-accounts/embed-passkeysEmbedPasskeysDemo,EmbedPasskeys,SignInButtonsguide/use-accounts/embed-tempo-walletAccountsSignInDemo,AccountsSignInaccounts/indexAccountsDemoquickstart/tokenlistTokenListDemoAPI
Co-Authored-By: Brendan Ryan 1572504+brendanjryan@users.noreply.github.com
Prompted by: Brendan