Skip to content

Conversation

@Dobrunia
Copy link
Member

@Dobrunia Dobrunia commented Jan 14, 2026

Add Breadcrumbs Support to JavaScript Catcher

Adds automatic and manual breadcrumb tracking.

Features:

  • Automatic tracking: fetch/XHR requests, navigation, optional clicks
  • Manual API: hawk.breadcrumbs.add(), hawk.breadcrumbs.get(), hawk.breadcrumbs.clear()
  • Configurable limits and filtering via beforeBreadcrumb hook

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 breadcrumb management functionality to the JavaScript Catcher, enabling automatic and manual tracking of events leading up to errors. Breadcrumbs provide a chronological trail of user actions, network requests, and navigation events that help debug issues by providing context.

Changes:

  • Added automatic breadcrumb tracking for fetch/XHR requests, navigation events (History API), and optional UI clicks
  • Introduced public API methods: addBreadcrumb(), getBreadcrumbs(), clearBreadcrumbs()
  • Updated package to use @hawk.so/types v0.1.38 which includes Breadcrumb type definitions

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
yarn.lock Updated @hawk.so/types dependency from 0.1.36 to 0.1.38 to support breadcrumb types
packages/javascript/package.json Updated @hawk.so/types dependency and added lint script
packages/javascript/src/types/hawk-initial-settings.ts Added configuration options for breadcrumb management (maxBreadcrumbs, trackFetch, trackNavigation, trackClicks, beforeBreadcrumb hook)
packages/javascript/src/types/event.ts Added breadcrumbs field to HawkJavaScriptEvent type
packages/javascript/src/catcher.ts Integrated BreadcrumbManager singleton, added public API methods, and included breadcrumbs in error events
packages/javascript/src/addons/breadcrumbs.ts New module implementing singleton BreadcrumbManager with automatic tracking and manual API
packages/javascript/example/sample-errors.js Added comprehensive examples demonstrating all breadcrumb types and API usage
packages/javascript/example/index.html Added UI controls for testing breadcrumb functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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 12 out of 13 changed files in this pull request and generated 13 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants