Skip to content

fix(react): apply vercel best practices#656

Open
claude[bot] wants to merge 1 commit into
mainfrom
syner/react-best-practices-1776868861
Open

fix(react): apply vercel best practices#656
claude[bot] wants to merge 1 commit into
mainfrom
syner/react-best-practices-1776868861

Conversation

@claude
Copy link
Copy Markdown

@claude claude Bot commented Apr 22, 2026

Automated review using vercel-react-best-practices skill. Run: https://github.com/synerops/syner/actions/runs/24784429583

Changes

Added optimizePackageImports: ['lucide-react'] to the Next.js experimental config for apps/design and apps/dev.

Rule violated: bundle-barrel-imports (CRITICAL impact)

lucide-react is a barrel file with 1,583+ modules. Without optimizePackageImports, every import like import { ArrowRight } from 'lucide-react' loads the entire library, adding 200–800ms to cold starts.

Affected apps:

  • apps/design — imports ArrowRight, Palette, Type, MessageSquare, Layout, Grid3X3, PanelTop, PanelBottom, Settings, Activity, Database, Zap, Shield, Code
  • apps/dev — imports Copy, Check

Fix: Next.js 13.5+ optimizePackageImports transforms barrel imports to direct module paths at build time, preserving full TypeScript support while eliminating the barrel cost.

Scan summary

38 TSX files reviewed across apps/**/*.tsx and packages/ui/**/*.tsx.

Other rules checked (no violations found):

  • rendering-conditional-render — no numeric && conditions
  • rerender-no-inline-components — SkillCard defined at module level, not inline
  • rendering-hoist-jsx — no static JSX inside render functions that could be hoisted
  • rerender-memo-with-default-value — no memoized components with non-primitive default props
  • server-hoist-static-io — fonts already hoisted to module level in layouts

Add optimizePackageImports for lucide-react in apps/design and apps/dev
to eliminate barrel import cost (~200-800ms per cold start).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude claude Bot requested a review from rbadillap as a code owner April 22, 2026 14:41
@synerbot synerbot Bot mentioned this pull request Apr 24, 2026
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