Fork me on GitHub
#re-frame
<
2018-05-17
>
hoopes00:05:57

on the most recent defn episode with mr. thompson, there was some talk about statecharts and behavior trees - is there any work in that direction to check out yet? just curious

Oliver George00:05:11

I got curious and read the paper he mentioned. It does seem like a good model. That said working out a good development experience is going to be non trivial... how to visualise, what source code looks like etc

hoopes00:05:36

yeah, i read that as well, and there are a couple (at least one?) project that tried it out ( https://github.com/jiangts/re-state ) but i couldn't really get over the mental hurdle, so i was wondering if there was a more blessed by re-frame folks stab at it to try out

mikerod02:05:58

@tomi.hukkalainen_slac @mikethompson I also believe that reg-sub-raw is more powerful than the other since you can have subscriptions depend on the value (or derived value) of other subscriptions in your subs. Just mentioning it since it has been a case that led me to need reg-sub-raw. However I ended up making my own macro over it so I didn’t have to keep doing the reaction return val and subscribe part stuff over and over. But that’s just because I kept making subtle mistakes when I had a lot of them.

mikethompson04:05:24

Looks fine to me

Hukka05:05:34

@mikethompson Hm, true. I'm not yet at the point where the computations are visible outside the reg-sub, so that didn't come into my mind

kommen11:05:32

any chance to get https://github.com/Day8/re-frame-template/pulls merged today? doing a re-frame introduction today at the local meetup and would be nice if people start out with the latest versions

kommen11:05:28

I’m available here to address further change requests

mikethompson11:05:16

Matthew is quite the globe trotter, so there's no knowing what timezone he's in

deg12:05:22

I'm having a weird set of bugs with re-frame-10x in a new app. I'm slowly splitting the difference with another app, to see if I can find the problem. Posting here too, in the hope that someone recognizes the symptoms and can save me some time... At startup, I get this error, apparently because js/window.open returns nil:

router.cljc?rel=1526558777065:200 Uncaught TypeError: Cannot read property 'document' of null
    at day8$re_frame_10x$events$open_debugger_window (events.cljs?rel=1526558782271:287)
    at events.cljs?rel=1526558782271:298
    at mranderson047$re_frame$v0v10v2$re_frame$std_interceptors$fx_handler__GT_interceptor_$_fx_handler_before (std_interceptors.cljc?rel=1526558777144:133)
    at mranderson047$re_frame$v0v10v2$re_frame$interceptor$invoke_interceptor_fn (interceptor.cljc?rel=1526558776779:67)
    at mranderson047$re_frame$v0v10v2$re_frame$interceptor$invoke_interceptors (interceptor.cljc?rel=1526558776779:105)
    at mranderson047$re_frame$v0v10v2$re_frame$interceptor$execute (interceptor.cljc?rel=1526558776779:196)
    at mranderson047$re_frame$v0v10v2$re_frame$events$handle (events.cljc?rel=1526558776964:64)
    at mranderson047.re_frame.v0v10v2.re_frame.router.EventQueue.mranderson047$re_frame$v0v10v2$re_frame$router$IEventQueue$_process_1st_event_in_queue$arity$1 (router.cljc?rel=1526558777065:175)
    at mranderson047$re_frame$v0v10v2$re_frame$router$_process_1st_event_in_queue (router.cljc?rel=1526558777065:83)
    at mranderson047.re_frame.v0v10v2.re_frame.router.EventQueue.mranderson047$re_frame$v0v10v2$re_frame$router$IEventQueue$_run_queue$arity$1 (router.cljc?rel=1526558777065:194)
Despite that, c-H seems to work fine, and I can pop out the re-frame-10x window, and even navigate most of it. But, parts are not working. In particular, in the app-db tab, I can look at the db, the the "expand me" triangles don't work, so I can't see more than one line in each path inspector. Any of this sound familiar to anyone?

mikethompson12:05:16

We've had other reports of this

mikethompson12:05:56

Someone reported that they browsed to this URL to reset their profile settings, and it worked thereafter:

mikethompson12:05:44

ALSO: check that you are consistently using React16 OR React15

mikethompson12:05:58

and not mixing the two through dependencies

mikethompson12:05:36

For example be sure to use [day8.re-frame/re-frame-10x "0.3.3"] for React15

mikethompson12:05:48

and [day8.re-frame/re-frame-10x "0.3.3-react16"] for React16

mikethompson12:05:06

Plus look at the other dependencies to make sure they line up

deg12:05:09

Thanks. Good news is that I just managed to reproduce the problem in a clean lein new luminus ...., but in my existing chrome env. So trying that reset now to see if it fixes

deg12:05:23

Didn't help.

deg12:05:41

Is supposed to show me any gui? I just see a blank tab.

deg12:05:12

never mind. "open in new tab" fails, but manually it seems to do something. one minute

mikethompson12:05:47

I see this ^^^^^

mikethompson12:05:21

I use Canary for dev (well away from my actual Chrome) so i don't lose anything when i have to take this kind of drastic action.

deg12:05:49

Yup. Copying the link and opening in a fresh tab gave me the reset option

deg12:05:19

And, it looks like it fixed the problem. (Sadly, in my main chrome, so I'll need to re-enable my extensions. But small price to pay).

mikethompson12:05:41

Hmm. I wonder what is going on.

deg12:05:52

To be exact: it fixed the problem in the clean project. I need to still test in my real project and test after I re-enable extensions.

deg12:05:05

I'll post here if I find any clues.

deg12:05:17

But, short answer: this reset definitely seems to be relevant.

mikethompson12:05:44

Any thoughts about what you did immediately before the problem showed up?

deg12:05:20

No. It's not clear when it first showed up. I was intermittently having the problem of the "expand me" triangles not working, and was klduging around it by opening many inspectors, each pointing at something I needed to see. ....

deg12:05:34

Did not reload the app for a while, as I was tweaking code. Then, did a major code refactor, a rebuild and saw the window.open nil.

deg12:05:25

Did a bit of testing then. Verified that I could open a window in javascript from the chrome inspector; but got nil when I tried from a cljs repl (in emacs+cider, if that is relevant)

deg12:05:04

After that, everything I did was garbage ... assumed it was something in my changes, and made many inconsequential tweaks. Then, finally, reached out for help just now.

deg12:05:35

I'm running Chrome Version 67.0.3396.18 (Official Build) beta (64-bit) on Ubuntu 16.04.

deg12:05:32

Oh, damn, I was dumb. If the problem was one of my extensions, I was stupid. I did not write down which extensions were running. And, I normally have dozens turned off, and only a few on. Now, I have "dozens_plus_a_few_more" turned off, and need to remember which to turn back on. For my sake, I'll start with very few on; but that may be losing a clue for you. Sorry.

deg12:05:07

Ok. So I've re-enabled the extensions I use heavily and I've tested on my regular app. So far, all is good. I'll let you know if this happens again.

deg12:05:39

Oh... forgot. a big Thank You for saving me a few hours now with your quick answer!!

mikethompson12:05:55

Thanks for the report. BTW, React15 or React16 ?

deg12:05:55

I think still 15, but not sure how to check. .... hmm, looks like 16 now. IIRC correctly, I changed version of -10x mid-problem. I think to the version for 16. So, quite possible that this problem began when I had a classh.

deg12:05:32

Hmm, in which case, I think I found a problem in the Luminus template.

deg12:05:15

I created the new project with lein new luminus diffusion +http-kit +cider +re-frame +kibit +swagger and see

$ lein deps :tree | grep react

   [cljsjs/react-flip-move "2.9.17-0"]
   [cljsjs/react-highlight "1.0.7-1" :exclusions [[cljsjs/react]]]
   [cljsjs/create-react-class "15.6.2-0"]
   [cljsjs/react-dom-server "16.3.0-1"]
   [cljsjs/react-dom "16.3.0-1"]
   [cljsjs/react "16.3.0-1"]

$ lein deps :tree | grep 10x
 [day8.re-frame/re-frame-10x "0.3.3"]

That's a clash, right?

mikethompson12:05:24

Yeah, should be [day8.re-frame/re-frame-10x "0.3.3-react16"]

mikethompson12:05:52

But I'm not sure that would cause this problem

mikethompson12:05:02

(Genuinely not sure)

deg12:05:05

I certainly don't know. And, it certainly didn't cause the problem immediately. But, I guess you should open a PR at Luminus to fix it anyways??

deg12:05:25

Is there any way you can check at runtime for a 15 vs 16 clash?

mikethompson12:05:27

@danielcompton can we report to Luminus please. ^^^^

gadfly36113:05:52

@kommen @mikethompson I can get that out in about 2 hours, once I get back to my computer :)

gadfly36113:05:42

@mikethompson haha yeah, in Toronto right now, will be in Germany on Saturday 😂

kommen13:05:27

@gadfly361 nice, 2 hours will be just in time delivery 👌

philippamarkovics13:05:34

hey, any idea why re-frame-10x shows me the ::initialize-db event in the events tab only after the next re-frame event was dispatched?

philippamarkovics13:05:56

it seems the event tab is always lagging one event behind

philippamarkovics14:05:16

very strange: emptying cache and restarting chrome fixed this issue for me

gadfly36114:05:29

@philippmarkovics I think i saw a thread about this earlier (so just blindly repeating without any knowledge on the matter) ... but i think it has to do with 10x not handling dispatch-sync the same way as normal distpatch

gadfly36114:05:40

@kommen new version of re-frame-template should be available now