Fork me on GitHub

by the way it occurs to me i’m being a dolt. with cljs-devtools if i just log directly to the console i get what I want times 10. i just need to elide that library during production and it is normal logging code.


:preloads is the way to go


actually the best combo turned out to be a dumb templating function that takes % and $, where it just passes $ straight through so devtools can log it


Anybody aware of an example of wrapping the CLJS compiler output as an AMD module? I see lots of stuff about consuming AMD, but not the other way around. And I know it sounds goofy, because you wouldn't normally do this, but the use-case is to allow for some level of CLJS eval in a Jupyter notebook extensions. Jupyter extensions are AMD modules.


oh AMD ... it generates UMD. not sure if that works


would be easy to turn it into AMD though


@dnolen @anmonteiro Thanks for amazing CLJS infer-externs work. I was stunned at how well it worked. For reasons I can’t quite articulate precisely, I was a bit scared and skeptical of it, but I was so incredibly and utterly delighted when it magically created right externs. Made using npm lib nearly effortless! Oh, it was to use this Twitter JS library ( that I included directly into the HTML file, not through npm. In my first attempt, it worked in dev with no optimization’s, but the Google Closure Compiler mangled it, resulting in run-time error that took 20m to diagnose. I tried “infer-externs” and it worked. Soooo much easier than manually generating the externs prototype! (Which for me, it takes quite a bit of trial and error... I’m still not great at gleaning how to unpack all the various JavaScript module conventions, even TypeScript and ES6.) THANK YOU and keep up all the great work!


(PS: I was inspired to try “infer-externs” after watching @anmonteiro ClojureConj 2017 talk. I think I was skeptical and afraid because most of my experiences using foreign libraries w/o CLJSJS resulted in hours of trial and error, reading lots of “one shot learning” web pages, trying to figure out which was relevant, etc... That “infer-externs” just worked was gobsmackingly amazingly awesome. :)


yes, it needs a few tweaks but it covers most cases already


@genekim glad you found it useful