3 ms·
There are many ways the browser can fail. I'm sure their SDK is large because of all the random hacks they need to use to capture everything from every browser.
by jbob2000 6y ago
There are many ways the browser can fail. I'm sure their SDK is large because of all the random hacks they need to use to capture everything from every browser. Couple this with the need to create first-class API, which adds some code bloat, and I can see how this ends up at 17K compressed.
- seanwilson 6y agoWhy can't they do the shim approach while the library loads though? Google Analytics for example lets you push everything you want to record into a plain global array called "ga", and when the library loads, everything in the array in processed by the library. This lets you start capturing events without waiting for the library to load.
- the_gipsy 6y agoit's a bit different though, you can't "push" errors somewhere, I guess so many error handlers and interceptors are set that it's not worth to split.
- seanwilson 6y ago> you can't "push" errors somewhere Why? Can't you push the Error object or stack trace into an array to await processing?
- jbob2000 6y agoWhat if the thing that is pushing the error object has an error?
- Izkata 6y agoI think it's more to get as much context as possible. One of our older products just sets window.onerror [0] to a small function that sends the information back to the server, which then forwards it to Sentry. The information in Sentry is nowhere near as detailed as if it came from Sentry's library, but it's been enough for us and doesn't seem to miss anything. [0] https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror https://developer.mozilla.org/en-US/docs/Web/API/GlobalEvent...