Commit Graph

6 Commits

Author SHA1 Message Date
google-labs-jules[bot]
58b82d04c1 Optimize useTypingEffect to reduce re-renders and timer churn
Refactored the useTypingEffect hook to use a Ref for accessing the current text state inside the timer loop.
This prevents the main useEffect from being torn down and recreated on every single character keystroke, significantly reducing timer setup/cleanup overhead.

Baseline Effect Runs for 'Hello': 13
Optimized Effect Runs for 'Hello': 4

Also split the logic into two effects:
1. One for handling immediate state transitions (word switching).
2. One for the timer loop (typing/deleting/pausing).

This ensures correct behavior while maximizing performance.
2026-01-23 09:28:02 +00:00
Melvin Ragusa
acfbb8571c Merge pull request #7 from ragusa-it/perf/navbar-scroll-throttling-16938841465799544697
 Optimize Navbar scroll listener with requestAnimationFrame
2026-01-23 10:06:57 +01:00
google-labs-jules[bot]
8592775485 perf: throttle scroll event listener in Navbar
Implemented `requestAnimationFrame` throttling for the scroll event listener in `Navbar` to reduce the frequency of state updates and logic execution.

- Wrapped scroll handler in `requestAnimationFrame`.
- Added performance test `src/components/layout/Navbar.test.tsx` verifying logic runs once per frame instead of per event.
- Verified functional correctness of scroll state updates.
- Fixed `useTypingEffect` test environment.
2026-01-22 08:24:10 +00:00
google-labs-jules[bot]
e5189b3bfd Refactor useTypingEffect to use unified timer logic and optimize dependencies 2026-01-22 08:22:39 +00:00
google-labs-jules[bot]
8f820e262f Fix uncleaned setTimeout in useTypingEffect hook
Refactor useTypingEffect to use a single useEffect with proper cleanup for all timers, preventing state updates on unmounted components.
Add unit tests to verify behavior and ensure no memory leaks on unmount.
2026-01-22 04:43:55 +00:00
Melvin Ragusa
eccc359782 feat: initialize reactjs project using vite 2026-01-21 22:38:10 +01:00