Fork me on GitHub
#re-frame
<
2017-08-16
>
captainlexington00:08:56

@mikethompson Now that's a community! ❤️ ❤️

hkjels07:08:28

hmm. Just tried to upgrade re-frame and it results in clearing my app-db for every request Maybe I’m bumping into that shocker of a breaking change?

sandbags08:08:04

@hkjels "every request" means?

sandbags08:08:19

if you reload the page it would be expected

sandbags08:08:27

as the init event will be set when the app starts

sandbags08:08:14

(and indeed the db atom will be new anyway)

hkjels08:08:19

I’m adding tracing to see what’s going on. It’s not init. I’ll report back when I know what’s going on

sandbags08:08:41

Perhaps it's me but I'm still not clear what you mean by "every request"

hkjels08:08:40

Yeah, sorry. Whenever I do any requests, I modify the app-db, that in turn seems to blow up existing state entirely

hkjels08:08:46

That’s exactly what happens. In prior versions of re-frame, the first argument to the function passed to reg-event-db was the existing db. After the upgrade, it’s just nil

sandbags08:08:46

oh, you mean dispatching an event?

hkjels08:08:19

Sorry. I think there may have been some cache in the way

hkjels08:08:40

not sure how this failed. But a downgrade and an upgrade later and it works

sandbags08:08:15

You didn't have the app open in multiple browsers by any chance did you?

sandbags08:08:40

IIRC (and maybe I don't) I've had a similar incident with the app-db appearing to be nil in one instance

mikethompson08:08:10

@hkjels confirming you are using the release from a couple of hours ago?

mikethompson08:08:13

If so, the tests pass, but the todomvc example doesn't seem to be working along the lines you are talking about. I'm cooking dinner tonight, so will have to look at this in a couple of hours.

mikethompson08:08:33

But I'd back away slowly from this release for the moment. I must have stuffed something up.

mikethompson08:08:46

Sorry about that

oliy10:08:06

Hi, I have similar problems in v10, in particular the cofx supplied to reg-event-fx doesn't have a :db key, I hope this helps you find the issue

hkjels10:08:37

sounds like it. I had to downgrade again

oliy11:08:18

We downgraded too

mattly21:08:58

thanks for this! Your original article was useful during a refactor of my project's main event loop

mattly21:08:26

and now that I'm headed into a pretty major form refactor this will provide some nice inspiration

mattly21:08:38

looking forward to part 3 with composing state machines!

jebberjeb13:08:57

cool, sorry I missed this thread!

jebberjeb13:08:48

I’m glad it could help you. I’ve really enjoyed using this approach for a long time. Even though it’s pretty simple and intuitive, it’s great to get feedback that it’s useful to see it written up.

jebberjeb13:08:02

This one is a more detailed walk through of how to do it, still pretty basic. Planning on tackling composing state machines in the next one.

mikethompson14:08:14

v0.10 of re-frame (just released) is broken. Don't upgrade to it. Wait for v0.10.1 (in about 6 hours).

mikethompson14:08:36

Sorry for the hassle

pandeiro16:08:49

@jebberjeb For someone who hates UI development, you sure do blog a lot about it

jebberjeb18:08:04

@pandeiro Clojurescript has made it remarkably tolerable 🙂

mikethompson21:08:05

@jebberjeb starting about a decade ago, game developers started using "behavior trees" instead of FSM. They feel there are significant advantages. In odd moments, I've wondered how they (behavior trees) might play out with re-frame. Warning: this is no more than a thought bubble but given you are interested in the area, I thought I'd mention it.

mikethompson21:08:07

BTW, I'm not sure you seen it but you might be interested in re-frame-async-flow. It implements a very specific kind of FSM, in data.