Fork me on GitHub
#shadow-cljs
<
2018-06-05
>
kenny04:06:18

I am getting an exit status 0 for a test build with :autorun set to true that has failing tests. This does not seem like the expected exit status.

claudiu06:06:54

Hi. Looking at the manifest.edn, I see both cljsjs/react.js & node_modules/react is this expected ?

thheller06:06:00

@claudiu yes. in shadow-cljs cljsjs.react is just a "bridge" to the npm react. see https://github.com/thheller/shadow-cljsjs/blob/master/src/main/cljsjs/react.cljs

thheller06:06:36

only required because some libs still use cljsjs.react instead of react directly. it does not include the actual cljsjs code ever

thheller06:06:18

@kenny :autorun is mostly meant for watch and therefore cannot emit an exit code. you are probably better off running tests manually instead

kenny14:06:34

I suggest adding a note to the docs about this 🙂

thheller06:06:48

@wilkerlucio possible yes. when running karma in watch mode however it will destroy the REPL on each reload

claudiu06:06:07

ahh cool 🙂 thank you. Trying to see if I can get the bundle size down a bit, after adding semantic-ui to my project 🙂

wilkerlucio18:06:19

@thheller I opened an issue about the Tether library: https://github.com/thheller/shadow-cljs/issues/294 do you think you can help me with that? that's my last blocker to make a first shadow try release here

thheller18:06:31

can check in a few minutes, just finishing up another thing

wilkerlucio18:06:52

thank you 🙂

thheller18:06:08

> We at HubSpot have been thrilled by Tether's success! However, the demands of maintaining such a complex project have outstripped our willingness and ability to do so effectively, as a quick glance at the issue tracker will tell you.

thheller18:06:15

that does not inspire confidence in the library 😉

wilkerlucio18:06:15

yeah, just more of the legacy stuff I have to keep around for a while

wilkerlucio18:06:44

it's not the worst, I can just copy their dist file, fix and use it directly (removing the second definition fixes it)

thheller18:06:46

@wilkerlucio unfortunately there is no way to turn that error into a warning or off

wilkerlucio18:06:30

no problem, thanks for looking it, I'll just use my own copy, this should not need upgrade as far as I see

p-himik19:06:57

Hi, I'm trying to use https://github.com/ccampbell/mousetrap and all is fine, I was even able to use plugins by writing (:require ["mousetrap/plugins/global-bind/mousetrap-global-bind"]). I wonder - is it the correct usage in a scenario where a library developer just wants you to include a <script> tag on your page? It appears to be working, with and without .js extension.

thheller19:06:02

@p-himik not sure I understand the <script> question? the .js is optional and doesn't affect the output whether you use it or not

p-himik19:06:26

@thheller The documentation at https://github.com/ccampbell/mousetrap/tree/master/plugins specifies that if I'm to use a plugin, I have to write something like <script src="%path-to-plugin.js%"></script> in my HTML. And I guess the above :require does just the same, with no potential problems?

thheller19:06:09

hmm the plugins rely on the Mousetrap global and don't properly express their dependency on mousetrap itself but if it works it works

thheller19:06:20

just make sure you always require mousetrap before any of the plugins

wilkerlucio20:06:34

@thheller just curious, the deps from shadow-cljsjs, they are looked up at runtime, or they go bundled with shadow?

thheller20:06:36

just pushed 2.3.35 with some perf improvements. please let me know if things actually got faster and not slower 😉

thheller20:06:21

@wilkerlucio 2.3.35 includes your updates

wilkerlucio20:06:43

cool, thanks 🙂

richiardiandrea21:06:41

hello folks, I am build some code, and I get a bunch of warnings:

[:init-store-fn] Compiling ...
Failed reading cache for cljs.core: com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Array (start marker at [Source: java.io.FileInputStream@4359431f; line: 1, column: 1897496])
 at [Source: java.io.FileInputStream@4359431f; line: 1, column: 1900558]
Failed reading cache for cljs.spec.gen.alpha: com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Array (start marker at [Source: java.io.FileInputStream@1702c0a8; line: 1, column: 135365])
 at [Source: java.io.FileInputStream@1702c0a8; line: 1, column: 176495]
Failed reading cache for cljs.core.async.impl.ioc-helpers: com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Array (start marker at [Source: java.io.FileInputStream@63b0ad37; line: 1, column: 58113])
 at [Source: java.io.FileInputStream@63b0ad37; line: 1, column: 60267]
Failed reading cache for clojure.set: com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Array (start marker at [Source: java.io.FileInputStream@3bf4621d; line: 1, column: 63470])
 at [Source: java.io.FileInputStream@3bf4621d; line: 1, column: 70979]
[:init-store-fn] Build completed. (69 files, 28 compiled, 0 warnings, 12.15s)
Done in 28.05s.

richiardiandrea21:06:02

is it something I am doing wrong?

wilkerlucio21:06:55

@richiardiandrea just a wild guess, are you declaring clojurescript dep in your dependencies (or maybe some dep is)?

wilkerlucio21:06:15

I tend to have those weird errors when something sets cljs to a version that's different from the one shadow is using

wilkerlucio21:06:48

which version it is? latest shadow uses 1.10.238 if I remember right

richiardiandrea21:06:18

yes same version there

richiardiandrea21:06:37

I was also specifying clojure 1.10-alpha4 maybe that is why

wilkerlucio21:06:07

sounds a good place to try

richiardiandrea21:06:14

will get rid of them

thheller21:06:11

@richiardiandrea wild guess but maybe 2 instances of shadow-cljs are running and messing with each other?

thheller22:06:23

clojure/clojurescript deps should not be factors there

thheller22:06:50

something is messing with the transit json output of the cache

justinlee22:06:51

seems faster:

[:app] Build completed. (741 files, 615 compiled, 1 warnings, 31.53s)
[:app] Build completed. (743 files, 617 compiled, 0 warnings, 27.73s)

justinlee22:06:24

first line was 2.3.30, second is 2.3.35

richiardiandrea22:06:42

using deps.edn for what is worth... so not sure about caching, or how to debug the problem

thheller22:06:17

old vs new?

thheller22:06:05

@richiardiandrea did you ensure that only one instance is running?

thheller22:06:17

not a leftover one in the background or so?

richiardiandrea22:06:37

dunno, I actually now cannot reproduce...

justinlee22:06:40

did it again on the exact same code base:

2.3.30: [:app] Build completed. (743 files, 617 compiled, 0 warnings, 31.35s)
2.3.35: [:app] Build completed. (743 files, 617 compiled, 0 warnings, 27.73s)

richiardiandrea22:06:07

strange world of caching 😄

justinlee22:06:08

more than 10% improvement. that’s pretty good!

thheller22:06:05

watch recompiles should be faster too

justinlee22:06:52

hm for some reason i had cache off. i don’t remember why i did that

justinlee22:06:14

oh. i bet it was when i didn’t realize that the code doesn’t reload when there are warnings.

justinlee22:06:11

well now i’m not sure about that data. i turned the cache on, redid the watch, the time went up to 51.19s. but on a restart it went down the 8.62s. maybe because it takes time to write the cache?

justinlee22:06:35

(note: I don’t use the server. i just run the watch directly because i only have one build)

thheller22:06:47

watch starts a server so you are using the server

thheller22:06:03

and yes enabling the cache will make it slower the first time since it has to be written

justinlee22:06:50

that makes sense. obviously that’s a good tradeoff.