Fork me on GitHub
#shadow-cljs
<
2018-11-06
>
thheller06:11:37

@loganpowell I don't really understand what you are trying to do? You are trying to include the compiled library in CLJS?

Logan Powell12:11:11

So, I might be setting myself up for failure, but I have a function that can cause js vm heap overflow that I'm hoping to offload to a worker using this library (which uses promises to communicate with webworkers/child_processes): https://github.com/josdejong/workerpool with this library (which enables translation of promises to core.async compatible things): https://github.com/jamesmacaulay/cljs-promises I'm trying to test out some code I want to use inside the "pool"... maybe I should use the web workers config? https://shadow-cljs.github.io/docs/UsersGuide.html#_web_workers

thheller14:11:35

are you running in node? or the browser?

thheller14:11:23

ewww .. do not use that library. it is only going to work for extremely basic examples since it relies on turning the function into a string

Logan Powell14:11:21

is there a better library you are aware of? I'm trying to run in browser and node, but developing in node

thheller09:11:06

@loganpowell and no you can use promises directly without any kind of tricks or pre-compile/re-include tricks

thheller09:11:37

FWIW I improved the error message for the problem you are running into to make it clearer what is happening

๐Ÿ™ 4
thheller09:11:20

I just added a quickstart section to the main readme. Feedback very welcome. Not sure if I should make this a separate document or part of the user guide or blog post. https://github.com/thheller/shadow-cljs#quick-start

mj_langford10:11:57

@thheller thats wonderful. I'd love to see that prominently linked off the project page

Hannu Hartikainen12:11:45

I was trying to reproduce a possible bug in reitit and the maintainer (@ikitommi) noted that thereโ€™s something weird about how backtick resolution works with shadow-cljs. This code https://github.com/dancek/reitit-frontend-spec-coercion-repro runs

(js/console.log `int?)
and the value is starter.browser/int? instead of the expected cljs.core/int?. Did I do something wrong or is that a bug?

thheller14:11:09

hmm strange. looking into it

flowthing13:11:00

I tried adding an entry for cljsjs.js-joda in shadow-cljsjs, but the build fails with an NPE like this https://gist.github.com/eerohele/3983e27b07eb2e029936e2af2f937e62 Am I doing something wrong or should I file an issue?

flowthing13:11:15

Actually, scratch that. I was barking up the wrong tree. It's actually this issue: https://github.com/thheller/shadow-cljs/issues/401

thheller14:11:15

@hannu.hartikainen just pushed 2.6.24 which fixes the incorrect int? resolve. thanks for the report.

๐Ÿ‘ 4
Hannu Hartikainen14:11:33

great! now back to my original repro ๐Ÿ™‚

Logan Powell17:11:21

What's the difference between an explicitly configured :npm-module (with :entries) and the :node-library target?

thheller18:11:41

@loganpowell the way it is packaged. :node-library has one thing JS can require while :npm-module has one per NS

Logan Powell18:11:11

should I still :output-dir to node_modules when using :node-library if I'm looking for smooth JS ecosystem interop?

thheller18:11:09

I still don't know what you are trying to do exactly

thheller18:11:21

especially what "smooth JS ecosystem interop" means to you

thheller18:11:37

does that mean you publishing a library to npm that JS can use?

thheller18:11:29

if you are building something that you are going to consume from CLJS then do not use either

Logan Powell18:11:08

"publishing a library to npm that JS can use": exactly

thheller18:11:41

then I recommend :node-library

thheller18:11:07

unless you really need more complex stuff that :node-library can't do (eg. multiple require entries)

thheller21:11:30

just pushed https://github.com/thheller/shadow-cljs/releases/tag/2.7.0 for those eager to play with the new CLJS release

๐ŸŽ‰ 20
thheller21:11:56

don't expect too much from the promised performance gains ... most of them were already in shadow-cljs for a while

thheller21:11:10

symbols with . in them are now checked more strictly and may produce warnings when used improperly

thheller21:11:49

previous versions accepted ANY symbol with a . without validation (eg. i.dont.exist) would not warn at compile time and only fail at runtime

richiardiandrea21:11:43

cool thanks Thomas, I will bump and report ๐Ÿ˜„