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

Disable Link prefetching across components #443

Merged
merged 2 commits into from
Jan 21, 2025
Merged

Disable Link prefetching across components #443

merged 2 commits into from
Jan 21, 2025

Conversation

jrhoads
Copy link
Contributor

@jrhoads jrhoads commented Jan 20, 2025

Purpose

Improve performance and user experience by disabling prefetching for Next.js Link components across various components.

Approach

By adding prefetch={false} to all <Link> components in the project, we prevent unnecessary network requests and improve initial page load performance.

Key Modifications

  • Added prefetch={false} to <Link> components in the following files:
    • FacetListItem.tsx
    • OrganizationMetadata.tsx
    • PersonEmployment.tsx
    • RepositoryDetail.tsx
    • RepositoryMetadata.tsx
    • WorkFunding.tsx
    • WorkMetadata.tsx
    • WorkPerson.tsx

Important Technical Details

  • Next.js prefetch prop defaults to true for <Link> components, which can cause unnecessary network requests
  • Disabling prefetching reduces initial page load time and bandwidth usage
  • No functional changes to link behavior or routing

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

Copy link

cypress bot commented Jan 20, 2025

akita    Run #1507

Run Properties:  status check passed Passed #1507  •  git commit bb412acf09 ℹ️: Merge 057ad73bad800dafd822e254b5e9a56962189846 into c22c6f33af9d82b1dc5022a39de3...
Project akita
Branch Review no-prefetch
Run status status check passed Passed #1507
Run duration 01m 41s
Commit git commit bb412acf09 ℹ️: Merge 057ad73bad800dafd822e254b5e9a56962189846 into c22c6f33af9d82b1dc5022a39de3...
Committer Joseph Rhoads
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 3
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 52
View all changes introduced in this branch ↗︎

@jrhoads jrhoads requested review from bklaing2, codycooperross and a team January 20, 2025 12:33
@jrhoads jrhoads merged commit 19ddc26 into master Jan 21, 2025
12 checks passed
@jrhoads jrhoads deleted the no-prefetch branch January 21, 2025 13:50
Copy link

cypress bot commented Jan 21, 2025

akita    Run #1511

Run Properties:  status check passed Passed #1511  •  git commit 19ddc26414: Merge pull request #443 from datacite/no-prefetch
Project akita
Branch Review 1.16.1
Run status status check passed Passed #1511
Run duration 01m 40s
Commit git commit 19ddc26414: Merge pull request #443 from datacite/no-prefetch
Committer Joseph Rhoads
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 3
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 52
View all changes introduced in this branch ↗︎

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.

2 participants