You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently optimizing the marketing pages of my application (built with nextjs and supabase).
One of the problems I'm facing is that I'm using createMiddlewareClient on the nextjs middleware to handle the authentication on my app. The problem is that the nextjs middleware is browser based, so the imported modules gets to the bundle fetched by the user.
Importing createMiddlewareClient adds a around ~30kb to the bundle, the problem is that Lighthouse tests indicates that ~23kb of that is unused.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
import { createMiddlewareClient } from '@supabase/auth-helpers-nextjs' on nextjs middleware.
Deploy application and analyze the generated bundle
Supabase code will be fetched by users when visiting pages that are affected by the middleware.
A lot of code is not used.
Expected behavior
I'm not really sure if the supabase code is tree shaken. Ideally unused code should not get to the js bundle
The text was updated successfully, but these errors were encountered:
same here. I noticed that the docs now recommend using @supabase/ssr over @supabase/auth-helpers-nextjs, but the bundle size of ssr is still pretty hefty (25.92 KB Gzipped on version "^0.3.0")
anyone on the team got any recommendations for tree shaking?
Bug report
Describe the bug
I'm currently optimizing the marketing pages of my application (built with nextjs and supabase).
One of the problems I'm facing is that I'm using
createMiddlewareClient
on the nextjs middleware to handle the authentication on my app. The problem is that the nextjs middleware is browser based, so the imported modules gets to the bundle fetched by the user.Importing
createMiddlewareClient
adds a around ~30kb to the bundle, the problem is that Lighthouse tests indicates that ~23kb of that is unused.To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
import { createMiddlewareClient } from '@supabase/auth-helpers-nextjs'
on nextjs middleware.Expected behavior
I'm not really sure if the supabase code is tree shaken. Ideally unused code should not get to the js bundle
The text was updated successfully, but these errors were encountered: