Fork me on GitHub
#clojurescript
<
2015-11-09
>
Tim00:11:51

@drewverlee: elm tries to be very frp, putting events and things in streams

Tim00:11:30

cljs is basically compiling clojure to javascript, which means immutability + lisp syntax

roberto00:11:39

you can get the same uni-directional flow with cljs when you use re-frame

roberto00:11:53

the biggest difference I would say is that Elm is statically typed.

Drew Verlee01:11:56

@tmtwd and @robert, thanks!

grav09:11:10

oh dear, my figwheel setup just broke down all of a sudden. in chrome’s network tab I get 404’s from jsloader:197 when it tries to load the updated files. I have no idea what’s going on

thheller10:11:07

@dottedmag I suspect something was introduced that keeps more of cljs.core alive but any real program should probably still be the same size

thheller10:11:25

optimizing for "hello world" isn't really a goal worth pursuing since you are basically always going to use what cljs.core offers (eg. the persistent collections)

dottedmag10:11:39

@thheller: True, I am really wondering whether there is some issue with retaining code which should be purged, which could manifest itself in larger programs too.

thheller10:11:23

yeah I'm looking for suspects on the commit history too

thheller10:11:46

but my builds over the last few months haven't really changed in size

thheller10:11:46

so it is probably just a map or something like that used in cljs.core which keeps that code alive which was removed before

dnolen10:11:08

@dottedmag: if it affected larger projects we usually hear about it immediately

dnolen10:11:47

while it’s nice to know that hello world will work it’s also very uninteresting

dnolen10:11:30

file a minor regression issue in JIRA

dnolen12:11:37

@dottedmag: DCE issue should be fixed now, far as I could tell it would have mostly affected forward declares

dottedmag12:11:44

@dnolen: Oh, cool. Thanks.

bojanx10012:11:36

Hi guys. This would seem stupid but I'm trying to run my clojurescript web app as a stanalone without figwheel and I don't know how to do that. Is there some good article how to start an app with ring (but I dont have handler, I use index.html as a start point)? When I start with figwheel I just type "lein figwheel" and the app is started on 3449 port. Thanks.

hkjels12:11:52

@bojanx100: Look up cljsbuild

hkjels12:11:20

and if you want to serve this up using clojure, you have to set up a handler etc

msattel12:11:40

@bojanx100: So you actually want to deploy your app and not run it in some sort of "dev" mode?

msattel13:11:16

If that is the case then you may want to package and deploy it as a jar file, maybe this will help you http://darrennewton.com/2015/03/08/sour-mash-getting-your-clojure-into-a-jar/

bojanx10013:11:24

Yea, I would like to get to the point where I say "lein ring uberwar" but I can't do that until I configure the rest

wamaral13:11:32

uberwar sounds so epic

msattel13:11:37

I don't think that you need a war file, a jar file with embedded http server like jetty or http-kit or alike will do it.

peterschwarz16:11:19

Does anyone have any experience using stuartsierra/component in ClojureScript? Particularly when the result of a component starting up would be asynchronous? For example:

(defrecord MyAsyncComponent [config value]
    
    component/Lifecycle
    (start [this]
      (get-async-value config #(assoc this :value %))
      this)

    (stop [this]
      (stop-async-value (:value this) #(assoc this :value nil))
     this)) 
  
Would this be valid component? Do I have anyway of validating that it started?

Lambda/Sierra16:11:05

@peterschwarz: Components are immutable values, so your #(assoc this :value %) will have no effect.

peterschwarz16:11:37

Hmm, maybe I’m misunderstanding the documentation then

Lambda/Sierra16:11:05

start and stop must return the updated version of the component record.

Lambda/Sierra16:11:14

assoc also returns a new value.

peterschwarz16:11:25

That makes sense. Also, you are possibly answering my question as well - not exactly possible to startup an async component.

peterschwarz16:11:38

Unless I’m still missing something

Lambda/Sierra16:11:11

If the "start" process requires asynchrony, you would need to create a mutable container — like an atom — inside your component and modify it in the callback function.

peterschwarz16:11:39

Of course <smacks forehead>. Thanks @stuartsierra!

Lambda/Sierra16:11:46

You're welcome!

Al Baker16:11:40

anyone know if it's possible to use core.async as a cljs export into vanilla JS land for those unfortunate to have a twisted JS architecture to fit in? Or alternatively if there's a core-async JS port similar to the transducers-js port?

Al Baker16:11:02

cool, thanks - was just taking a look at that

Al Baker16:11:43

if you write a regular cljs function that wraps some core.async channel stuff, would that be the right angle for integrating two code bases, where you want some JS thing to call a function that effectively put something onto a channel?

Al Baker17:11:19

ie with ^:export

dnolen17:11:38

Yes you can do that

Al Baker17:11:45

cool, will give that a try too

isaac17:11:31

what is the equivalent way of (extend-protocol IProtocol Object …) at cljs?

isaac17:11:12

define the default method

isaac17:11:41

default implementation

dnolen18:11:36

(extend-type default …)

dnolen18:11:46

(extend-protcol IProtocol default …)

isaac18:11:52

Is that contains nil?

dnolen18:11:56

@isaac: it captures all cases yes

isaac18:11:24

@dnolen: I see, thanks

kevink18:11:53

does figwheel also auto-load css generated by garden?

shaun-mahood19:11:35

@kevink: Yes, you just have to point to your css-dir using the :css-dirs key in your figwheel options, and then make sure garden is running and it should all work.

kevink19:11:54

@shaun-mahood: ah, thanks. it took me a while to figure out that i had :css-dirs under the cljsbuild figwheel config instead of at the root of project.clj.

bplatz19:11:36

Is there a function to get a list of components that will re-render with a given query? i.e. which components will re-render based on :a-query in: (om/transact! '[(foo {} [:a-query])]

dnolen19:11:16

@bplatz: you’re in the #C03S1L9DN channel 😉

bplatz19:11:31

Oops, sorry.

dtsao20:11:10

Hi everyone! I wanted to show off a clojure/script data viz library I've been working on lately. It's an early release, so feedback is appreciated. https://github.com/dvdt/gyptis

martinklepsch22:11:14

Lots of contributions to CLJSJS are currently queued up and I feel like I’m increasingly becoming the bottleneck. While there are some other awesome people like @crisptrutski and @juhoteperi often helping with merging PRs it’s probably a good idea to try increase the number of people keeping an eye on PRs and issues. I wrote up a couple of things how you can help here (https://github.com/cljsjs/packages/blob/master/CONTRIBUTING.md) and just created #C0E66E1H7 to answer questions around becoming a maintainer. Please join in there if you’re interested in helping this community effort simple_smile

bensu22:11:49

@dtsao: looks very cool! If I find time, I'll give it a spin

arohner22:11:36

I’m looking into using lein doo to test multiple browsers, but there doesn’t seem to be a way to specify the HTML that’s used. Is that correct?

bensu23:11:45

hi @arohner! it is correct

bensu23:11:54

what do you need to specify?