-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
refactor: data cache release data #8216
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 refactors the release data provider to use Next.js 15's new 'use cache'
directive instead of React's cache()
function, enabling better caching optimization for release data across the application.
- Replaces React's
cache()
with Next.js 15's'use cache'
directive in the release data provider - Updates all components to use async/await pattern when consuming release data
- Refactors table components to separate server and client concerns
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
apps/site/next.config.mjs | Enables the useCache experimental feature in Next.js config |
apps/site/next-data/providers/releaseData.ts | Refactors provider to use 'use cache' directive instead of React's cache |
apps/site/layouts/Download.tsx | Makes layout async and passes release data as props |
apps/site/components/withDownloadSection.tsx | Updates to receive releases as props instead of fetching internally |
apps/site/components/withNodeRelease.tsx | Makes component async to await release data |
apps/site/components/withDownloadArchive.tsx | Adds await to release data call |
apps/site/components/withReleaseSelect.tsx | Temporarily disables release data usage with hardcoded empty array |
apps/site/components/Releases/PreviousReleasesTable/index.tsx | New server component that fetches release data |
apps/site/components/Releases/PreviousReleasesTable/TableBody.tsx | New client component extracted from original table |
apps/site/components/Releases/PreviousReleasesTable.tsx | Removed original component (replaced by split server/client components) |
apps/site/components/EOL/EOLReleaseTable/index.tsx | New server component that fetches release data |
apps/site/components/EOL/EOLReleaseTable/TableBody.tsx | New client component extracted from original table |
apps/site/components/EOL/EOLReleaseTable.tsx | Removed original component (replaced by split server/client components) |
apps/site/app/[locale]/download/archive/[version]/page.tsx | Adds await to release data call |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8216 +/- ##
==========================================
+ Coverage 76.43% 76.44% +0.01%
==========================================
Files 115 115
Lines 9643 9643
Branches 317 317
==========================================
+ Hits 7371 7372 +1
+ Misses 2271 2270 -1
Partials 1 1 ☔ View full report in Codecov by Sentry. |
@araujogui / @avivkeller can we prioritize this? If #8232 is a real issue, then that's concerning and should be fixed. |
Working on it a bit |
5886e1b
to
571db29
Compare
I think I got it by passing the releases as a property to the |
Does it need the full release data? Note the server to client props are embedded within the HTML or on the JavaScript client-side bundle |
So depending what you're passing it might create a big json on client side |
Description
Refactor release data provider to use
use cache
directive.Validation
Related Issues
Related to #8207
Check List
pnpm format
to ensure the code follows the style guide.pnpm test
to check if all tests are passing.pnpm build
to check if the website builds without errors.