DEV Community

Discussion on: What is the best performance tweak for server/frontend side of application you made?

Collapse
 
sannajammeh profile image
Sanna Jammeh • Edited

For Firebase, if you haven't updated to V9 already. Lazy import not commonly used packages for example realtime-database and shave 50-100kb off your bundle size. And upgrade to V9 already! 😅

For React specifically. When making requests, abandon useEffect+ fetch and install SWR. Saves you a ton of hassle both in DX and UX. Caches requests for you leaving a single hook acting as a global data store for that request. Also use optimistic updates with SWR mutate to update the UI before you've sent a request to change or create.