This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-06
Channels
- # announcements (2)
- # beginners (97)
- # boot (3)
- # cider (23)
- # clara (9)
- # cljs-dev (40)
- # cljsrn (6)
- # clojure (107)
- # clojure-finland (2)
- # clojure-india (3)
- # clojure-italy (15)
- # clojure-nl (2)
- # clojure-spec (107)
- # clojure-uk (91)
- # clojurescript (28)
- # cursive (10)
- # data-science (4)
- # datomic (26)
- # duct (1)
- # emacs (6)
- # events (9)
- # figwheel-main (4)
- # fulcro (4)
- # graphql (2)
- # jobs (3)
- # jobs-discuss (12)
- # juxt (7)
- # kaocha (6)
- # off-topic (8)
- # onyx (2)
- # parinfer (13)
- # pedestal (32)
- # portkey (1)
- # re-frame (58)
- # reagent (17)
- # reitit (21)
- # ring-swagger (3)
- # shadow-cljs (35)
- # spacemacs (1)
- # tools-deps (33)
- # yada (13)
@loganpowell I don't really understand what you are trying to do? You are trying to include the compiled library in CLJS?
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
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
haha,
is there a better library you are aware of? I'm trying to run in browser and node, but developing in node
Maybe parrallel.js? https://github.com/parallel-js/parallel.js
@loganpowell and no you can use promises directly without any kind of tricks or pre-compile/re-include tricks
FWIW I improved the error message for the problem you are running into to make it clearer what is happening
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
@thheller thats wonderful. I'd love to see that prominently linked off the project page
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?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?
Actually, scratch that. I was barking up the wrong tree. It's actually this issue: https://github.com/thheller/shadow-cljs/issues/401
@hannu.hartikainen just pushed 2.6.24
which fixes the incorrect int?
resolve. thanks for the report.
great! now back to my original repro ๐
What's the difference between an explicitly configured :npm-module
(with :entries
) and the :node-library
target?
@loganpowell the way it is packaged. :node-library
has one thing JS can require
while :npm-module
has one per NS
@thheller thank you sir
should I still :output-dir
to node_modules
when using :node-library
if I'm looking for smooth JS ecosystem interop?
if you are building something that you are going to consume from CLJS then do not use either
"publishing a library to npm that JS can use": exactly
unless you really need more complex stuff that :node-library
can't do (eg. multiple require
entries)
gotcha
just pushed https://github.com/thheller/shadow-cljs/releases/tag/2.7.0 for those eager to play with the new CLJS release
don't expect too much from the promised performance gains ... most of them were already in shadow-cljs for a while
symbols with .
in them are now checked more strictly and may produce warnings when used improperly
previous versions accepted ANY symbol with a .
without validation (eg. i.dont.exist
) would not warn at compile time and only fail at runtime
cool thanks Thomas, I will bump and report ๐