Fork me on GitHub
#shadow-cljs
<
2019-07-09
>
knubie14:07:10

what’s the best way to determine whether you’re in dev/release mode in your clojurescript code?

mccraigmccraig14:07:12

@steedman87 we use closure defines for such things

knubie14:07:26

@mccraigmccraig Just found that on the users guide!

knubie14:07:33

thanks 🙂

neupsh15:07:40

Hello, when i try to use expo-three node module in a shadow-cljs expo project, I get this error:

Uncaught Error: Cannot find module './suppressWarnings'
This happens when i require THREE from expo-three module. I can see that the supressWarnings.ts file is there in the repo where Three.ts file is in this repo: https://github.com/expo/expo-three/blob/master/src/Three.ts Is this because the exported object is suppressExpoWarnings but the filename is suppressWarnings? I am weak on JavaScript and not sure if it is because of the way shadowcljs compiles the ts files or if there something else I am missing.

neupsh16:07:59

Here is the repo for that issue: https://github.com/neupsh/rn-rf-shadow/tree/test-threejs * clone, yarn watch on one terminal, and once it compiles, yarn web to open the react-native-web app on browser (if it does not automatically open the browser you can open http://localhost:19006/

thheller16:07:22

@neupsh please paste the full error.

thheller16:07:40

so thats not a shadow-cljs problem then

thheller16:07:22

no clue how the expo web stuff works but looks like it uses webpack

thheller16:07:47

might be that the expo-three stuff just doesn't support the web target?

thheller16:07:19

you should try creating a pure JS expo web project and see if it works there

thheller16:07:23

I'd be very surprised

neupsh16:07:15

@thheller from what I have gathered expo-three works on web as well. There is this project which demos it: https://github.com/EvanBacon/Expo-Pillar-Valley

thheller16:07:38

which version of expo-three did you use?

thheller16:07:07

ah nvm its in the repo

thheller16:07:33

sorry I don't have time to look into this more closely right now

thheller16:07:54

maybe ask in some expo channel or so

neupsh17:07:48

@thheller no problem thanks for looking at it. I will try to figure out more but looks like plain java script projects do not have this issue. In any case if anyone else have any suggestions I am open for it 🙂

thheller17:07:16

@neupsh one thing that looks different is that the expo project above has a webpack.config.js which seems to do a whole bunch while your project has none. https://github.com/EvanBacon/Expo-Pillar-Valley/blob/master/client/webpack.config.js

neupsh17:07:12

Thanks for the pointer @thheller I will take a look

clojuregeek20:07:00

I want to start my shadow-cljs with code to run my integration tests and i am using the start! function to start the server .. but i don't see how to pass in params for the port - https://github.com/thheller/shadow-cljs/blob/555befb961f204849524011eeafba1ab665c538a/src/main/shadow/cljs/devtools/server.clj#L409

clojuregeek20:07:21

my server runs at localhost:8890 .... and my dev server is localhost:8888

thheller20:07:05

please define what kind of server you are talking about more detailed

thheller20:07:28

shadow-cljs starts a http server, a nrepl server, a socket repl server and depending on config dev http servers

thheller20:07:40

all of them with their own purpose and port

thheller20:07:51

by "your server" I presume you talk your CLJ http server?

thheller20:07:08

you can use that server to serve the JS files created by shadow-cljs

thheller20:07:18

you do not need to use the http server shadow-cljs provides for that

clojuregeek20:07:40

ok so i can run my tests using the http server and not run an additional server just for tests

thheller20:07:08

don't know enough about what your tests do

thheller20:07:16

but yes you can probably run them without shadow-cljs even running

clojuregeek20:07:21

they are webdriver tests

thheller20:07:45

ok then it is probably enough to just compile once and then run the tests without having shadow-cljs running

thheller20:07:55

unless you want to REPL into your tests and so on

clojuregeek20:07:06

i was using node to run them but it apparently doesn't respond sometime so my boss changed to start the server with code

clojuregeek20:07:49

thanks for your help

thheller20:07:31

in general for tests I recommend not combinging compilation with actually running them

thheller20:07:37

so you first compile separately

thheller20:07:42

and then run them

thheller20:07:06

so its easier to identify when compilation actually failed