Fork me on GitHub
#cljs-dev
<
2019-04-03
>
orestis16:04:52

Had an interesting back-and-forth with Dan Abramov of the React team about function names, munging and stack traces: https://github.com/facebook/react/issues/15259

orestis16:04:53

I wonder if something could be done about this in the ClojureScript compiler? Certainly better looking stack traces would lift all boats but it seems like impossible to do if the function name has to be a valid JS identifier.

lilactown16:04:25

I kind of wonder if this could relate to source maps

lilactown16:04:59

I don't really know a lot about how source maps work, but AFAICT stack traces in Chrome sometimes use them?

lilactown16:04:30

but I think they still have the JS-ified identifier. hrm

dnolen18:04:37

@orestis I don't really follow

dnolen18:04:40

we have a source maps

dnolen18:04:06

which maps munged names back to their original names in stacktraces

dnolen18:04:30

but this might be specific to React DevTools

dnolen18:04:44

and no I don't see us doing anything for that project specifically

orestis18:04:38

Thanks @dnolen

orestis18:04:56

I will check with them what the support for source maps is. Just wanted to clarify since I’m a little bit clueless about compilation and munging etc.

darwin18:04:56

@orestis FYI, dirac tries to give you better names in devtools and stacktraces: https://box.binaryage.com/dirac-non-trivial-beautified-stack-trace.png it uses code from cljs-devtools https://github.com/binaryage/cljs-devtools/blob/master/src/lib/devtools/munging.cljs

orestis19:04:24

I will need to look into source maps more closely, thanks.