Fork me on GitHub
#cljs-dev
<
2016-01-21
>
meow02:01:47

@mfikes: only just now got admin access to this machine so I am behind schedule on the testing I said I would do 😞

mfikes02:01:59

No problem slacker :)

meow02:01:31

that's me

snoe20:01:35

Hi, is it expected that most cljsjs libs don't seem to work in nodejs :optimizations :simple because the js have clauses like if (typeof module === 'object' && module.exports) so they don't write their exports to global?

dnolen21:01:56

@snoe questions about issues with cljsjs libs and Node.js are not really the right place for this channel, better for #C03S1L9DN

snoe22:01:42

@dnolen: sorry, I asked here because I'm looking at jira issues like http://dev.clojure.org/jira/browse/CLJS-1314 and commits like https://github.com/clojure/clojurescript/commit/87f39511a54d7b91ae86f581fda90f280f985816 and trying to figure out if they apply to :simple compiles. Asked more appropriately for this channel perhaps: before I dig into the internals of cljs to figure out what I'm doing wrong, does closure or the cljs compiler do any rewriting of AMD modules?

dnolen22:01:30

@snoe there is some support for transforming UMD modules, but it’s not perfect because UMD is not a real thing

dnolen22:01:34

just an ad-hoc pattern

jaen22:01:58

@snoe: if you want to use CommonJS/AMD/UMD the best bet is to use something like webpack or browserify to compile them out and use the resulting file with :foreign-libs

dnolen22:01:39

@jaen for real CommonJS/AMD the facilities in ClojureScript should work OK

dnolen22:01:56

it’s really Node.js style CommonJS where you’ll want to look at Webpack or Browserify

dnolen22:01:39

I don’t know how well those tools deals with UMD - perhaps they just try cover more cases

jaen22:01:14

Well, they work well, even with CommonJS, for standalone files. The problem is that last time I've seen that code it used only "." for module root, so only relative imports will work - you won't be able to require "react" or such.

jaen22:01:34

But if you control all the code you want to use that way, then sure, they work well enough.

snoe22:01:57

thanks guys