Fork me on GitHub
#clojure-sg
<
2017-04-19
>
sniperliuhao01:04:22

I have uploaded the devcards demo codes to https://github.com/sniperliu/devcards-sg

lucasbradstreet02:04:25

the discoverability is a bit better on clojurians. What we’ve been doing from #onyx is linking to the scraped logs in our title

spinningarrow04:04:36

@lucasbradstreet nice, didn't know about the scraped logs! thanks for adding that in 🙂

spinningarrow04:04:47

Are you still around in Singapore?

lucasbradstreet04:04:25

Still in Seattle

spinningarrow04:04:40

any plans of returning?

lucasbradstreet04:04:24

Depends on how the startup goes 😎

renewdoit08:04:11

just switched from rum back to re-frame for our gaming project

spinningarrow08:04:44

what was the reason for the switch (both to and from)? I've tried a bit of re-frame but not rum

sniperliuhao08:04:19

re-frame provide a lot best practice like effects/coeffects for us and save our effort.

sniperliuhao08:04:51

since rum is just a component lib

spinningarrow08:04:31

Is Rum is more comparable to reagent then?

andrut08:04:56

I haven’t tried any of those yet but whenever I look at it it seems like it’s all full of state… contrary to what I like about Clojure what am I missing? 🙂

sniperliuhao08:04:57

yes, re-frame is bound with reagent

sniperliuhao08:04:22

real world have state every where, just how you manage it. even clojure is not pure.

andrut08:04:42

I meant in the example projects I could always see state all over the place whereas in the Clojure projects you can encapsulate it in one safe place and (almost) never touch it

andrut08:04:03

(that’s an exaggeration but a useful one)

spinningarrow09:04:57

Yeah I noticed that in reagent as well

renewdoit14:04:58

My ideas on reagent/rum/re-frame: reagent and rum are wrapper library for react, so they are more comparable. Re-frame is based on reagent for writing your SAP in the way it recommends, the counterpart of it on rum is scrum.

renewdoit14:04:31

Rum vs Reagent: Rum is a thinner wrapper than reagent, it can using "mixins" to mix states into components, it does not have opinion on which way you want to manage states, e.g. you can choose a "static" mix-in for small, cross-project component; a "reactive" mix-in for reactive atom (ratom) based ones. It also encourage you to develop your own mix-ins to handle the lifecycle of states or other specific needs.

renewdoit14:04:49

While Reagent has more opinion on this, it's core value is "ratom", watch based atom for states.

renewdoit14:04:50

At First, I liked the flexibility that rum provides, and we wrote a few mix-ins to deal our own components (which using pixi.js undercover is a WEBGL render engine).

renewdoit14:04:41

While this is handy, but mix-ins turned out not a very functional way and "clojure" way, it more like from javascript's prototype based way. Not very easy to write real independent mix-ins.

renewdoit14:04:17

So we checked back to the initial decision, read the re-frame documents again (which is quite long, much longer than the code), realized that it may look like a framework, but actually a library composed of "best practices".

renewdoit14:04:30

The core value of re-frame is a single truth source of app: "app-db", or a monolith atom for all the states. However, it does not forbidden pure-local state, you can still use reagent's type-2 components:

renewdoit14:04:56

The initial evaluation process we did overlooked it. So it still encourages cross-project reuseable small components.

renewdoit14:04:07

As many developers noticed, a single app database is very valuable for checking, debugging and most importantly for clojure programmers, for REPL based tool to manipulating a running program.

renewdoit14:04:45

It also encourages single direction information flow, rather than using reagent's cursor (although you still can use it).

renewdoit14:04:49

So it turned out most of our problems are already thought by Mike Thompson, and he provides elegant solutions for them.

renewdoit14:04:34

I strongly recommend to read the docs of re-frame, it definitely worth reading.

andrut15:04:00

oh wow, that’s a lot of to digest, thank you @renewdoit! 🙂 🙂 🙂

andrut15:04:41

maybe you’d want to show re-frame in action during the next meetup? 🙂

spinningarrow16:04:11

Very detailed explanation, thanks @renewdoit!