Skip to content
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

fix: fixed localized links and next links redirection #5474

Merged
merged 6 commits into from
Jul 5, 2023
Merged

fix: fixed localized links and next links redirection #5474

merged 6 commits into from
Jul 5, 2023

Conversation

ovflowd
Copy link
Member

@ovflowd ovflowd commented Jul 5, 2023

Description

This PR is a "hot-fix" PR that does the following changes:

  • It updates the LocalizedLink component by conditionally either rendering next/link or a href
  • We removed some usages of LocalizedLink when it's not needed
  • Remove the Vercel Analytics from Static Exported builds
  • Refactoring LocalizedLink by adopting memoization

There are minor unrelated changes (such as removing an eslint rule that is unnecessary) and npm run format reformatted an SCSS file.

@ovflowd ovflowd requested a review from a team as a code owner July 5, 2023 15:43
@vercel
Copy link

vercel bot commented Jul 5, 2023

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

Name Status Preview Comments Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 5, 2023 4:18pm
nodejs-org-stories ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 5, 2023 4:18pm

@ovflowd ovflowd added bug fast-track Fast Tracking PRs infrastructure Issues/PRs related to the Repository Infra labels Jul 5, 2023
@ovflowd
Copy link
Member Author

ovflowd commented Jul 5, 2023

Requesting fast-tracking @nodejs/build @nodejs/website

@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories July 5, 2023 15:44 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org July 5, 2023 15:45 Inactive
@richardlau
Copy link
Member

Looks like Prettier is complaining https://github.com/nodejs/nodejs.org/actions/runs/5466287396/jobs/9950981528?pr=5474#step:7:20

@vercel vercel bot temporarily deployed to Preview – nodejs-org July 5, 2023 15:52 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories July 5, 2023 15:53 Inactive
@ovflowd
Copy link
Member Author

ovflowd commented Jul 5, 2023

This PR is a result of some of the studies done over This Slack thread that is part of the long-term investigation regarding the website stability on the DigitalOcean infrastructure, which is occasionally causing flakiness on our infrastructure.

As explained previously (including on the March 17th incident post-mortem), CloudFlare does not cache 404 requests, and some requests originated by Next.js itself (Next.js pre-fetching URLs) were causing high-load on our DigitalOcean infrastructure.

This PR removes the unnecessary pre-fetching from external links not hosted by this repository/the Next.js framework we use here, effectively reducing the amount of 404s.

This might alleviate some of the pain on the DO's servers. Remember that regardless of the current "incident", external links should not be pre-fetched by Next.js.

@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories July 5, 2023 16:05 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org July 5, 2023 16:06 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories July 5, 2023 16:11 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org July 5, 2023 16:12 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org July 5, 2023 16:17 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories July 5, 2023 16:18 Inactive
@ovflowd ovflowd merged commit cacfb31 into nodejs:main Jul 5, 2023
6 checks passed
@ovflowd ovflowd deleted the fix/localized-link-next-link-usage branch July 5, 2023 16:22
pages/_app.tsx Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fast-track Fast Tracking PRs infrastructure Issues/PRs related to the Repository Infra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants