github spaansba/ForesightJS V2.1
V2.1 ~ Performance Gains and better debugger!

latest releases: V3.3.4, V3.3.2, V3.3.1...
6 months ago

Features

  • Added onAnyCallbackFired to the ForesightManager, this function will run when ANY callback function is hit. Read More
  • Added new debuggerSettings.showNameTags to show or hide name tags on startup (true by default)
  • Added toggle to hide/show name tags in debugger
  • The debugger now shows an icon 👁 for if a registered element is in the viewport and thus being tracked
  • The debugger now shows total amount of visible elements and total callback hitcount (split by mouse and tab)
  • Added new Static Property Foresightmanager.instance.getManagerData this has:
    • The current global settings
    • Map of registered elements and their associated data
    • Map of elements that are currently being observed (aka that are in the viewport)
    • Count of total callbacks (split by mouse and tab)

Docs

Changes

  • Removed ResizeObserver, scroll events and resize events. Replaced it with PositionObserver. Read more about why.
  • Added IntersectionObserver to only observe elements currently in the viewport.
  • Registered element's name will now be backfilled by ID if there is no name, still defaults to “” if both are missing.
  • Debug overlays are now being calculated using transform instead of setting their bounds for performance. This removes any Cumulative Layout Shift (CLS) while moving the mouse in debug mode
  • Renamed ForesightManagerProps type to ForesightManagerSettings
  • Renamed UpdateForsightManagerProps type to UpdateForsightManagerSettings

Deprecations

  • Deprecated resizeScrollThrottleDelay since scroll and resize events have been removed. resizeScrollThrottleDelay will be fully removed in V3.0+

Shoutouts

Don't miss a new ForesightJS release

NewReleases is sending notifications on new releases.