This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-28
Channels
- # aleph (2)
- # beginners (25)
- # boot (12)
- # cider (73)
- # cljs-dev (3)
- # clojure (37)
- # clojure-dev (93)
- # clojure-germany (1)
- # clojure-italy (24)
- # clojure-nl (21)
- # clojure-russia (26)
- # clojure-spec (37)
- # clojure-uk (80)
- # clojure-za (1)
- # clojurescript (47)
- # cursive (4)
- # data-science (17)
- # datomic (69)
- # emacs (19)
- # events (7)
- # fulcro (41)
- # hoplon (14)
- # leiningen (2)
- # nrepl (4)
- # off-topic (253)
- # om (11)
- # portkey (2)
- # re-frame (11)
- # reagent (24)
- # ring-swagger (1)
- # rum (5)
- # schema (1)
- # shadow-cljs (106)
- # specter (2)
- # tools-deps (91)
there’s a known issue where docker containers do not expose the amount of RAM actually available, so the jvm will consume more than allocated for the container
you should be able to manually configure the amount of memory the JVM will consume, either through shadow-cljs or through defaults of whatever java runtime you’re using in the container itself
is there a way to rename the default export when requiring a JS library? Looking at the "ES6 Import to CLJS Require" table in the User's Guide, but don't see that, so I was wondering whether I'm missing something obvious?
@thheller I’m getting an error when i open the output from build-report. It was a complaint about an odd number of map elements in a map, because node_modules/date-fns
has 201 elements. I suspect this is because the date-fns library contains several sub-folders—one for each function—so that the user can cherry-pick the individual fns she wants to use.
@lilactown @richiardiandrea thanks, it was actually working for me as well. I was just tricking myself by running a separate watcher for the test target and looking there for test results. But the results where coming from my node-libarary target… Now I am running both targets from the same watcher and it works. Almost. I do get en error on startup:
Error: ENOENT: no such file or directory, open '/Users/pez/Projects/calva-fmt/.shadow-cljs/builds/test/dev/out/cljs-runtime/goog.debug.error.js'
Is there a way I can avoid that? Am I still going about it the wrong way?(From there on whenever I save the file tests are run. But I would prefer they ran at startup too, w/o throwing errors in my face.)
@lwhorton SIGKILL
looks indeed like the process is getting killed by maybe the OOM killer. you can configure the max memory by setting :jvm-opts ["-Xmx2G"]
in shadow-cljs.edn
.
yea, i finally figured it out. it was the 4gb-per-instance limit in circle, so if I set JVM_TOOL_OPTIONS -Xmx3g everything goes through fine
@samuel.wagen you can choose whatever name you want for :default
(eg. :default whatever
). the name is completely up to you.
@pez there was a race condition in :node-test
. fixed in master
, will make a release later
@levitanong what is the error exactly?
For some reason it works now. It might be a lein clean
thing. Sorry for the noise!
I'm especially interested in those issues though. lein clean
should NEVER be required ever. If it is its a bug I want to fix. please let me know if you run into this again
Will do!
Reproduced it!
#error {:message "The map literal starting with \"node_modules/date-fn...\" contains 201 form(s). Map literals must contain an even number of forms.", :data {:type :reader-exception, :ex-kind :reader-error}}
happens when i run generate
from the repl
oh boy i shouldn’t have opened it in emacs
cljs side
well. more on javascript side
I'm looking to run some node scripts to manipulate some files. Is Nashorn the best way to go about this?
It's kind of during the clj-run step.
I want to run Critical to inlines critical css and Subfont to do font subsetting.
Ok I had a feeling that was the case which is why I asked before I dove in.
Ahh yea I was about to ask whats the best way to trigger node scripts. But that seems way more simpler. Just jump into the shell.
shadow-cljs uses babel internally for some of the node_modules rewriting and does so by launching a node process
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/build/babel.clj#L36
but in case of the babel stuff starting a new node process for each transformed file was way too slow
I want to run Critical, Subfont during the production step. Lighthouse during an Audit step and Puppeteer for a testing step.
My preference would be to stay out of vanilla JS as much as possible. Just thinking through the best way to do it 🙂
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/npm/transform.cljs
Cheers!
That's what I want to do so that should help me get there
no idea how the ...
gets there. its supposed to be using the safeguard for that so emacs settings *print-length*
doesn't mess it up
i used vim for this
i generally use vim for huge files haha
ah right
hurrah!
thanks @thheller
Yeah, that fixes it!
I have a project that builds in shadow 2.4.8 but fails in >= 2.4.9 with
> The required JS dependency "entities/lib/decode_codepoint.js" is not available, it was required by "node_modules/htmlparser2/lib/Tokenizer.js".
It looks as though the way package require handling changed in 2.4.9: https://github.com/thheller/shadow-cljs/compare/3a43f6d...a2c870c . But require in htmlparser2
looks okay to me... https://github.com/fb55/htmlparser2/blob/master/lib/Tokenizer.js#L3 (unlike the issue with clipboard
I ran into last week, the required file does actually exist this time!)
@henrygarner fixed in 2.4.11
. thanks for the report.
Amazing! Thanks @thheller 👌
@smnplk ideally you want to avoid running code "globally" and instead move it into a :dev/after-load
callback
since an exception while loading code prevents other code from being loaded properly
and goog.History
will reset the dom when it is constructed when the page finished loading
https://google.github.io/closure-library/api/goog.history.Html5History.html is the successor
for grins i tried running shadow-cljs on an amazon c5d-xlarge instance. i am surprised that it only runs twice as fast as my 2012 era macbook. i guess single threaded performance just isn’t improving much now
on my desktop I get cljs.core compile times of about 2.5sec which is substantially faster than my macbook with about 6sec
big ns like cljs.core are the bottleneck since everything else has to wait for them to compile
i meant more like realizing that although a dependency i include changed, i really don’t need to recompile because the function i’m using didn’t change
i have tons of functions in one file that everything depends on, but in reality each file only depends on a small part. i could break it up (and eventually I will)
but I mean clean non-cached performance which I think can be at least 50% faster still
no just by tweaking things. clojure compiles way faster but has to do a lot more work since the JVM is much less dynamic than JS
so there are still probably some bottlenecks in the code somewhere that just need to be found and fixed
its not a fair comparison since most of the clojure compiler stuff is written directly in java
I was wondering if crowdfunding a slack pro for clojurians would be worth it?
op, just looked at pricing lol
Yeah, I thought I saw reasonable pricing a while back, but for that price it's not even worth the history
And I clicked the wrong forum, my bad