Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(chore): nextjs bundle analysis #1269

Merged
merged 24 commits into from
Aug 8, 2024
Merged

Conversation

abvthecity
Copy link
Contributor

@abvthecity abvthecity commented Aug 8, 2024

Fixes FER-2854

Before this PR After this PR
Before this PR After this PR

First-load JS savings: 114kb (-25%) (gzipped!)

The reduction of first-load JS to 329kb is just within the 350kb threshold.


Reasoning:

  • _app.js was importing code from fern-api/fdr-sdk that it doesn't use, i.e. FdrClient.
  • renderStylesheet imports code from radix and color.js, which did not need to be client-side. Shifted this over to getStaticProps.
  • deleted datadog (deduplicate error logging from sentry)
  • removed radix react-icons (which is not tree-shakeable) and react-feather, in favor of iconoir
  • upgraded sonner to 1.5.0, which reduced its bundle footprint

Also in this PR: nextjs-bundle-analysis github action. Once merged, it will compare the bundle size against main.

Copy link

vercel bot commented Aug 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fern-dashboard-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2024 10:23pm
fern-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2024 10:23pm
fern-prod ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2024 10:23pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
fern-dashboard ⬜️ Ignored (Inspect) Aug 8, 2024 10:23pm
fontawesome-cdn ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2024 10:23pm
private-docs ⬜️ Ignored (Inspect) Aug 8, 2024 10:23pm

Copy link

linear bot commented Aug 8, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants