Fork me on GitHub
#clojurescript
<
2016-02-22
>
josh.freckleton05:02:40

I just compiled my app with advanced optimizations, and for some reason it won't work on another browser... I can access it in Chrome on Linux, Firefox on Linux, and on two different Android Browsers, but it won't work on my wife's Windows Chrome... The console says that it can't find <name of my app>. Any idea what's going on?

octahedrion09:02:34

@mfikes: hi, that bug I thought I had the other day with seqs apparently mutating turned out to be my error in interpreting the debug output -- all is well, and lazy seqs really are immutable 😀

thheller10:02:08

@josh.freckleton: check the active browser extensions, maybe there is something installed that is messing with things

danielgrosse10:02:57

As http2 is slowly rising. Are there possibilities to build packages, supporting the HTTP2 and the HTTP1 features?

thheller10:02:46

@danielgrosse: what do you have in mind? http2 is mostly transparent on the application level, no difference on the client api level

danielgrosse12:02:25

Over http1 using a concatenated, minified file is best practice. But with http2 it will be better to use separate files. Can I compile nonconcatenated, minified modules with the closure compiler?

addywaddy12:02:51

om/next question! I’m trying to get my head around normalization and thought I was making progress, but I’ve stumbled again and am not sure if I’m just not thinking correctly about the problem. How do I normalize the current user’s messages? See this gist for the details: https://gist.github.com/addywaddy/2b2ecf4ca389afb0d202

addywaddy13:02:59

Sorry - rather new here simple_smile Maybe my question is best suited to stack overflow.

thheller13:02:01

@danielgrosse: :advanced compilation is just as valuable with http2 as it was before. if you want a smaller compilation unit use modules, but you still want to eliminate dead code. no use in being able to download 50 files separately if you only use 5% or each.

thheller13:02:18

removing dead code and having a fully optimized build is still far superior to everything else

thheller13:02:38

closure modules are the best option with http1 and http2. that doesn't change.

thheller13:02:28

@addywaddy: there is an #C06DT2YSY channel, you might have more luck there

johanatan20:02:38

Hi, suppose i have a vector of channels and I want to get a vector of results from taking one element from each channel. Is this possible? [I'd rather not have to resort to side-effecting doseq but given limitations of core.async mentioned here https://github.com/clojure/core.async/wiki/Go-Block-Best-Practices it may be the only way).

johanatan20:02:50

[That article doesn't mention any workarounds-- only limitations].

jr20:02:08

blocking or non blocking?

jr20:02:23

(map clojure.core.async/poll! [chs]) will do that nonblocking

johanatan20:02:25

Since this is CLJS, shouldn't everything be non-blocking simple_smile

johanatan20:02:07

Oh, that won't quite work. The channels themselves are performing web requests to get the results posted back

johanatan20:02:32

So, it's likely that all nils will be returned at first.

johanatan20:02:03

[Oh, by 'blocking' you mean 'parking' ??]

johanatan20:02:11

Yes, parking/blocking ideally.

johanatan20:02:54

i.e., I wanted to use <! but you can't map over that per the "limitations" article above

johanatan20:02:50

How's that going to help me get a vector of results? I'd have to stitch together a bunch of results from each of the callbacks?

johanatan20:02:56

So, to give a little more context, let's say that I am swapping into an atom the vector of results and I want to do that all at once and not one by one.

johanatan20:02:46

Introducing yet another atom to accumulate the results seems less than "functional"

jr20:02:34

I usually see that implemented like so: (go [(<! ch1) (<! ch2) (<! ch3)])

johanatan20:02:56

hmm, that might work. but the length of the vector is dynamic

johanatan20:02:05

i.e., the result of a previous computation

jr20:02:59

okay something like this may work then

(go (<! (async/into [] (async/merge (map (partial async/take 1) chs)))))

jr20:02:07

the results will most likely be unordered

johanatan20:02:41

is that async/into?

jr20:02:51

ah yes forgot the ns

johanatan20:02:56

ahh, perfect! thx!

mihaelkonjevic20:02:45

you would need to destructure the result of alts! though

johanatan20:02:43

@mihaelkonjevic: yea, I think that would work. Probably just call 'first' on the result rather than destructure

johanatan20:02:10

@mihaelkonjevic: it's a bit more "machinery-oriented" than "function-oriented" though (not to mention many more tokens) so I prefer the async/into + async/merge solution simple_smile

mihaelkonjevic21:02:28

absolutely, I'm saving that snippet for later reuse simple_smile

imjonathangth23:02:03

Hello Everyone