SupabaseInian ParameshwaranProblem & solution
Making the Supabase Dashboard Supa-fast
Summary
Adding features to the Supabase single-page application dashboard risked performance regressions due to increasing JavaScript bundle sizes. To establish a baseline, the engineering team introduced next-bundle-analyzer and tracked Real User Monitoring alongside Core Web Vitals using Sentry. Optimization efforts focused on pruning dependencies, which included swapping Moment.js for day-js, replacing Joi with ajv, reverting crypto-js to version 3.3.0, and moving the 388 KB zxcvbn password module to a backend API. The team also implemented Next.js dynamic imports for heavy components like spreadsheet parsing, removed legacy server-side props to unlock Automatic Static Optimization, and configured long cache headers on assets. These architectural adjustments brought Core Web Vitals within recommended thresholds and lowered client-side page transition payloads below 200 KB of JavaScript.
Context
Adding new features like a Monaco-backed SQL editor and database views to the Supabase single-page dashboard led to bundle growth and potential performance regressions across the application.
Approach / What changed
The team established bundle and Core Web Vitals baselines, replaced bloated npm dependencies with lightweight or native alternatives, offloaded password-checking logic to the server, lazy-loaded large components with dynamic imports, enabled Next.js Automatic Static Optimization, and corrected browser cache headers.
Takeaways
Replacing heavy frontend libraries with lightweight or native alternatives, such as switching from Moment.js to day-js or using native fetch instead of axios, substantially reduces bundle footprint.
Moving computation-heavy modules like zxcvbn to backend APIs and lazy-loading large dependencies like xlsx prevents massive scripts from loading on initial visits.
Enabling Next.js Automatic Static Optimization by removing getServerSideProps and getInitialProps allows pages to be pre-rendered to HTML and cached on CDNs.
Source and freshness
- Source
- supabase.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.