mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
perf(bundle): replace plebbit-js imports with local utility, split chunks, fix CLS and rerenders
Eliminate direct @plebbit/plebbit-js (8.7MB) imports from all UI components by replacing Plebbit.getShortAddress() with a local get-short-address utility. Add Vite manual chunks for plebbit-js, plebbit-react-hooks, and react-spring/use-gesture. Fix catalog CLS by matching skeleton to wrapper dimensions. Lazy-load ChallengeModal and ReplyModal. Add failed-URL cache to useFetchGifFirstFrame, optimize useHide selector, and memoize useFeed options in mod-queue.
This commit is contained in:
@@ -4,7 +4,7 @@ import { useLocation, useParams, useNavigate } from 'react-router-dom';
|
||||
import { useAccountComment } from '@plebbit/plebbit-react-hooks';
|
||||
import useAccountsStore from '@plebbit/plebbit-react-hooks/dist/stores/accounts';
|
||||
import useSubplebbitsStore from '@plebbit/plebbit-react-hooks/dist/stores/subplebbits';
|
||||
import Plebbit from '@plebbit/plebbit-js';
|
||||
import getShortAddress from '../../lib/get-short-address';
|
||||
import { useStableSubplebbit } from '../../hooks/use-stable-subplebbit';
|
||||
import { isAllView, isSubscriptionsView, isModView } from '../../lib/utils/view-utils';
|
||||
import styles from './board-header.module.css';
|
||||
@@ -95,7 +95,7 @@ const BoardHeader = () => {
|
||||
? shortAddress.endsWith('.eth') || shortAddress.endsWith('.sol')
|
||||
? shortAddress.slice(0, -4)
|
||||
: shortAddress
|
||||
: subplebbitAddress && Plebbit.getShortAddress({ address: subplebbitAddress }))}
|
||||
: subplebbitAddress && getShortAddress(subplebbitAddress))}
|
||||
{!isInAllView && !isInSubscriptionsView && !isInModView && <OfflineIndicator subplebbitAddress={subplebbitAddress} />}
|
||||
</div>
|
||||
<div className={styles.boardSubtitle}>
|
||||
|
||||
Reference in New Issue
Block a user