Fork me on GitHub
#clojurescript
<
2018-02-15
>
justinlee00:02:12

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.

darwin00:02:31

:preloads is the way to go

justinlee02:02:57

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

sparkofreason22:02:14

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.

thheller22:02:42

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

thheller22:02:02

would be easy to turn it into AMD though

genekim23:02:17

@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 (https://dev.twitter.com/web/javascript) 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!

genekim23:02:22

(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. :)

dnolen23:02:06

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

dnolen23:02:14

@genekim glad you found it useful