Fork me on GitHub
#shadow-cljs
<
2018-04-03
>
tianshu09:04:02

what's :runtime option stands for?

thheller09:04:58

in which context?

tianshu09:04:45

I understand, in :npm-module will add repl client when it see :runtime = :browser.

thheller09:04:49

REPL in :npm-module is very unreliable. I meant to take it out completely. don't expect things to work.

thheller09:04:30

but yes :runtime decides if the browser REPL or node REPL clients get injected

tianshu10:04:36

I am trying to add a react native target, I add a file, copy from browser.clj.

tianshu10:04:11

basically, I can take this single file to a shadow-cljs project, and I will have a new target?

thheller10:04:26

the REPL is not going to work properly in react-native when using their packager. probably need to do the same hackery that re-natal does for figwheel

thheller10:04:45

same for live-reload

tianshu10:04:47

no, it works perfectly I think...

tianshu10:04:09

remember a few days ago, I asked you about these things

thheller10:04:23

for simple stuff maybe. ns and require are probably not going to work

tianshu10:04:55

you mean require other cljs file in repl?

thheller10:04:13

(require '[some.thing :as x]) in the REPL yes

tianshu10:04:10

maybe I can have a try on this

tianshu10:04:50

but I don't think this is a serious problem.

thheller10:04:38

I still didn't spend much time with RN but the fact that they are re-bundling the output from shadow-cljs is going to cause issues with reload/REPL

thheller10:04:53

even if its just source maps not working

thheller10:04:16

so I'd much rather bypass their packager completely if possible

tianshu10:04:00

I think cljsrn needs a big step on tooling.

tianshu10:04:31

it's really a awesome way for building apps with clojure, as RN is much more mature than few years ago.

thheller10:04:13

are there any docs about what their packager actually does?

tianshu10:04:19

haven't see any

tianshu10:04:48

and the package is likely still under development.😂

thheller10:04:38

is create-react-native-app the preferred way to create apps these days or react-native directly?

tianshu10:04:17

yes, and it use exponent.

sleepyfox11:04:19

I can see that the version has been bumped to 2.2.22 over the previous 2.2.20

thheller11:04:30

are you using openjdk on ubuntu by any chance?

thheller11:04:42

see the issue above

thheller11:04:00

this seems to fix that

sleepyfox11:04:15

Not in my case it seems

thheller11:04:58

do you have mvn available?

sleepyfox11:04:17

I'm building on top of the official Clojure Docker image, which is clojure:lein, which is built on openjdk:8, which is built on buildpack-deps:stretch-scm

sleepyfox11:04:39

No, there is no mvn

sleepyfox11:04:16

but there is a /usr/local/bin/lein

thheller11:04:46

lein should run into issues as well. you can create a temp project.clj and just add shadow-cljs and let it try to resolve

thheller11:04:02

yesterday this yielded

Leiningen 2.8.1 on Java 1.8.0_162 OpenJDK 64-Bit Server VM Could not transfer artifact org.clojure:clojure:jar:1.9.0 from/to central (): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

thheller11:04:41

(defproject the-thing "0.0.0"
  :dependencies
  [[thheller/shadow-cljs "2.2.22"]])

thheller11:04:48

hopefully that spits out a better error

sleepyfox11:04:16

OK, fixed using the stackoverflow answer posted above

thheller17:04:10

@denik just pushed 2.2.23 which should fix all performance issues in builds with many JS files. semantic-ui-react goes from 3sec+ back down to the usual 0.4s

😲 16
denik17:04:10

thank you! will test now!

denik18:04:43

@U05224H0W for me it now takes 2x longer for each compile

[:app] Build completed. (207 files, 1 compiled, 0 warnings, 0.59s)
[:app] Compiling ...
[:app] Build completed. (207 files, 1 compiled, 0 warnings, 0.54s)
[:app] Compiling ...
[:app] Build completed. (911 files, 728 compiled, 0 warnings, 19.55s) <=== required semantic ui
[:app] Compiling ...
[:app] Build completed. (911 files, 1 compiled, 0 warnings, 0.71s)
[:app] Compiling ...
[:app] Build completed. (911 files, 1 compiled, 0 warnings, 0.98s) <== ~ compile time avg
[:app] Compiling ...
[:app] Build completed. (911 files, 1 compiled, 0 warnings, 0.95s)
[:app] Compiling ...
[:app] Build completed. (911 files, 1 compiled, 0 warnings, 1.22s)

thheller18:04:20

can you compile with --verbose and check where all the time is going?

thheller18:04:34

its more reasonable now but still too slow

geraldodev20:04:01

Do you have conf recommendation for running server process?

lilactown21:04:07

after upgrading to 2.2.23 (from 2.2.3) I'm getting a crash when starting a watch: Caused by: java.lang.ClassNotFoundException: com.google.javascript.jscomp.CompilerInput$ModuleType

thheller21:04:58

@lilactown do you have a pinned closure-compiler version in your dependencies? if so remove it.

lilactown21:04:48

not that I'm aware of

thheller21:04:17

clojurescript?

lilactown21:04:45

I do have clojurescript in my project.clj at 1.9.946

lilactown21:04:55

(I'm using the lein integration)

thheller21:04:48

yeah bump that to 1.10.238.

thheller21:04:55

or create an empty (ns shadow.build.cljs-closure) .. I added that ns to work around a different issue related to CLJS versions .. can't win in this situation ...

lilactown21:04:20

k, I'll try updating to 1.10.238. thanks!

lilactown23:04:04

ok, that's working great now