Skip to content

fix: deploy#11

Merged
priom merged 4 commits intoprodfrom
fix/deploy
Mar 31, 2026
Merged

fix: deploy#11
priom merged 4 commits intoprodfrom
fix/deploy

Conversation

@priom
Copy link
Copy Markdown
Member

@priom priom commented Mar 31, 2026

React 19 Code Review Checklist

Use this checklist when reviewing PRs that modify React components.

useEffect Anti-Patterns

  • No derived state in useEffect - State calculated from props/other state should be computed during render, not in useEffect

    // BAD
    useEffect(() => setFiltered(items.filter(...)), [items])
    
    // GOOD
    const filtered = items.filter(...)
  • No state reset in useEffect - Use key prop to reset component state when props change

    // BAD
    useEffect(() => { setFormData({}); }, [userId])
    
    // GOOD
    <FormComponent key={userId} />
  • No localStorage/sessionStorage reads in useEffect - Initialize state from storage

    // BAD
    useEffect(() => { setData(localStorage.getItem('key')); }, [])
    
    // GOOD
    const [data] = useState(() => localStorage.getItem('key'))
  • No event handling logic in useEffect - Put it in event handlers

    // BAD
    useEffect(() => { if (submitted) navigate('/success'); }, [submitted])
    
    // GOOD
    const handleSubmit = () => { navigate('/success'); }
  • useEffect only for external system sync - WebSockets, DOM APIs, third-party libs

useMemo/useCallback

  • No useMemo for simple calculations - React 19 compiler handles this

    // BAD
    const total = useMemo(() => a + b, [a, b])
    
    // GOOD
    const total = a + b
  • No useCallback for simple event handlers - Unless passed to memoized children

    // BAD (if Button is not memoized)
    const handleClick = useCallback(() => setCount(c => c + 1), [])
    
    // GOOD
    const handleClick = () => setCount(c => c + 1)
  • Keep useMemo for expensive operations - Array sorting, filtering large datasets, complex transformations

React 19 Patterns

  • No forwardRef - Pass ref as regular prop

    // BAD
    const Input = forwardRef((props, ref) => <input ref={ref} />)
    
    // GOOD
    const Input = ({ ref, ...props }) => <input ref={ref} {...props} />
  • Use new hooks where applicable

    • useActionState for form state management
    • useOptimistic for optimistic UI updates
    • useFormStatus to access parent form state
    • use() to read promises in render

Server/Client Components

  • Default to Server Components - No directive needed
  • 'use client' only when needed - useState, useEffect, event handlers, browser APIs
  • 'use server' for Server Actions - Database operations, mutations

Performance

  • Virtualize long lists - Use @tanstack/react-virtual for 100+ items
  • Lazy load heavy components - React.lazy() with Suspense
  • Debounce expensive operations - Search inputs, API calls

Reference: See react-19-guidelines.md for detailed examples and explanations.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 31, 2026

Deploying hyperterminal with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3a031a3
Status: ✅  Deploy successful!
Preview URL: https://fbd8dec2.hyperterminal.pages.dev
Branch Preview URL: https://fix-deploy.hyperterminal.pages.dev

View logs

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Vite configuration to include the global variable in the nodePolyfills plugin, which facilitates compatibility for libraries requiring a Node.js-like environment. I have no feedback to provide.

@priom priom merged commit 3380e5b into prod Mar 31, 2026
3 checks passed
@priom priom deleted the fix/deploy branch March 31, 2026 22:36
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