flexsurfer / re-frisk-remote

re-frisk remote library for debugging re-frame applications using leiningen re-frisk plugin
18 stars 5 forks source link

Not work with shadow-cljs `expo` target. #12

Closed DogLooksGood closed 4 years ago

DogLooksGood commented 6 years ago

Thanks for the great work!

Try to use re-frisk-remote with expo support in shadow-cljs.

The setup can be found here: https://github.com/shadow-cljs/expo-test

An error will occurred after dispatch event in CLJS repl. (in re-frisk)

Also, it seems 10x is not correct connected. there's nothing on its' dashboard.

DogLooksGood commented 6 years ago

I forgot the closure-defines, after set {"re_frame.trace.trace_enabled_QMARK_" true}, the re-frisk works, but 10x still not work.

DogLooksGood commented 6 years ago

UPDATE: actually 10x is connected, the problem is fx, app-db, subs are showing me the previous state, not current state. only trace shows me all the traces(include the current).

davidpham87 commented 5 years ago

Any news on this? I would be interested!

jamesnyika commented 5 years ago

Thank for opening this issue. I am seeing the same thing running re-frisk remote. I still cannot see the details of any JS objects - they are not converted over . Might be a different issue though

jamesnyika commented 5 years ago

Update.. so I am actually using it with Expo on react native and it (re-frisk-remote with 10x) works on my end. What I do not see though is any javascript objects being expanded (I cannot find any information anywhere on if this is a known bug/feature or if there is something I am missing - notice the downward facing arrows that are not expanding out but there is no error either)

It is also up to date. It takes a sec to update but it does

Screen Shot 2019-07-13 at 7 37 00 PM

My setup is as follows

I am using deps.edn

...
:deps {
 ;; bunch of other dependencies here ... then
  re-frisk-remote {:mvn/version "0.5.5"}
}

And my shadow-cljs is below. Notice,..I am using Expo but my target is :react-native


{:deps true
 :nrepl        {:port 3333}
 :socket-repl  {:port 9000}

 :dependencies
 []

 :builds
 {:app
  {:target :react-native
   :init-fn crazy.app/init
   :output-dir "app"
   :dev {:closure-defines {goog.DEBUG true
                           ;;for re-frisk to trace
                           "re_frame.trace.trace_enabled_QMARK_" true

}}
   :closure-defines {goog.DEBUG false ;; default

} ;; release build DEBUG is false
   :compiler-options {:infer-externs :auto}
   :devtools {:autoload true
              :preloads []}}}}
davidpham87 commented 5 years ago

@jamesnyika How did you manage to make sente work? I got the websocket not found error.

jamesnyika commented 5 years ago

@davidpham87 : I am embarrased to say that I do not have sente anywhere in my dependencies. All I have is this in my package.json

     .... 
    "react-native-modal": "^11.0.2",
    "react-native-modal-datetime-picker": "^7.4.2",
    "react-native-modal-selector": "^1.0.3",
    "react-native-parallax-scroll-view": "^0.21.3",
    "react-native-tab-view": "^2.3.0",
    "react-native-vector-icons": "^6.6.0",
    "react-navigation": "^3.11.0",
    "sentry-expo": "^1.13.0",
    "victory-native": "^32.0.2",
    "websocket": "^1.0.29"       ;;  <-------------- the only websocket library I have.

...unless of course some other library of mine is importing sente and using it under the covers... I got it the websocket library with

yarn add websocket 

I think...

davidpham87 commented 5 years ago

@jamesnyika Would you have an example repository? I can call the functions for enabling re-frisk remote, but localhost:4567 does not show anything.

jamesnyika commented 5 years ago

@davidpham87 Let me see what I can do and post a link here.

jamesnyika commented 5 years ago

@davidpham87 it might be as simple as you are not adding /10x to your url.

Try this..

  1. Make sure you configure re-frisk remote in your app as directed in the instructions. 1b. To enable 10x make sure you use this in your app.cljs or core.cljs file

    ;; turns on re-frame-10x
    (enable-re-frisk-remote! {:enable-re-frame-10x? true})  ;;; <--- NOTICE WE TURN 10x on
    
  2. Of course you should start up your shadow-cljs build to watch shadow-cljs watch app

  3. Start refrisk ```` lein re-frisk`````

  4. This gives the message

    hostname:~ >$ lein re-frisk
    re-frisk server has been started at http://localhost:4567
  1. Open browser to the above URL but ADD /10x at the end

     http://localhost:4567/10x 
    
  2. Profit!

    Screen Shot 2019-08-14 at 9 31 32 PM
jamesnyika commented 5 years ago

@davidpham87 Let me know if you still need a repo. I can link one here for you.. but tell me first if this works.

https://github.com/jamesnyika/bijoumin

Cheers

davidpham87 commented 5 years ago

Thanks! It works like a charm.

Except that you need to update the dependency of http-kit to 2.3.0 from re-frisk. I also run into the issue that I can not expand the values of the path in db in 10x and I can't connect it to the android simulator (but works for web).

Best regards, David

jamesnyika commented 5 years ago

@davidpham87 I am glad it worked for you. I found out that /10x by mistake almost... and thank you for the note about http-kit.

There seems to be a persistent problem with expanding out certain types of values in db particularly datascript databases. Hope that gets fixed someday.

Cheers!!!

flexsurfer commented 4 years ago

hey @jamesnyika sorry i hadn't time to answer, thanks for your solution! do you still use it? because with latest RN and all it doesn't work for me, sente doesn't want to connect to server, probably ios version, looking, thanks

flexsurfer commented 4 years ago

https://github.com/flexsurfer/re-frisk-rn