-
Notifications
You must be signed in to change notification settings - Fork 81
feat(react-dom): integrate js.foresight for predictive interaction detection (experimental) #1748
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Co-authored-by: manudeli <[email protected]>
People can be co-author:
|
packages/forsightjs/package.json
Outdated
| @@ -0,0 +1,62 @@ | |||
| { | |||
| "name": "forsightjs", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Don't make @suspensive/forsightjs, Just make new interface for @suspensive/react-dom depending js.foresight like https://foresightjs.com/docs/integrations/react/useForesight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I've removed the custom @suspensive/forsightjs package and integrated with the existing js.foresight library instead.
Created a React interface for @suspensive/react-dom that provides:
useForesighthook for React integration with js.foresightForesightcomponent for render-prop pattern usage- Full TypeScript support and comprehensive tests
The implementation follows the pattern from https://foresightjs.com/docs/integrations/react/useForesight and enables predictive interaction detection based on mouse trajectory, keyboard navigation, and scroll behavior.
Commit: b19162b
|
@copilot You should also make document for this apis in official doc too |
…tection - Remove custom forsightjs package and integrate existing js.foresight library - Add js.foresight as dependency to @suspensive/react-dom - Create useForesight hook for React integration with js.foresight - Add Foresight component for render-prop pattern usage - Include comprehensive tests and TypeScript definitions - Support predictive prefetching based on mouse trajectory, keyboard navigation, and scroll behavior Co-authored-by: manudeli <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
- Add English documentation for Foresight component with interactive examples - Add English documentation for useForesight hook with detailed usage patterns - Add Korean documentation for both Foresight component and useForesight hook - Update navigation metadata files to include new API documentation - Include comprehensive examples showing callback, hitSlop, disabled, and other props - Add interactive Sandpack examples demonstrating real-world usage patterns Co-authored-by: manudeli <[email protected]>
Done! I've added comprehensive documentation for the Foresight APIs in both English and Korean: English Documentation:
Korean Documentation:
The documentation includes:
Commit: 8764803 |
The documentation has already been created and will be available at https://suspensive.org once deployed: English Documentation:
Korean Documentation:
Both include comprehensive examples and API documentation. This was completed in commit 8764803. |
|
@copilot
|
- Add @experimental JSDoc tags to useForesight hook and Foresight component - Add experimental warnings at the top of English documentation - Add experimental warnings at the top of Korean documentation - Clearly indicate that the interface may change in the future Co-authored-by: gwansikk <[email protected]>
Done! I've marked the Foresight APIs as experimental: JSDoc Changes:
Documentation Changes:
Commit: 3a747e9 |
|
@copilot In the documentation, indicate experimental at the top as shown below: |
... The experimental warnings are already in place in the documentation:
This was completed in commit 3a747e9. |
Integrates the existing
js.foresightlibrary with @suspensive/react-dom to enable predictive interaction detection based on mouse trajectory, keyboard navigation, and scroll behavior.Changes Made
useForesighthook for React integration with js.foresightForesightcomponent for render-prop pattern usageFeatures
The integration provides predictive interaction capabilities that enable:
Documentation
Added comprehensive documentation including:
English Documentation
/docs/react-dom/Foresight- Complete component documentation with interactive examples/docs/react-dom/useForesight- Detailed hook documentation with usage patternsKorean Documentation
/docs/react-dom/Foresight- 컴포넌트 완전 문서화 및 인터랙티브 예제/docs/react-dom/useForesight- 훅 상세 문서화 및 사용 패턴The documentation includes interactive Sandpack examples for all major props and features, real-world usage patterns with prefetching scenarios, and complete API reference with TypeScript information.
Experimental Status
useForesightand<Foresight/>are marked as experimental with:@experimentalJSDoc tags in the source codeUsage Example
This enables smart prefetching and UI optimization before user interactions actually happen, significantly improving perceived performance and user experience.
Fixes #1655.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.