Skip to content

Draft: Javascript package decomposition#153

Draft
Reversean wants to merge 5 commits intomasterfrom
refactor/javascript-package-decomposition
Draft

Draft: Javascript package decomposition#153
Reversean wants to merge 5 commits intomasterfrom
refactor/javascript-package-decomposition

Conversation

@Reversean
Copy link
Member

Closes #151

@hawk.so/javascript decomposed into 2 packages:

  1. @hawk.so/core
  • Location: packages/core/
  • Exports:
    • EventRejectedError - Error class for rejected events
    • Sanitizer - Data sanitization class (environment-agnostic)
    • isErrorProcessed, markErrorAsProcessed - Error tracking utilities
    • validateUser, validateContext - Validation utilities
    • log - Logger utility (environment-agnostic)
  1. @hawk.so/browser
  • Location: packages/browser/
  • Contains: All browser-specific code:
    • catcher.ts - Main Catcher class
    • modules/socket.ts - WebSocket transport
    • modules/stackParser.ts - Stack trace parsing
    • modules/fetchTimer.ts - Fetch with timeout
    • addons/breadcrumbs.ts - Breadcrumb tracking
    • addons/consoleCatcher.ts - Console interception
    • integrations/vue.ts - Vue.js integration
    • Dependencies: Uses @hawk.so/core for shared utilities

Also updated workspaces in root package.json.

Also @hawk.so/sveltekit now depends on @hawk.so/browser.

@Reversean Reversean self-assigned this Feb 2, 2026
@Reversean Reversean force-pushed the chore/yarn-4.12.0 branch 3 times, most recently from ce72cfd to 5220d8c Compare February 2, 2026 23:10
@Reversean Reversean force-pushed the refactor/javascript-package-decomposition branch from b1e27b1 to e943476 Compare February 2, 2026 23:18
@Reversean Reversean changed the title Refactor/javascript package decomposition Javascript package decomposition Feb 2, 2026
@Reversean Reversean force-pushed the refactor/javascript-package-decomposition branch from e943476 to 2b74325 Compare February 2, 2026 23:19
@Reversean Reversean changed the title Javascript package decomposition Draft: Javascript package decomposition Feb 2, 2026
@Reversean Reversean marked this pull request as draft February 2, 2026 23:22
Copy link
Member

Choose a reason for hiding this comment

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

Unexpected change.

Copy link
Member

Choose a reason for hiding this comment

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

I think this file is bloated and a significant part of it can be reusable as a core module.

  • we can create an abstract class definining base structure of any catcher. type (protected), context, user, getIntegrationId, getRelease, getType, getRawData, etc can be moved there.
  • setUser, setContext - reusable
  • maybe some other utilities. StackParser, etc

Base automatically changed from chore/yarn-4.12.0 to master February 4, 2026 17:58
@Reversean Reversean force-pushed the refactor/javascript-package-decomposition branch from 2b74325 to e8010d5 Compare February 4, 2026 20:17
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