cljsrn

https://github.com/drapanjanas/re-natal | https://github.com/drapanjanas/re-natal/wiki/FAQ | https://github.com/condense/mercury-app/wiki | https://github.com/seantempesta/expo-cljs-template/ https://www.npmjs.com/package/create-expo-cljs-app
frankitox 2021-01-29T00:10:28.027100Z

Hi! Anyone using Sentry? I'm trying to set it up so I can get somewhat readable stacktraces. I'm using shadow-cljs, with compiler options :source-map, :pseudo-names and :pretty-print (based on what I read https://stackoverflow.com/questions/60543802/get-sourcemapped-source-place-in-browser). So, stacktraces look something like this:

new $cljs$core$PersistentArrayMap$$(null, 1, [$cljs$cst$keyword$style$$, new $cljs$core$PersistentArrayMap$$(null, 4, [$cljs$cst$keyword$f {snip}
  $cljs$cst$keyword$text$$, "Login with Facebook", $cljs$cst$keyword$enabled$$, $cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($state$j {snip}
    return $re_frame$router$dispatch$$(new $cljs$core$PersistentVector$$(null, 1, 5, $cljs$core$PersistentVector$EMPTY_NODE$$, [$cljs$cst$ke {snip}
  }], null)], null), new $cljs$core$PersistentVector$$(null, 2, 5, $cljs$core$PersistentVector$EMPTY_NODE$$, [$myapp$components$login_but {snip}
  function() {
    throw Error("An error!");
Has anyone managed to do something better?

1👀
thheller 2021-01-29T09:47:28.028700Z

The problem is that react-native metro post processes the files after shadow-cljs is done with it and has generated the source maps. metro however doesn't take those source maps into account and generates its own rather useless ones. at least thats how it used to be the last time I looked at this. not sure this has changed.

1👌
thheller 2021-01-29T09:48:19.028900Z

yes, still open https://github.com/facebook/metro/issues/104

dotemacs 2021-01-29T09:55:37.033900Z

Hi, I’m using Sentry in an app in production. I’m not seeing those issues at all. > How did I install it? Pretty vanilla. Added the dependency in package.json, then in cljs, required it like ["@sentry/react-native" :as sentry] and then initialised it with (sentry/init (clj->js my-config...)) where my-config is just a map of:

{:dsn "some-url-sentry-gives-you"
:debug true-or-false-depends-on-your-needs}
From that point on, you can just use it as: (sentry/captureException (str params)). So nothing here that should trip you up. Sentry works as expected. For :compiler-options in shadow-cljs.edn I have :optimizations :simple not those that you’re using.

thheller 2021-01-29T09:56:41.034300Z

@dotemacs but do you get stacktraces for CLJS or just the compiled simple JS code?

dotemacs 2021-01-29T09:56:56.034500Z

Checking now…

dotemacs 2021-01-29T09:58:32.035200Z

So we don’t have that many stack traces, most of them are as expected, readable and not in the format as posted above by @franquito

thheller 2021-01-29T09:59:48.036100Z

the above is using pseudo-named :advanced output. :simple will be much more readable but also quite a bit larger, although thats not super relevant for RN

3👍
frankitox 2021-01-29T16:04:59.039200Z

ahh, totally forgot about simple @dotemacs, thanks. btw, you see clojurescript code in your stack traces? this is what I'm getting with :simple

[myapp.components.header_title,"Login"],null)],null),new cljs.core.PersistentVector(null,5,5,cljs.core.PersistentVector.EMPTY_NODE,[re {snip}
null)],null),new cljs.core.PersistentVector(null,2,5,cljs.core.PersistentVector.EMPTY_NODE,[myapp.components.login_button,new cljs.core.P {snip}
1,5,cljs.core.PersistentVector.EMPTY_NODE,[cljs$cst$keyword$facebook_DASH_login_SLASH_start],null))}],null)],null),new cljs.core.PersistentV {snip}
cljs$cst$keyword$on_DASH_press,function(){throw Error("A :simple error");}],null)],null),new cljs.core.PersistentVector(null,2,5,<http://cljs.core.Pe|cljs.core.Pe> {snip}
T

dotemacs 2021-01-29T16:15:12.040200Z

Honestly @franquito I’m not seeing that, maybe because all our errors so far have been more on the native (as in ObjC or Swift) side

1👍