Skip to content

meta: remove weird fetch/generator thingies, rely on next's internal revalidate api #8001

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

Merged
merged 7 commits into from
Jul 20, 2025

Conversation

ovflowd
Copy link
Member

@ovflowd ovflowd commented Jul 20, 2025

This PR removes our obsolete hacky approach of fetching() stuff on certain environments. Due to the staticness of our website (our dynamic router is static) and revalidates data as needed. These APIs were introduced at a time we were not using such feature.

  • This removes hacky internal self-fetching which is not available on all environments/deployments and it is hacky and was often a source of issues
  • Reduces amount of async stuff
  • Removes the need of building these next-data URLs
  • Less async components.

@Copilot Copilot AI review requested due to automatic review settings July 20, 2025 15:06
@ovflowd ovflowd requested review from a team as code owners July 20, 2025 15:07
Copy link

vercel bot commented Jul 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Jul 20, 2025 7:17pm

@ovflowd ovflowd added the github_actions:pull-request Trigger Pull Request Checks label Jul 20, 2025
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Jul 20, 2025
Copy link
Contributor

github-actions bot commented Jul 20, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 94 🟢 100 🟢 100 🔴 66 🔗
/en/about 🟢 100 🟢 97 🟢 100 🔴 58 🔗
/en/about/previous-releases 🟢 99 🟢 93 🟢 100 🔴 61 🔗
/en/download 🟢 96 🟢 100 🟢 100 🔴 66 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🔴 69 🔗

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 removes the obsolete self-fetching mechanism that was used to retrieve data through internal Next.js APIs, simplifying the architecture by relying on Next.js's built-in revalidation instead. The changes eliminate hacky fetch operations that were problematic across different deployment environments.

  • Removes internal fetch-based data retrieval system and associated API routes
  • Converts async React Server Components to synchronous components
  • Eliminates environment-specific logic for VERCEL_REGION and related constants

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
turbo.json Removes VERCEL_REGION environment variable from build configurations
next.constants.mjs Removes VERCEL_REGION, IS_NOT_VERCEL_RUNTIME_ENV, and NEXT_DATA_URL constants
next-data/releaseData.ts Removes entire fetch-based release data retrieval module
next-data/downloadSnippets.ts Removes entire fetch-based download snippets retrieval module
layouts/Download.tsx Converts async component to synchronous
layouts/Blog.tsx Converts from server-side to client-side translations and removes async
components/withNodeRelease.tsx Converts async component to synchronous, uses direct provider import
components/withDownloadSection.tsx Converts async component to synchronous, uses direct provider imports
app/[locale]/next-data/release-data/route.ts Removes API route entirely
app/[locale]/next-data/download-snippets/route.tsx Removes API route entirely

@ovflowd
Copy link
Member Author

ovflowd commented Jul 20, 2025

cc @nodejs/nodejs-website this is a cleanup, would appreciate some 👀 no need to fast-track.

Copy link

codecov bot commented Jul 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.92%. Comparing base (42d64f0) to head (044454c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8001      +/-   ##
==========================================
- Coverage   73.04%   72.92%   -0.12%     
==========================================
  Files          95       95              
  Lines        8341     8308      -33     
  Branches      217      215       -2     
==========================================
- Hits         6093     6059      -34     
- Misses       2247     2248       +1     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ovflowd ovflowd added the github_actions:pull-request Trigger Pull Request Checks label Jul 20, 2025
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Jul 20, 2025
@ovflowd ovflowd added the github_actions:pull-request Trigger Pull Request Checks label Jul 20, 2025
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Jul 20, 2025
Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

LGTM !

@ovflowd ovflowd force-pushed the meta/remove-weird-obsole-generator-thingies branch from dee9ac4 to 6fded37 Compare July 20, 2025 19:13
@avivkeller avivkeller added the fast-track Fast Tracking PRs label Jul 20, 2025
@avivkeller
Copy link
Member

@ovflowd Requesting fast-track

@avivkeller avivkeller added the github_actions:pull-request Trigger Pull Request Checks label Jul 20, 2025
@ovflowd
Copy link
Member Author

ovflowd commented Jul 20, 2025

cc @nodejs/nodejs-website requesting fast-track as this apparently fixes the main branch issues 🙇

@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Jul 20, 2025
@avivkeller avivkeller enabled auto-merge July 20, 2025 19:18
@ovflowd ovflowd disabled auto-merge July 20, 2025 19:21
@ovflowd ovflowd merged commit 439f978 into main Jul 20, 2025
14 of 15 checks passed
@ovflowd ovflowd deleted the meta/remove-weird-obsole-generator-thingies branch July 20, 2025 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fast-track Fast Tracking PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants