bugsnag-js
bugsnag-js copied to clipboard
Add support for more types of automatic breadcrumbs
Over on #162 @jacobmarshall mentioned some cases where our old lastEvent tracking would provide information we don't currently collect automatically with breadcrumbs. I wanted to open an issue to collect feedback on other types of breadcrumbs that might be worth adding, to make sure the new breadcrumb feature covers all the cases that last event did. Please suggest more. Here are some I pulled from Jacob's comments:
- [ ]
messageevent from an iframe - [x] XHR/fetch tracking
- onreadystatechange
- load/error
- [ ] Keyboard events
- we'll want to do something to prevent logging user input, e.g. roll these up with a count and only show the last keypress value
message events from Web Workers may also be pretty cool to catch with breadcrumbs. Simply because for us, as an encrypted product, we use Web Workers everywhere, and knowing whether a message came through correctly would be a huge bonus. However I see definitely understand if this was pushed away from being part of the core library, as it's probably not as critical for most apps.
Regardless, I see a huge benefit in the originally listed events alone. I am happy to put together a PR, if you'd like? Or if you'd just like to collect feedback for now, I'll sit on this for the time being.
As a side note, I'm not sure how much pressure there is to keep the library tiny anymore. I know when Conrad was working with you guys there was definitely an effort to keep the library as TINY as possible, which is great, but the breadcrumb code has bulked it up a bit. I wonder whether or not it's worth making some alternatives for people who would like to make the most of the amazing breadcrumb functionality, and for people who aren't interested? Such as providing bundles which provide bugsnag-js core & detailed breadcrumbs, and maybe even commonjs modules for people who wish to decide which type of breadcrumbs they're only interested in. But maybe this all ends up making it harder for people to jump straight into having the full Bugsnag experience? (Thinking aloud again)
Anyway, holler if you'd like to see a PR 💃
We'd welcome a PR for web workers. We currently have the process type set aside for these. We are already using it in the mobile/native libraries, but haven't started anything for JS. You'd know better what kind of things you'd like to track.
The size goal is to keep the library under 4.5 KB minified
Sweet, cheers, web workers it is then 🏹
Need to decide whether we want to add this to the current version vs. the next major.