tolitius / mount

managing Clojure and ClojureScript app state since (reset)
Eclipse Public License 1.0
1.22k stars 88 forks source link

Full source file names visible in compiled js file #62

Open tomconnors opened 7 years ago

tomconnors commented 7 years ago

Hi Anatoly, After compiling some cljs using :advanced mode I happened to look in the minified file and saw that where I call defstate the output includes the full path of the file. For example, I end up with code like this:

ff([bv, S, ow, Gw, Zz, GC, mF, Xg, eJ, pK],
   [IF, KG, "/Users/tom/dev/kc/src/admin/client/components/app_state.cljs", 20, 1, 103, 103, ue, null , k(U6) ? U6.Kb : null])

I'm fairly certain mount is the culprit because I only see this occurring for files with a defstate. Aside from the fact that I'd like to conceal from my users that I develop on a mac, it seems wasteful to include all that in the minified script. I haven't been able to hunt down the offending lines, so could you point me in the right direction?

tolitius commented 7 years ago

Yes, I see the same thing with a sample mount app that comes with mount sources:

[mount]$ boot cljs-example
Started Jetty on http://localhost:3000
Compiling ClojureScript...
• mount.js
Pe([$m,hn,Cn,Kn,Mo,wp,pq,Dg,tr,Qr],[nn,Wm,"/Users/.../.boot/cache/tmp/Users/.../mount/8k0/-l2i00x/app/websockets.cljs",19,1,21,21,ee,null,r(rC)?rC.rd:null])

I don't have a good idea of why it happens, but here are some random thoughts that I hope could help:

Apps that are ready for deployment (where other people could look at the code) are usually built on dedicated servers (dev/qa/staging..), which would conceal from your users that you develop on a mac. But I agree, it's not everywhere, and it's simply not great to leave the full paths there.