Fork me on GitHub
#shadow-cljs
<
2018-04-16
>
tony.kay03:04:25

BTW: my build does not indicate a preload of devtools, but it is on the classpath.

thheller08:04:03

@tony.kay the hud works just fine for me when running lein new fulcro app shadow-cljs demo and shadow-cljs watch test with 2.2.31?

thheller08:04:45

no wait. didn't edit the project.clj. assumed the package.json version was used. doesn't work with 31 indeed.

thheller08:04:21

fixed in 32. the dynamic discovery I added in 30 forgot to add the devtools after discovery.

tianshu10:04:24

can I use :npm-module target for expo to build a release version? (also should provide a index.js manually)

thheller10:04:12

@doglooksgood I added release support in 2.2.31

thheller10:04:39

when you run shadow-cljs release it generates an optimized.ios.js in the :output-dir

tianshu10:04:47

why you are so fast:scream:

🚀 4
thheller10:04:09

that should work fine with the default exp/react-native tools when you use that as the entry

thheller10:04:08

you can't use that file directly though. it must be run through metro

tianshu10:04:33

I'll try the new feature in 2.2.31

thheller10:04:53

I didn't try exp build or any of the release stuff since it asked me a bunch of questions I didn't want to answer at the time

thheller10:04:58

keychain and whatnot

tianshu10:04:08

are react-native and expo targets work in the same way?

javi13:04:13

question: I am setting up my release toolchain starting with a simple one. Given I have a release build setup

...
:simple-deploy {:target :browser
                                  :output-dir "resources/public/simple-deploy/js/"
                                  :modules          {:main {:entries [simple-deploy.core]}}
                                  }
...
and a simple reagent mini app... with a single dependency on reagent
(ns simple-deploy.core
  (:require [reagent.core :as r]))

...
...
;; app code
...
...
(defn ^:export run []
  (r/render [simple-example]
            (js/document.getElementById "app")))
when I run shadow-cljs release simple-deploy --debug I get...
[:simple-deploy] Compiling ...
Closure compilation failed with 1 errors
--- EXTERNS:/Users/javierabanses/.m2/repository/cljsjs/d3/4.2.2-0/d3-4.2.2-0.jar!/cljsjs/d3/common/d3.ext.js:670
Object literal contains illegal duplicate key "scaleSequential", disallowed in strict mode
so the question is? when/why is d3 being included? NOTE: this is the first time i've run shadow-cljs release ... so maybe it is scanning the local maven repo for indexing or something? thanks in advance.

alex-dixon14:04:02

@fj.abanses Hm. Can you search bundle-info.edn for d3?

pez15:04:40

@thheller Now I have released an update to Calva with the much lacking shadow-cljs support added. https://marketplace.visualstudio.com/items?itemName=cospaia.clojure4vscode

pez15:04:29

There are still some quirks that I don’t have the time to elaborate on right now, but nothing that should be a stopper. Also, I have no idea how this works for other projects than browsers. So anyone who would like to try that out and provide me feedback will become my hero.

🎉 16
javi15:04:51

@alex-dixon.. not familiar with that file... is it in the .shadow-cljs folder?

alex-dixon15:04:04

@fj.abanses Yeah but it looks like you might need to follow the instructions here to generate it: https://clojureverse.org/t/help-wanted-release-bundle-size-visualization/871/9

alex-dixon15:04:21

@fj.abanses I’m actually not sure how helpful that will be. Also appears manifest.edn contains similar information

javi15:04:14

@alex-dixon thanks! I am gonna check manifest.. and then the bundle...

javi16:04:11

@alex-dixon when running

npx shadow-cljs clj-repl
shadow-cljs - config: /Users/zilence/code/shadow-cljs/shadow-cljs.edn version: 2.0.101
shadow-cljs - connected to server
shadow-cljs - REPL - see (help), :repl/quit to exit
[11:0]~shadow.user=> (shadow/release-snapshot :simple {})
:simple being build id i get ExceptionInfo closure errors clojure.core/ex-info (core.clj:4739) keep in mind shadow-cljs release :simple never finished and exited with an error... so maybe this means there is nothing to examine...

alex-dixon16:04:43

@fj.abanses Oh. Didn’t see that. That makes sense. I think it runs the release first in order to analyze it

javi16:04:48

@alex-dixon is there a lein clean equivalent or even need for it? I am very new to the tool and can't see any in the docs

pez17:04:31

@fj.abanses i just delete the artifacts.

javi17:04:58

@alex-dixon @pez it just worked as soon as i stopped the repl i was running...

alex-dixon17:04:09

@fj.abanses There isn’t a clean equivalent. I raised it as an issue here: https://github.com/thheller/shadow-cljs/issues/242

javi17:04:32

👍 i ll check that. thanks for the help

thheller17:04:50

@fj.abanses the problem is most likely cljsjs.d3 on your classpath.

thheller17:04:23

currently shadow-cljs uses the externs from any cljsjs package. probably should not do this anymore but it seems like a good idea in the beginning.

thheller18:04:41

didn't think that this would ever be a problem but I guess there are some broken externs for d3

thheller18:04:20

but it is not d3 being included. it is only the externs.

thheller20:04:08

I just pushed 2.3.0 which removes this behaviour. about time.

thheller20:04:27

completely forgot it even existed

javi20:04:43

@thheller you are a star 😀

lwhorton21:04:37

how do I use shadow-cljs clj-run some.namespace/-main arg1 arg2 arg3 with flags that is normal input for something like tools.cli?

lwhorton21:04:00

because -a arg1 -b arg2 ... etc. throws with a shadow-cljs clj-run “unrecognized argument”

lwhorton21:04:41

do I have to use some magic string or some other unix trick to make shadow-cljs ignore the arguments?

thheller21:04:53

everything after that just gets passed through

thheller21:04:20

I should probably change the CLI parsing for clj-run so that thats the default

thheller21:04:35

but for not shadow-cljs clj-run foo.bar/run -- a b c

🎉 4
lwhorton21:04:09

thanks again

cjmurphy23:04:48

How do you upgrade shadow-cljs? I can see that the version is specified in package.json and project.clj. So I can change it to say '2.3.0' in both those places. Then what do I need to do? I never saw this outlined in the documentation, yet everyone seems to be doing it. If I just run npx shadow-cljs watch main (the only command I ever run) the version change is not picked up.