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

Fallback to tap prefetch strategy on slow connection #9092

Merged
merged 6 commits into from
Nov 22, 2023

Conversation

0xtimsb
Copy link
Contributor

@0xtimsb 0xtimsb commented Nov 13, 2023

Changes

  1. Fallback to tap prefetch strategy on slow connection, instead of bailing.
  2. Add ignoreSlowConnection option to prefetch API, which lets manually prefetch even on data saver mode or slow connection.

Testing

Tested on test cases added in this PR #8951

Docs

Docs: withastro/docs#5393

This PR also has changesets and JSDoc for review.

Copy link

changeset-bot bot commented Nov 13, 2023

🦋 Changeset detected

Latest commit: d0938b4

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pr: docs A PR that includes documentation for review label Nov 13, 2023
packages/astro/src/prefetch/index.ts Outdated Show resolved Hide resolved
packages/astro/src/prefetch/index.ts Outdated Show resolved Hide resolved
.changeset/neat-mangos-judge.md Outdated Show resolved Hide resolved
@0xtimsb 0xtimsb requested a review from bluwy November 14, 2023 19:43
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Thanks! Implementation looks clean. Fine with not having tests for now as it's tricky to test for slow connections.

NOTE: since this is a minor change, we'll queue this up for the minor release on next Wednesday.

@bluwy bluwy added the semver: minor Change triggers a `minor` release label Nov 15, 2023
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Happy with these changesets as long as the one that changes the prefetch fallback starts with "Changes..." and describes a change from old behaviour to new! 🙌

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@bluwy bluwy merged commit 0ea4bd4 into withastro:main Nov 22, 2023
12 of 13 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Nov 22, 2023
natemoo-re pushed a commit that referenced this pull request Nov 22, 2023
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants