Features
- added a margin in the direction of the scroll in which prefetches will happen Playground
- added
enableScrollPredictionto toggle whether we should prefetch based on scroll - added
scrollMarginto set the amount of px in scroll margin
Debugger Features
- added green line to visualize the new scroll prefetching
- added
enableScrollPredictionandscrollMarginto the control panel - added
sortElementListto sort the elements in the debugger control panel by "visibility", "insertionOrder" or "documentOrder" read more - added live tracker of the callback execution stats in the control panel. This will show you the amount of visible registered elements and the amount of callbacks ran with their type/subtype.
Changes
- Tab Prediction got a big performance boost by caching tabbable elements and optimizing the index lookup algorithm. [read more here]
(https://foresightjs.com/docs/Behind_the_Scenes) - Debugger info explanations are now a lot more detailed.
globalCallbackHitsin theForesightManager.instance.getManagerDatastatic property now show total callback execution counts by interaction type (mouse/tab/scroll) and by subtype (hover/trajectory for mouse, forwards/reverse for tab, direction for scroll)- Renamed
UpdateForsightManagerPropstype toUpdateForsightManagerSettings - JSDocs are more detailed with links to actual docs
- Now use
translate3dinstead of setting 'top' 'left' etc on debug elements to avoid reflow
Bug Fixes
- Debugger callback animations now stick to the screen when scrolling
Docs
- Docs are updated to V2.2
- Every page in the docs is available in markdown format (try adding .md to any documentation URL e.g. https://foresightjs.com/docs/getting_started/config.md). You can share these markdown files as context with AI assistants. All these .md files are also consolidated in the llms.txt file.
Shoutout
Massive thanks to @thednp for the idea/implementation plan of the Scroll Prediction and performance suggestions to limit the amount of reflow.