-
Notifications
You must be signed in to change notification settings - Fork 11
Apply Plotly code splitting #1044
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
Conversation
✅ Deploy Preview for antenna-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThe Plot component import in the species-details page was refactored to use a named import from a lazy-loaded module instead of a default import from the standard module path, changing the import source from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (1)
Comment |
mihow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was fewer changes that I would have expected. Nice optimization!

The Plotly lib is very large, which means if we include it to our main JS bundle, it will affect our FCP metric (First Contentful Paint). By lazy loading this lib, we can present content to users sooner. Compared to other assets we load, a few MB might not seem like a big deal, but it's important to keep the main bundle as small as possible.
I had already prepared code for this, but forgot to apply it to the new species charts.
Before (Plotly part of main bundle):

After (splitting Plotly code into a separate chunk):

You can see here the library itself actually way larger than the rest of the frontend app.
Summary by CodeRabbit