Fork me on GitHub
#clojurescript
<
2015-09-27
>
reefersleep12:09:21

Hello simple_smile Does anyone have any experience with Re-Frame? I'm trying to learn it because I dig Reagent and think Re-Frame sounds like a neat way to structure a larger Reagent web-app. After having read some criticism of Angular becoming unwieldy when an app reaches a certain level of complexity, I'm wondering if there are any hidden drawbacks to Re-Frame's way of doing things. For example, I really like the prospect of a single source of truth (one atom that holds the frontend's in-memory "app-db) in respect to debugging, saving and recreating states and such, but I'm wondering if having a single source of truth means that there will be contention if you have many concurrent processes trying to reach the app-db. Not that I plan to do that, just wondering if there are drawbacks and that's the only possible example I could think of simple_smile

hkjels12:09:11

@reefersleep: I’ve just started using Re-frame myself, so I guess I’m not qualified to answer. You should head over to the #C073DKH9P channel and ask there

bobby.harris12:09:17

@reefersleep: Since (for now) javascript runs in a single threaded scenario you don't have to worry so much about contention. Also, when and if does I'm sure the other clojure reference idioms (agents, refs etc..) will be ported to clojurescript.

reefersleep13:09:35

@hkjels cheers, I'll go there simple_smile

reefersleep13:09:26

@bobby.harris: I'm actually not used to thinking about threading explicitly in applications, so I forgot to think of JavaScript that way.

reefersleep13:09:37

@bobby.harris: what is the "when and if" you are referring to?

reefersleep13:09:07

@hkjels: What's your experience like so far? simple_smile

bobby.harris14:09:15

Well, there is the web workers part of html 5. Not sure how well supported it is.

bobby.harris14:09:35

I've written one reagent app for internal use. I'm planning on porting it to re-framed, which shouldn't be too much effort. Best practice for reagent includes having a single source of truth atom.... which i'm using.

bhagany14:09:00

Is there a known issue regarding #js literals in go blocks? I'm getting a strange warning. Here's a minimal reproduction: https://github.com/bhagany/go-literal

bhagany14:09:57

Removing the go block and raising the let to the top level results in no warnings

bhagany14:09:46

I should probably put that in the readme

hkjels15:09:47

@reefersleep: Re-frame is great. I’m pretty sure it scales quite well also. In the wiki, there’s a post about how you could layout a larger app.

hkjels15:09:21

btw. Sorry for the late answer

reefersleep15:09:20

@hkjels: No problem simple_smile I'll have to have a look at that.

meow15:09:00

@bhagany: The known issue with go is that it is a macro that does a lot of magical rewriting of the code within the block. So you want to keep the code that is within the go block to the bare minimum, specifically to avoid weird errors, which might be the case here.

reefersleep15:09:07

@bobby.harris: I've done a single reagent app so far using only one atom, which worked great. Now I'm trying out another app, where I've felt compelled to use 3 so far. I'm going to "port" it to re-frame, and I don't think it'll be a problem to switch to one atom... But we shall see simple_smile

borkdude16:09:15

what is the common name for a "web stack": like the libraries/technologies you use in every tier from front end to database. Web stack doesn't seem to cover it

borkdude16:09:51

sometimes they say: full stack developer and then a list of libraries follow that you're supposed to know. What is the common name of a collection of such libs/tech

colin.yates16:09:33

end-to-end maybe? Dunno - I don’t think there is standard terminology for this is there?

bhagany16:09:03

@meow: I understand that go is complicated. Using #js in a go block seems like a pretty common case though. That reproduction is just a minimal case - the code that I'm actually interested in takes from a channel and does some js interop with the value it gets, so "take that out of the go block" doesn't work

bhagany16:09:42

To be clear, I can work around this with clj->js, which does work. I just want to know if I should expect #js not to work, or if this is a legit bug.

dnolen16:09:22

@bhagany: there’s lot of bugs like this in cljs.core.async due to it not using a standard analyzer and instead using a handrolled thing

dnolen16:09:56

there’s also already several issues open which are all basically the same thing

bhagany16:09:59

@dnolen: Okay, thanks. My googling turned up nothing.

dnolen16:09:16

@bhagany: you’ll want to look at JIRA. It’s probably worth opening an issue just so it’s verified when analysis is fixed. It’s unclear when that will be, the people that would normally work on it (like myself or Timothy Baldrige) are pretty tied up with other things.

dnolen16:09:29

definitely a place where someone could really do some significant contribution

bhagany16:09:05

@dnolen: Okay. I really should get in the habit of looking at JIRA. I'll search for dupes and file a ticket if I don't find any.

lvh17:09:26

bhauman: Awesome Strange Loop talk! I’m loving devcards more and more. I’m looking forward to using it a lot more. I’ve been experimenting with it and it’s amazing how empowering the lab space is especially for new programmers; this idea that they can’t mess stuff up seems to be very powerful to help them feel confident enough to experiment

lvh17:09:30

bhauman: tl;dr thank you ❤️

meow18:09:53

@bhagany: one alternative is to take your channel value and pass it to a function where you do the js interop stuff on it. The go macro won't mess with the code in a called function. So that becomes your safety zone, so to speak.

meow18:09:50

I've learned to keep go blocks minimal and shallow.

bhagany18:09:27

@meow: Yes, hardly seems worth it in this case though, when clj->js works

meow18:09:41

Not sure if shallow is the right word, but I think you know what I mean.

meow18:09:21

@bhagany: right, but for other cases - I've given that advice to others...

bhagany18:09:29

I think so. It's a 4-line go block as it is simple_smile

meow18:09:00

I guess I was assuming that your real use-case might be bigger and that you wanted to not have to use clj->js

bhagany18:09:58

nah, it's very small. I'm calling clj->js on a 3-pair map.

tskardal18:09:51

I’m trying to send FormData by using cljs-ajax as described in the README (https://github.com/JulianBirch/cljs-ajax) but I can’t figure out what I’m doing wrong! The request is never sent as a multipart/form-data. Anyone done this before?

borkdude18:09:05

@tskardal: I've tried it once, but then I discovered that the customer wanted to support IE9 also, so I just went for closure's iFrameIo and haven't really continued trying

tskardal19:09:53

@borkdude: thanks, I’ll have a look at that. I’m just messing around so IE support doesn’t matter

potetm19:09:37

@dnolen: Is there a place where I could get more info on the core.async analyzer issue? I’m interested in taking a look at it, but couldn’t find that particular issue in JIRA.

dnolen19:09:32

@potetm: there isn’t anymore information than what I described. You will need to just read the core.async sources

dnolen19:09:08

@potetm: if you have more specific questions I would email Timothy Baldridge.

potetm19:09:12

Cool. I can do that. simple_smile

potetm19:09:17

Will do. Thanks.

bhauman20:09:35

@log thanks!! Really good to hear!

lfn320:09:46

@borkdude: It's a stack, isn't it?

lfn320:09:33

As "our stack is react, clojure and postgres" or something.

bhagany22:09:24

@potetm: Here's the core.async issue. It had already been filed: http://dev.clojure.org/jira/browse/ASYNC-117

bhagany22:09:12

Not a ton of info on the ticket, though

bhagany22:09:53

Also, I can confirm it's still an issue for recent versions of clojurescript and core.async