perf: lazy-load sentry in auth forms to reduce first-load JS (#951)#954
Merged
sw-factory-automations merged 1 commit intomainfrom May 8, 2026
Merged
perf: lazy-load sentry in auth forms to reduce first-load JS (#951)#954sw-factory-automations merged 1 commit intomainfrom
sw-factory-automations merged 1 commit intomainfrom
Conversation
Co-authored-by: Ona <no-reply@ona.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
✅ UI verification passed — design spec compliance confirmed. All changes are limited to import statements (static → dynamic |
Collaborator
Author
|
✅ Post-merge verification passed. E2E tests (auth suite against live site): 36/36 passed — Ad-hoc smoke tests:
Skipped:
No interaction smoke test needed — this is a |
This was referenced May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #951
What
Lazy-load
@/lib/sentryin auth form components to keep the sentry error classification module (~22kB source) out of the initial page JS for auth routes.How
Replaced static
import { captureSupabaseError } from "@/lib/sentry"with dynamicimport("@/lib/sentry").then(...)in three files:forgot-password-form.tsx— only loads sentry whenresetPasswordForEmailfailsreset-password-form.tsx— only loads sentry whenupdateUserfailsoauth-buttons.tsx— already dynamically imported itself, but its static sentry import was pulling the module into the dynamic chunkThis follows the same lazy-loading pattern used by
@/lib/capture.tsand@/lib/toast.ts.Updated
oauth-buttons.test.tsxto wrap thecaptureSupabaseErrorassertion insidewaitForsince the dynamic import makes the call asynchronous.Bundle sizes (gzipped first-load JS)
/sign-in/sign-up/forgot-password/reset-passwordThe framework baseline (Next.js + React runtime shared by all routes) accounts for ~160 kB. The remaining ~27 kB is auth-specific UI components and form code.
Testing
pnpm lint— 0 errorspnpm typecheck— passespnpm test— 133 files, 1818 tests passedauth.spec.ts,password-reset.spec.ts,public-routes.spec.ts) — 36 tests passedpnpm build— all auth routes under 200 kB budget