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

Preload visible links in viewport #86

Merged
merged 17 commits into from
Aug 13, 2023
Merged

Preload visible links in viewport #86

merged 17 commits into from
Aug 13, 2023

Conversation

daun
Copy link
Member

@daun daun commented Aug 11, 2023

Description

  • Install an IntersectionObserver on the viewport
  • Preload all links inside the viewport
  • Makes more sense than quicklink: better integrated, less polyfills, less options
  • Not enabled by default: added an option preloadVisibleLinks to enable it
  • Tested and working like a charm
  • Adds ~0.7K to the bundle (vs. 2K for quicklink)

Drive-by improvements

  • Check for bad network conditions (data-saver or 2G) where supported
  • Add an option preloadHoveredLinks to allow disabling that feature

Checks

  • The PR is submitted to the master branch
  • The code was linted before pushing (npm run lint)
  • All tests are passing (npm run test)
  • New or updated tests are included
  • The documentation was updated as required

Additional information

Closes #84

@daun daun changed the base branch from master to feature/preload-queue August 11, 2023 17:06
@daun daun requested a review from a team August 12, 2023 09:04
hirasso
hirasso previously approved these changes Aug 12, 2023
src/index.ts Show resolved Hide resolved
@daun daun changed the base branch from feature/preload-queue to master August 12, 2023 15:55
@daun daun dismissed hirasso’s stale review August 12, 2023 15:55

The base branch was changed.

@daun daun requested a review from a team August 12, 2023 16:10
@daun
Copy link
Member Author

daun commented Aug 12, 2023

I've rebased on the current master and updated the readme to mention the focus feature as well.

@hirasso Feel free to either reapprove or wait until you had a chance to give it a spin :)

@daun daun merged commit 7f03601 into master Aug 13, 2023
@daun daun deleted the feature/preload-visible branch August 13, 2023 15:50
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.

Feature: preload links in viewport
2 participants