trackjs-package icon indicating copy to clipboard operation
trackjs-package copied to clipboard

[FEATURE REQUEST] rust-wasm client

Open nullrocket opened this issue 6 years ago • 4 comments

My company is migrating our browser client to rust-wasm, and I'm wondering if there are any thoughts towards TrackJs supporting that environment?

Currently we are planning on just wrapping the TrackJs client to expose the API in rust, but a deeper integration would be nice.

Looks like sentry is doing it for native rust at least https://blog.sentry.io/2018/10/22/getting-started-with-rust-error-tracking

nullrocket avatar Aug 21 '19 12:08 nullrocket

Hi @nullrocket. Thanks for the suggestion! Wrapping the client is a good first step, as it should give you visitor, network, and console telemetry, as well as exposing global errors.

What sort of things would you want from a native implementation?

toddhgardner avatar Aug 21 '19 12:08 toddhgardner

@toddhgardner wrapping the client gets quite a way there, and after looking at https://github.com/rustwasm/console_error_panic_hook and how it dumps to the console on panic, I realized stacktraces will get sent to trackjs via the javascript client when they occur.

It looks like we don't really need an official TrackJs rust-wasm client, but having it available would still be useful, as in we don't have to keep it up to date ourselves :)

nullrocket avatar Aug 21 '19 13:08 nullrocket

@nullrocket absolutely, I understand. Can you share the wrapper you built with us, maybe we can use it as a starting point?

toddhgardner avatar Aug 22 '19 15:08 toddhgardner

Sure can, it will take us a bit to extract it, if you don't mind leaving this issue open for a while as a placeholder, I'll circle back when we have something ready.

nullrocket avatar Aug 22 '19 16:08 nullrocket