Skip to content

refactor: performance & UX improvements - #20

Merged
Rezn1r merged 6 commits into
mainfrom
refactor/performance-ux-improvements
May 22, 2026
Merged

Rezn1r merged 6 commits into
mainfrom
refactor/performance-ux-improvements

Conversation

@Rezn1r

@Rezn1r Rezn1r commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Remove framer-motion (~30KB gzipped savings) — replaced with lightweight CSS animations + IntersectionObserver hook
  • Convert LatestPluginsSection to server component — eliminates client-side waterfall fetch, data now server-rendered with ISR (60s revalidation)
  • Optimize react-syntax-highlighter — switch to light build with explicit language registration (10 languages)
  • UX improvements — terminal animation persistence, Next.js Image component, Suspense loading states, focus indicators, 300ms search debounce, 44px touch targets, pagination scroll-to-top

Changes

Bundle Size (1A, 1B, 1C)

  • Created src/hooks/useInView.ts — 28-line IntersectionObserver hook
  • Rewrote FadeIn.tsx, StaggerContainer.tsx — CSS transitions with useInView
  • Rewrote PluginCardGrid.tsx — <Link> replaces motion.a for proper Next.js navigation/prefetching
  • Rewrote NavbarClient.tsx, faq/page.tsx — CSS replaces AnimatePresence/motion.div
  • LatestPluginsSection.tsx — server component with fetch() + next: { revalidate: 60 }
  • MarkdownTabs.tsx — light syntax highlighter build with per-language registration
  • Removed framer-motion dependency

Runtime & Perceived Speed (2A, 2B)

  • plugins/[slug]/page.tsx — loading fallbacks for DependencyGraph, PluginRatings, VirusTotalCard dynamic imports
  • plugins/[slug]/page.tsx — React.cache() deduplicates getPlugin() between generateMetadata and page render
  • PluginSearch.tsx — debounce reduced from 500ms to 300ms

UX Polish (3A, 3B, 3C, 1D, 1E, 1F, 3E, 3F)

  • HomeContent.tsx — terminal animation skips replay via sessionStorage
  • globals.css — :focus-visible outline styles for keyboard navigation
  • PluginAnalyticsChart.tsx — retry button on fetch error
  • PluginImage.tsx — Next.js <Image> with onError fallback
  • plugins/page.tsx — 44px min touch targets, #plugin-grid anchor for scroll-to-top
  • FadeIn.tsx, StaggerContainer.tsx — prefers-reduced-motion respected for inline transitions

Verification

  • pnpm lint — clean
  • pnpm type-check — clean
  • pnpm build — succeeds, shared JS 87.5KB

Rezn1r added 5 commits May 22, 2026 17:37
…bserver hook

- Create lightweight useInView hook (~20 lines) using IntersectionObserver
- Rewrite FadeIn to use CSS transitions triggered by useInView
- Rewrite StaggerContainer to use CSS @Keyframes with staggered animation-delay
- Replace motion.a in PluginCardGrid with Next.js Link for proper client-side navigation
- Replace AnimatePresence/motion.div in NavbarClient with CSS max-height transition
- Replace AnimatePresence/motion.div in FAQ accordion with CSS max-height/opacity transition
- Add fadeSlideUp and fadeIn @Keyframes to globals.css
- Remove framer-motion dependency (~30KB gzipped savings)
- Remove client-side useState/useEffect data fetching
- Fetch data server-side with fetch() using next: { revalidate: 60 }
- Move LatestPluginsSection rendering from HomeContent to page.tsx
- Eliminates waterfall fetch and ships zero extra JS for data fetching
…nguage registration

- Import Light build instead of full Prism build (~200KB+ savings)
- Register only needed languages: python, cpp, javascript, typescript, bash, json, yaml, markdown, css, clike
- Import individual vsc-dark-plus theme instead of full styles bundle
- Terminal animation: skip replay on re-visit using sessionStorage flag
- PluginImage: replace manual Image() preloading with Next.js Image component
- Plugin detail: add loading fallbacks to DependencyGraph, PluginRatings, VirusTotalCard
- Plugin detail: deduplicate getPlugin() calls with React.cache()
- PluginAnalyticsChart: add retry button on error state
- PluginSearch: reduce debounce from 500ms to 300ms
- Focus indicators: add :focus-visible outline styles for keyboard navigation
- Pagination: increase touch targets to 44px minimum (WCAG)
- Pagination: add #plugin-grid anchor for scroll-to-top on page change
Add usePrefersReducedMotion hook with matchMedia listener to skip inline
transition/animation styles when user prefers reduced motion. Previously
the global CSS rule couldn't override inline styles.
@vercel

vercel Bot commented May 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
endgit-web Ready Ready Preview, Comment May 22, 2026 10:02am

@Rezn1r
Rezn1r merged commit 8f97bf3 into main May 22, 2026
4 checks passed
@Rezn1r
Rezn1r deleted the refactor/performance-ux-improvements branch May 22, 2026 23:02

This branch was successfully deployed

1 active deployment
Preview – endgit-web — f4e8d774 Deployed May 22, 2026 by vercel[bot]
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.

2 participants