ForesightJS  by spaansba

Predicts user intent for optimized prefetching

Created 8 months ago
1,473 stars

Top 27.7% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

ForesightJS is a lightweight JavaScript library designed to predict user intent based on mouse and keyboard navigation, enabling proactive prefetching to enhance perceived website performance. It targets web developers seeking to optimize user experience by intelligently triggering resource loads before explicit user interaction, benefiting both mouse and keyboard users.

How It Works

ForesightJS analyzes cursor trajectory, scroll events, and keyboard tab sequences to predict which elements a user is likely to interact with. This predictive approach allows developers to initiate resource loading (e.g., prefetching) during the optimal "when" window, bridging the latency gap of traditional hover-based prefetching and avoiding the waste of viewport-based prefetching.

Quick Start & Requirements

  • Install: pnpm add js.foresight, npm install js.foresight, or yarn add js.foresight
  • Requirements: Browser environment.
  • Documentation: https://foresightjs.org/ (implied by framework integration links)

Highlighted Details

  • Solves latency in hover-based prefetching by predicting intent 80ms ahead.
  • Avoids wasteful prefetching common in viewport-based strategies.
  • Includes keyboard navigation analysis, improving accessibility.
  • Offers a visual debugging mode for tuning predictions.

Maintenance & Community

  • Integrations available for Next.js and React Router.
  • Contributions for new framework integrations are welcomed.
  • Future plans include decoupling the debugger and offloading processing to improve performance and accessibility.

Licensing & Compatibility

  • License: Not explicitly stated in the README.
  • Compatibility: Framework agnostic, with specific integrations for Next.js and React Router.

Limitations & Caveats

The library does not register elements for touch devices or users on limited connections (2G/data-saver mode), though it provides properties to implement fallback strategies. The specific license is not mentioned, which may impact commercial use.

Health Check
Last Commit

1 week ago

Responsiveness

1 day

Pull Requests (30d)
24
Issues (30d)
0
Star History
16 stars in the last 30 days

Explore Similar Projects

Starred by Stas Bekman Stas Bekman(Author of "Machine Learning Engineering Open Book"; Research Engineer at Snowflake), Elvis Saravia Elvis Saravia(Founder of DAIR.AI), and
2 more.

YaFSDP by yandex

0%
983
Sharded data parallelism framework for transformer-like neural networks
Created 1 year ago
Updated 1 month ago
Starred by François Chollet François Chollet(Author of Keras; Cofounder of Ndea, ARC Prize), Chaoyu Yang Chaoyu Yang(Founder of Bento), and
13 more.

neon by NervanaSystems

0%
4k
Deep learning framework (discontinued)
Created 11 years ago
Updated 5 years ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Jiayi Pan Jiayi Pan(Author of SWE-Gym; MTS at xAI), and
34 more.

flash-attention by Dao-AILab

0.6%
22k
Fast, memory-efficient attention implementation
Created 3 years ago
Updated 22 hours ago
Feedback? Help us improve.