-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat(cache): use cache
more often
#8238
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
The latest updates on your projects. Learn more about Vercel for GitHub.
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
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.
Pull Request Overview
This PR extends the use cache
directive implementation to additional data providers as a follow-up to PR #8216, modernizing the caching approach for performance optimization.
- Replaces React's
cache
function with Next.jsuse cache
directive for three providers - Simplifies provider modules by moving cache logic to generators and importing directly
- Updates consuming components to handle async provider functions
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
apps/site/next.dynamic.constants.mjs | Adds await to provideReleaseVersions call |
apps/site/next-data/providers/vulnerabilities.ts | Converts to use cache directive and direct import |
apps/site/next-data/providers/supportersData.ts | New file with use cache directive |
apps/site/next-data/providers/supportersData.mjs | Deleted file (moved to .ts) |
apps/site/next-data/providers/releaseVersions.ts | Converts to use cache directive and direct import |
apps/site/next-data/providers/releaseData.ts | Simplified to direct import |
apps/site/next-data/generators/supportersData.mjs | Changed export to default export |
apps/site/components/withSupporters.tsx | Updated to async component with await call |
apps/site/components/EOL/EOLReleaseTable/index.tsx | Added await to provideVulnerabilities call |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Since these three providers are all simple, I did this in a single PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8238 +/- ##
=======================================
Coverage 76.44% 76.44%
=======================================
Files 115 115
Lines 9643 9643
Branches 317 317
=======================================
Hits 7372 7372
Misses 2270 2270
Partials 1 1 ☔ View full report in Codecov by Sentry. |
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.
SGTM!
I assume that's all usages/imports of the server data? |
No (see #8238 (comment)). There is also the blog data and snippet data, but that's a bit different (since it's not a simple re-export), so I figured I'd break it up. |
I figured we'd group them into:
|
Let's merge this now (fast-track) and go to the next ones! |
Follow-up #8216.
Enables the
use cache
directive on:provideVulnerabilities
provideReleaseVersion
provideSupporters