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 11, 2025 0:05am

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.

Comment on lines +46 to +48
// const releaseData = provideReleaseData();
const { push } = useRouter();
const navigation = groupReleasesByStatus(releaseData);
const navigation = groupReleasesByStatus([]); // fix later
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded empty array and 'fix later' comment indicate incomplete implementation. This will break the release selection functionality. Consider either properly implementing the async data fetching pattern or removing this component temporarily if it's not ready.

Copilot uses AI. Check for mistakes.

Copy link

codecov bot commented Oct 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.66%. Comparing base (11fa0e5) to head (5886e1b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8216      +/-   ##
==========================================
+ Coverage   76.64%   76.66%   +0.01%     
==========================================
  Files         115      115              
  Lines        9623     9623              
  Branches      322      322              
==========================================
+ Hits         7376     7377       +1     
+ Misses       2246     2245       -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
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.

1 participant