Skip to content

Conversation

@nairmanu
Copy link
Collaborator

@nairmanu nairmanu commented Dec 23, 2025

This pull request introduces support for detecting and handling browser back-forward cache (bfcache) restoration events. The bfcache support ensures Clarity restarts and logs a diagnostic event when a page is restored from bfcache, improving reliability in session tracking. Comprehensive tests are also added to verify this new behavior.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for automatically restarting Clarity when a page is restored from the browser's back-forward cache (bfcache). The version has been bumped to 0.8.47-beta across all packages in preparation for this feature release.

Key changes:

  • Adds a new pageshow event handler to detect bfcache restoration and restart Clarity
  • Introduces a BFCache diagnostic code for logging these events
  • Updates all package versions to 0.8.47-beta with consistent dependency references

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/clarity-js/src/interaction/pageshow.ts New module that binds to the pageshow event and restarts Clarity when page is restored from bfcache (evt.persisted === true)
packages/clarity-js/src/interaction/index.ts Integrates the new pageshow module into the interaction lifecycle by calling pageshow.start() and pageshow.stop()
packages/clarity-js/types/data.d.ts Adds BFCache = 11 to the Code enum for diagnostic logging
packages/clarity-js/src/core/version.ts Updates version to 0.8.47-beta
packages/clarity-js/package.json Updates version to 0.8.47-beta
packages/clarity-decode/package.json Updates version and clarity-js dependency to 0.8.47-beta
packages/clarity-visualize/package.json Updates version and clarity-decode dependency to 0.8.47-beta
packages/clarity-devtools/package.json Updates version and all clarity package dependencies to 0.8.47-beta
packages/clarity-devtools/static/manifest.json Updates Chrome extension version to 0.8.47-beta
package.json Updates root package version to 0.8.47-beta
lerna.json Updates Lerna version to 0.8.47-beta

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.

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.

2 participants