Skip to content

Conversation

araujogui
Copy link
Member

Description

Refactor release data provider to use use cache directive.

Validation

image image

Related Issues

Related to #8207

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@Copilot Copilot AI review requested due to automatic review settings October 11, 2025 00:04
@araujogui araujogui requested review from a team as code owners October 11, 2025 00:04
Copy link

vercel bot commented Oct 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nodejs-org Ready Ready Preview Oct 16, 2025 5:09pm

Copy link
Contributor

@Copilot Copilot AI left a 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.

Copy link

codecov bot commented Oct 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.44%. Comparing base (f7c436e) to head (571db29).
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@araujogui araujogui marked this pull request as draft October 11, 2025 00:21
@ovflowd
Copy link
Member

ovflowd commented Oct 16, 2025

@araujogui / @avivkeller can we prioritize this? If #8232 is a real issue, then that's concerning and should be fixed.

@avivkeller
Copy link
Member

Working on it a bit

@avivkeller
Copy link
Member

I think I got it by passing the releases as a property to the WithReleaseSelect component, so marked as ready for review

@ovflowd
Copy link
Member

ovflowd commented Oct 16, 2025

I think I got it by passing the releases as a property to the WithReleaseSelect component, so marked as ready for review

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

@ovflowd
Copy link
Member

ovflowd commented Oct 16, 2025

So depending what you're passing it might create a big json on client side

@avivkeller avivkeller marked this pull request as draft October 16, 2025 20:53
@avivkeller avivkeller self-assigned this Oct 16, 2025
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.

3 participants