Fork me on GitHub
#shadow-cljs
<
2019-08-16
>
Trevor02:08:45

Is there a story for shadow-cljs in the react native world?

stevechan03:08:18

But I get this Error.

darwin11:08:52

do you have something like his user.clj working? he is explicitely starting dirac agent inside his nrepl server here: https://github.com/kurtharriger/shadow-cljs-examples/blob/dirac/dev/user.clj#L6

darwin11:08:13

that is the thing which should start listening server for dirac extension in the browser

stevechan16:08:13

I don’t know how to make the dirac.agent work.

stevechan16:08:28

It’s can’t working.

stevechan16:08:05

It’s can’t working for starting dirac agent.

darwin16:08:20

I’m sorry I cannot provide better guidance than what is described in the docs here: https://github.com/binaryage/dirac/blob/master/docs/installation.md#start-dirac-agent

stevechan16:08:15

Yes, I know this. Thanks, but i can work it in figwheel.

stevechan16:08:46

I can’t work it in shadow-cljs.

stevechan16:08:26

Do you have shadow-cljs + dirac example?

stevechan16:08:06

Because i need debug npm package in the ClojureScript by dirac .

darwin16:08:09

no, I don’t use shadow

stevechan16:08:16

I tried it many times and couldn’t start dirac agent.

stevechan16:08:24

like lein repl :

stevechan16:08:30

rich Thanks Antonin。

stevechan16:08:59

I will continue to try it.

thheller16:08:04

@U1RJA2RT9 last time I checked dirac was not supported. can't remember the exact details but I doubt that has changed.

stevechan16:08:41

😭 @thheller alright, Thanks.

thheller07:08:54

@trevor670 the documentation for :react-native is still incomplete but here is an example with expo https://github.com/thheller/reagent-expo and without https://github.com/thheller/reagent-react-native

👍 4
alpox11:08:09

At the moment, most errors I get during development with shadow-cljs are very unspecific and it gives me a very hard time to track down the issues:

alpox11:08:44

Is it possible that I set some wrong configuration - or missed something in the configuration? I was looking at source-map settings but I saw they should be enabled by default in dev mode

thheller11:08:03

what did you send to the REPL?

thheller11:08:11

(foo 1 2 3) when foo is nil

thheller11:08:14

would cause that error above

alpox11:08:18

I see, this is probably what is happening - what is missing for my eyes is a reference to where this happens in my codebase

thheller11:08:46

well in something you eval'd from the REPL

alpox11:08:48

Or can a position not be found when I send functions by eval to the REPL?

thheller11:08:16

it can to some extent but it is not super accurate over time

alpox11:08:38

I thought it might be possible when I eval it through my editor integration (Not directly in the REPL)

thheller11:08:54

that makes no difference at all

alpox11:08:50

Ah okay, thanks for clearing that up 🙂

thheller11:08:08

you can try setting "pause on exceptions" in chrome

thheller11:08:28

that might show source mapped code or at the very least the JS that was running

thheller11:08:35

@alpox you might also want to upgrade shadow-cljs. in the recent released I tweaked some REPL stuff and previously some compiler warnings were lost

thheller11:08:39

so there might be some more helpful errors in case you are stuck on an "older" version (ie. last week) 2.8.48 shows warnings more reliably

alpox11:08:59

Oh wow. I've been programming JS / Web stuff for a long time but didn't ever find out about "Pause on exceptions". Shame on me. Thanks @thheller! That makes my life quite a bit easier 😄

alpox11:08:07

I'll give the upgrade a try too 🙂 thanks again

stefan18:08:18

In JS, webpack-dev-server allows me to manually type URLs that utilize dynamic routes into the address bar (during development). Is there a way to configure shadow-cljs to the the same? If I try to type anything other than the root page I get an error.

thheller19:08:22

@stefan.age what error? the default is to support push state style urls?

stefan19:08:51

This site can't be reached The webpage at  might be temporarily down or it may have moved permanently to a new web address.
ERR_INVALID_RESPONSE

stefan19:08:10

That route works if I navigate to it using the app

stefan19:08:17

but not when typing it in directly

thheller19:08:02

what response does it send?

thheller19:08:48

try curl -v -H "Accept: text/html" or so

stefan19:08:57

% curl -v -H "Accept: text/html"                                                                                                                          ✹
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3000 (#0)
> GET /graphiql HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.54.0
> Accept: text/html
>
< HTTP/1.1 404 Not Found
< Connection: Keep-Alive
< Cache-Control: private, no-cache
< Server: Aleph/0.4.4
< Content-Type: application/octet-stream
< content-length: 0
< Date: Fri, 16 Aug 2019 19:25:44 GMT
<
* Connection #0 to host localhost left intact

thheller19:08:07

that is not the shadow-cljs server. it doesn't use aleph?

stefan19:08:31

I also have a proxy-url to my back end, which uses aleph

thheller19:08:54

well yeah the proxy support forwards all requests is doesn't know to the proxy

thheller19:08:35

so that server would need to reply

thheller19:08:34

webpack-dev-server supports a bit more detailed config where it you tell it to only proxy certain paths and so on

thheller19:08:44

that would be easy to add but it not currently supported

stefan19:08:47

gotcha, I think that’s what I was looking for. Will just see if I can tweak the server a bit. thank you!

thheller19:08:56

note that you don't actually have the use the dev-http server shadow-clsj provides

thheller19:08:59

any webserver will do

thheller19:08:19

so you could just have your regular server serve the .js files

thheller19:08:25

will be closer to your production setup that way

Joe Chasinga22:08:06

Hi :spock-hand: I was told that I could get some help with integrating reagent with existing ReactJS code base here.