Fork me on GitHub
#clojurescript
<
2018-07-29
>
lilactown02:07:37

does anyone use self-hosted CLJS for running tests? especially in CI?

lilactown02:07:29

right now compiling code + running tests is a huge bottleneck in CI

Garrett Hopper02:07:31

Is there any way to use node modules that use node's builtin requires similar to the way browserify does it? I'm trying to use a library (https://github.com/Level/levelup), but even after installing https://www.npmjs.com/package/util, it's still saying Error: module not found: "util" from file. I assume this is because it's not actually required by the package, so the closure compiler doesn't find it.

Garrett Hopper02:07:05

I suppose I could webpack/browserify the modules I need to use and use a :foreign-libs entry? Any other ideas?

lilactown02:07:24

@ghopper are you trying to use this in a browser? or nodejs?

Garrett Hopper02:07:35

Oh, sorry. I'm trying to use them in the browser.

Garrett Hopper02:07:37

Yeah, I assumed the shim would be enough. I suppose I'll start down the foreign lib path.

Garrett Hopper03:07:01

I've narrowed it down to readable-stream not being able to use the util package from node_modules.

thheller08:07:17

@ghopper did you ever try shadow-cljs? it takes care of all of that. webpack/browserify use these "replacements" for the built-in node packages. https://github.com/webpack/node-libs-browser. shadow-cljs does too so they work just fine. CLJS itself does not so they don't work.

Garrett Hopper13:07:21

Oh, thanks, @thheller, I forgot about shadow-cljs.

mfikes16:07:32

@ghopper I wonder if this is a fundamentally new issue or already covered in JIRA. FWIW, I tried Closure Compiler v20180716 and it also fails in the same way.

mfikes16:07:27

Oh, it is that replacement stuff? Interesting.

Garrett Hopper18:07:03

Thanks for creating that, @mfikes!