Fork me on GitHub
#clojurescript
<
2015-11-26
>
dreic07:11:13

is this here read by the same people as on #C03S1L9DN on freenode? Do I crosspost?

johanatan07:11:25

No, it isn't. But if you would add your support by requesting the admins install an Slack <-> IRC bridge, it could easily be the case.

dreic07:11:23

ok, thanks. I'll just add it here too for now.

dreic07:11:23

I'm evaluating clojurescript for a new project. A Ruby Sinatra app has to be converted into a Windows-compatible app - I'm thinking about E lectron. I think most of the problems can be solved this way, for the app it doesn't matter whether it's server or client based. I checked out clojurescript because it offers some nice advantages over js. However, what am I going to do with the required mysql connecti vity? It's an app that basically outputs data from a huge DB. I didn't see any mysql specific libraries. Are plain clojure libraries also working? Am I going to use JS libraries?

johanatan07:11:47

So you're running on node.js? Probably yes JS libs are your best bet.

dreic07:11:21

Electron would be node, yes.

johanatan07:11:52

Yea, I think there's not a ton of people connecting to old-world databases from ClojureScript.

dreic07:11:02

Is there anything special I'd need to do in order to use JS-libs in ClojureScript?

johanatan07:11:23

Nope, you just need to use js->clj and clj->js at the boundaries (as appropriate).

dreic07:11:21

Actually I don't really worry about the DB connection. I'm usually pulling everything and then walk through the data as necessary. Probably some JSON chunks would do.

dvcrn08:11:23

I am currently working on a little editor and want to give users the chance to edit a simple config file in their home dir. Currently I have it in EDN and just use cljs.reader/read-string to parse that back into cljs. Now I would really like to give the user the possibility to define a custom function and link it to a keybinding. Like cmd+x executes function #(println "foobar"). Maybe on execution pass some environment stuff into that function to make it even more powerful

dvcrn08:11:47

Is it possible to do something like this? Can I let the user define a normal cljs file and evaluate that on the spot?

xificurC09:11:01

can someone tell me or point me to an article that describes why should the big atom be a good idea?

dm309:11:15

can't point to an article, but what are your concerns against the big atom?

thheller09:11:45

@dvcrn: if you want on-demand compilation you either need a jvm or the self-host stuff. but it is going to be really hard to do partial compilation (only the files from the user) since the cljs compiler relies on analysis information pretty heavily. so you'd need the source of everything that is possible referred to by the user code

dvcrn09:11:13

@thheller: I guess there is no way to serialise a function into a EDN-ish version and load it back into cljs?

thheller09:11:05

well .. except for # a function is just a list of other edn literals

thheller09:11:15

so you can put it there, but not eval it

thheller09:11:21

since you need to compile it to js first

thheller09:11:32

for eval you need cljs.js

dvcrn09:11:41

can't a compiled cljs/reader eval cljs into js again?

thheller09:11:24

at the very least you always need the source of cljs.core

thheller09:11:36

although honestly I have no idea how self-host works at all

thheller09:11:44

so you should probably check that out first

dvcrn09:11:04

maybe I'll drop EDN and go with a pure javascript object + js functions instead. I could probably load that back and eval it

dvcrn09:11:30

(for the config part. The rest is still cljs)

xificurC09:11:38

dm3: I just don't see the benefits. Someone must have made it because of something

xificurC10:11:13

I'm sure there is a reason behind it and I wanted to hear it

xificurC10:11:45

and design decisions usually come with benefits and downsides

thheller10:11:54

@xifi the most obvious answer: all your state is one place. @app-state and see what the app state is at any time.

thheller10:11:22

no need to look at place-a, place-b, place-c, wherever to get a picture of what is going on

thheller10:11:24

just one place

thheller10:11:00

only care about one place? (get @app-state :that-place)

xificurC10:11:38

@thheller: we don't do this anywhere else though, do we

xificurC10:11:05

@thheller: if you were to write a different piece of software, would you crunch all your data into one big atom?

dm310:11:07

you do this if you use something like redis, no?

dm310:11:21

or other database

dm310:11:29

although it's not so direct

xificurC10:11:44

never used redis so can't tell

thheller10:11:49

there are plenty of places you do this

thheller10:11:52

think of the big atom as an in-memory K/V store

thheller10:11:05

or any other database really like @dm3 suggested

thheller10:11:30

something that keeps data for you that you access via an API

xificurC10:11:42

OK, let's say I get that. What is the reason to copy this idea into web apps instead of doing it the old fashioned way?

thheller10:11:32

again, one place

thheller10:11:12

you generally only have one database with many tables, not a database per table if you think SQL

xificurC10:11:25

in your analogy wouldn't the namespace be the database and the variables the tables?

thheller10:11:58

that would be global state, there are plenty of good examples why global state is bad

thheller10:11:36

granted in most cases the big atom will be a global, but only one

thheller10:11:46

I'm not totally sold on the idea of having everything in one place either

thheller10:11:52

but for data is makes a lot of sense

thheller10:11:11

but something just isn't just data (eg. websockets connections) not quite sure where to put those

marvotron10:11:01

wouldn't you put what comes out of the socket in the same place

marvotron10:11:08

as that is the data

thheller10:11:20

yes but the socket connection is not serializable

thheller10:11:28

plus it is mutable

marvotron10:11:19

im not sure i understand, in my mind the socket is just another transport

thheller10:11:50

yeah but you don't put XHR requests into the big atom either

marvotron10:11:46

so all that stuff, transport mechanisms goes somewhere else simple_smile

marvotron10:11:57

where that is depends on the system i guess

marvotron10:11:30

the big atom is data, the machinery behind it is a system

marvotron10:11:09

and i apologise in advance if im being generic or just wrong, im new to the clojure(script) game

thheller10:11:29

exactly, just haven't seen a good example of how to combine those two yet

marvotron10:11:52

i thought that was part of om / om-next?

thheller10:11:06

dunno only saw cheating so far

marvotron10:11:24

om-next has a 'reconciler' where you define how to get the data

marvotron10:11:00

so that groups together the various ways of accessing other data. waves hands over there

thheller10:11:09

if you scroll way down

thheller10:11:25

send-chan and (search-loop send-chan) are basically globals

thheller10:11:30

without any management at all

thheller10:11:39

it doesn't handle initialization of anything at all

thheller10:11:50

you cannot simply mount/unmount this component

thheller10:11:04

granted it is out of scope for a simple example

marvotron10:11:16

interesting question though

marvotron10:11:25

im very interested in the answers simple_smile

thheller10:11:37

but you cannot modify the reconciler after it was created (AFAICT)

thheller10:11:14

you can use the react lifecycle stuff I guess

thheller10:11:27

well, that is what I do

thheller10:11:13

but combining the system with the app-state atom is not quite easy

mccraigmccraig10:11:01

@xifi: one nice feature of the big atom is that you can schema-check the big-atom and be assured that your app never evolves into an inconsistent state, and that you get an error when your buggy code attempts to create an inconsistent state

mccraigmccraig10:11:09

(and re-frames handler middleware makes schema-checking like this particularly easy to do)

emil0r10:11:57

is it possible to send in a global variable into the js environment from cljsbuild that is available as the script starts? thinking dev-mode? variable kind of thing

thheller10:11:21

@emil0r: not sure I understand the question, why would cljsbuild create a variable?

thheller10:11:51

ah you want to test whether you are in dev mode or not?

emil0r10:11:44

but to control it from outside the cljs code that is run in the browser

thheller10:11:56

I'd recommend using a goog-define

thheller10:11:35

you really don't want anything from the outside to control the code

thheller10:11:47

since that only makes :advanced stuff harder

thheller10:11:13

goog-define is a good compromise

darwin12:11:01

I’m in a need of injecting compile-time configuration into my cljs project (some clojure code which runs before all my macro code) I’m using leiningen which has :injections config option, but that didn’t work for me (it works only when executing test profile, not when doing cljs-build compilation tasks). I ended up creating config.clj[1] which gets on class path only in release mode and I try to include it as early as possible from my entry-point namespace file [2] [1] https://github.com/binaryage/chromex-sample/blob/master/src/release/chromex_sample/config.clj [2] https://github.com/binaryage/chromex-sample/blob/master/src/popup/chromex_sample/popup.cljs#L2 It works for now, but it is inherently fragile I guess. I depend on order of requires to be config-first, core-second. Which does not have to be always guaranteed I believe. Any ideas how to solve this properly? Thanks.

darwin12:11:30

This release config is included only in release builds, like this: https://github.com/binaryage/chromex-sample/blob/master/project.clj#L85

darwin12:11:15

In the library project I have used :injections successfully: https://github.com/binaryage/chromex/blob/master/project.clj#L40, but that really works only when executing “lein test”, unfortunately due to some magic handling test task differently

martinklepsch12:11:13

Chatted with a friend yesterday who’s working on some React app. Hot Reloading, webpack, etc. Startup time for development: 1minute. Babel and friends make JS come close to CLJS startup speed. simple_smile

dnolen13:11:40

@marvotron: the issue is at the root of your application, who knows how you want to set it up? Om Next just doesn’t care. You may have multiple reconcilers, you may want to use something Stuart Sierra component-like to establish starting and stopping your system, etc. The point is not to get involved and not get in the way.

dnolen13:11:12

for that specific remote example, there’s actually no reason for those things to be top level, but it’s kind of besides the point for that tutorial

darwin13:11:16

nevermind ^^, I just discovered lein-environ, it looks promising

marvotron13:11:39

@dnolen : i see, thanks. I started to get that impression as I read more, the idea of pushing that stuff 'to the edge'.

dnolen13:11:58

@xifi: “we don’t do this anywhere else”, this isn’t true. The big atom idea is not really a new thing - a pretty old idea in the functional world, of course databases, and weirder languages like Prolog.

dnolen13:11:43

the advantage is simply not having to spend as much time trying to figure out who changed what - narrowing the scope of consideration has huge implications for our ability to reason about the behavior of a given program.

marvotron13:11:09

so to take one of my current cases for our js based SPA, when the app loads we need to do a series of remote requests to different endpoints each requires data from the previous endpoint AND some of that data is exposed in the UI

marvotron13:11:41

what would be the strategy with om-next ? where do i read / look to find out ?

marvotron13:11:30

because this would be the main technical selling point for our team, at the moment its a complicated chain of rx and promises

dnolen13:11:51

@marvotron: so you won't be able to get rid of that if the network part looks that way

dnolen13:11:03

however you can isolate the mess inside of send

dnolen13:11:29

Om Next doesn’t require any fancy backend thing at all, if you want to overlay a sensible way to query multiple REST endpoints you can do that

marvotron13:11:16

ok, i think at this point i need to start building and trying stuff. thanks for the answers, much appreciated

xificurC13:11:25

@dnolen: databases - ok that's fair. Functional world - what would be an example? But this is still missing the point for me, i.e. the answer isn't deep enough. E.g. if you want to replicate what databases do - why? What was the initial problem that led you to use this technique

dnolen13:11:08

@xifi I already explained the deep answer

dnolen13:11:17

simple answers are deep

dnolen13:11:23

it's exactly the reason you use a database instead of writing to random locations on disk

xificurC13:11:57

@dnolen: ah, I missed that post! And do you find that true for huge applications as well?

dnolen13:11:20

I don’t know of any huge applications that don’t use databases

xificurC13:11:29

is it web-scale? 😛

xificurC13:11:48

@dnolen: databases yes, this isn't exactly the same though is it

dnolen13:11:53

you seem to think so, I do not

dnolen13:11:18

I work on a pretty significant highly concurrent immutable database at Cognitect - Datomic

dnolen13:11:34

it’s a very large codebase - internally it uses … one atom

xificurC13:11:22

well it's not that I don't believe that, I just thought if the use-case or logic behind is the same, that's how it would be advertised. I never heard anyone say It's like a client-side database. I do believe you though, you're the coder, I'm just another noone

xificurC13:11:49

thanks for the explanation

dnolen13:11:09

@xifi no I’m just pointing you believe something, but you haven’t explained to me why you think they should be different things simple_smile

dnolen13:11:27

I have experience doing things both ways and have different conclusions

dnolen13:11:17

@xifi this is all to say I can’t prove that it's any better or the “right” way simple_smile Just that it seemed sensible to try a good engineering practice from elsewhere, and it seems to me to lead to better systems. This is all anecdotal! But it seems to be growing in terms of other people verifying these personal conclusions (thus the number of Clojure(Script) users coming from elsewhere)

xificurC14:11:08

@dnolen: I can't prove anything as I don't have experience. I'm asking around in multiple places/frameworks/languages and trying to make sense of it all

marvotron14:11:36

well, im here for exactly this reason

xificurC14:11:38

I like to know to what am I commiting before doing so

marvotron14:11:14

we have some large SPAs in JS (angular based) and they reached the point where trying to mentally reason about the app state and how it changes was practically impossible

dnolen14:11:22

@xifi sure but sometimes someone says it’s a good idea and you try it. Not everything can be resolved to logic. That’s definitely the case with software or we’d still be writing Assembly.

marvotron14:11:20

so we're on an involved process of scooping out all the state and putting it into a baobab based system, BUT on a longer term we want a solution thats built this way from the ground up

xificurC14:11:54

@dnolen: sure, not everything can, but the more info the better, me thinks

dnolen14:11:13

but sometimes collecting information is a long winded road

xificurC14:11:33

and if I can ask someone like you who has a lot of experience

dnolen14:11:39

I like to recount when I discovered Clojure didn’t have mutable locals and almost passed it over

xificurC14:11:32

@dnolen: how would the world look like now have you done that!

xificurC14:11:11

or had? I never know

dnolen14:11:11

@xifi I really did think Clojure was the worst language I’d ever seen there for a second

dnolen14:11:39

@xifi also a lot of these conclusions about client side development didn’t happen overnight - rather a long winded series of experiments

xificurC14:11:46

@dnolen: well then I can't trust your judgement! simple_smile

dnolen14:11:06

@xifi for what it’s worth some JS people have picked up on the single atom idea - Redux & Relay so it’s worth looking at what they say for an alternative take on the rationale

xificurC14:11:26

@dnolen: well yes I can imagine. That's why I value your opinion. I don't have much experience in this topic so I like to collect information before jumping into something. You always learn stuff when you do stuff but if one can save some time by making some smart decisions early on it's always a win

xificurC14:11:56

@dnolen: I saw Elm using it too

xificurC14:11:40

even mentioning Om (and you) a couple of times

kauko14:11:40

I’m curious what people think of cycle.js. I think it has some interesting ideas.

kauko15:11:07

I’ve been thinking about it a lot lately. How exactly is it different from, for example, re-frame and Om

dnolen15:11:52

@kauko the big picture really isn’t that different

kauko15:11:54

one thing is that in cycle, views, models and intents never have side effects, only return values. This is not true with re-frame

kauko15:11:25

Actually that is the reason why I think it is so interesting

kauko15:11:03

Sometimes it’s difficult to really understand what the differences are, and how they affect you

dnolen15:11:03

I would say that Om Next no longer really compares well to anything except Relay

dnolen15:11:27

it’s more like a JS MVC framework in that it is a complete solution - modeling, remoting are all part of the design

jaredly15:11:12

Does anyone have a working setup for core.typed + clojurescript?

dnolen15:11:22

@jaredly: core.typed does not work with ClojureScript, support was more or less dropped more than a year ago

dnolen15:11:31

mostly due to lack of time

dnolen15:11:03

or rather Ambrose not having enough time and no one helping out with that part

jaredly16:11:44

ok. I've really come to value having flow in js-land. do you know how much work would be involved in reviving cljs support?

dnolen16:11:34

@jaredly: no idea talk to Ambrose, you have mailing lists and IRC channels for core.typed

dnolen16:11:49

there might be a slack channel too

malch16:11:31

#C051QCQUF

dnolen16:11:26

@jaredly: the alternative for ClojureScript is Google Closure type annotations

dnolen16:11:35

there’s experimental support for that in master

jaredly16:11:58

ooh interesting

dnolen16:11:04

the big limitation there is there’s no good support for typing maps

dnolen16:11:35

but it does support generics, nullability stuff like that

eggsyntax16:11:20

I've had a couple of requests to create a library from a project of mine. Does cljs library deployment differ from clj library deployment as described at https://github.com/clojars/clojars-web/wiki/tutorial ? If so, can anyone point me to current documentation on cljs library deployment? I've been doing some googling but haven't come up with anything that seemed definitive. Thanks!

thheller16:11:09

pretty much the same as clojure yes

eggsyntax16:11:10

Also, is there a good, up-to-date cljs lein template out there for creating a lib?

thheller16:11:49

only difference is if you want to bundle foreign libs

thheller16:11:07

but if it is just cljs it is identical to clojure

eggsyntax16:11:39

OK, cool. And I bundle libs in one of the ways described at https://github.com/clojure/clojurescript/wiki/Dependencies ?

eggsyntax16:11:43

Or I'm guessing the most useful thing all around would be to package the JS lib itself into a CLJSJS package (as per https://github.com/cljsjs/packages/wiki/Creating-Packages ) and then just include it in my cljs lib. But I'm new to all of this (packaging for cljsjs, deploying a clj/s lib, etc) so I'm just feeling it all out still.

settinghead17:11:58

just curious: how much work would it be to enable cljs to compile macros? if it's a lot, what are the major obstacles?

mfikes17:11:37

@settinghead: Bootstrapped / self-hosted ClojureScript does support compiling macros.

settinghead17:11:52

@mfikes: i don't seem to get it to work correctly. for example, if i were to eval this code:

(defmacro unless [pred a b]
  `(if (not ~pred) ~a ~b))

(unless true (js/alert "falsy") (js/alert "actually true"))
i get both conditions to run and end up having 2 alart boxes

mfikes17:11:41

ClojureScript macros must be defined in a separate namespace from the one they are called in and referred via the normal :require-macros mechanism.

settinghead17:11:17

ah i see. i'll look into it. thanks

mfikes17:11:16

@settinghead: If you are curious, you can muck about in the deep end, messing with unsupported stuff (this aids a bit in understanding the machinery): http://blog.fikesfarm.com/posts/2015-09-07-messing-with-macros-at-the-repl.html

mfikes17:11:06

@settinghead: But, to do things the way they were meant to be done, just put them in their own ns. A small example is in this post: http://blog.fikesfarm.com/posts/2015-06-19-portable-macro-musing.html

settinghead17:11:55

i'll take a look at the articles

mfikes17:11:23

(That post’s scope is broader than what you want, but it illustrates the idea.)

mfikes18:11:56

@eggsyntax: interestingly the wiki does not discuss deps.js

eggsyntax18:11:07

@mfikes: which wiki do you mean (I linked to three)? I see the cljs one at least mentions deps.js in passing...

eggsyntax18:11:16

It's mentioned briefly, in the CLJSJS section. But more info probably wouldn't hurt...or maybe a direct link to https://github.com/cljsjs/packages/wiki/Creating-Packages ?

mfikes18:11:31

My only guess is that lein generates it for you. Otherwise the ClojureScript Wiki may need more elaboration. If you figure it out, I'd update it.

eggsyntax18:11:55

Sounds good, I'll keep some notes.

thheller18:11:08

deps.cljs is generally written by hand

mfikes18:11:23

I've manually put together a deps.js simply to specify externs (Goby calling into Objective C), but I don't have experience producing a lib that includes JS

thheller18:11:45

the boot stuff has something to generate it

juhoteperi18:11:54

@eggsyntax: What are you trying to package? Cljs lib or JS lib?

thheller18:11:54

based on some file structure

mfikes18:11:00

@thheller: ahh. Cool. The wiki should say that IMHO :)

juhoteperi18:11:40

CLJSJS wiki mentitions deps.cljs being generated by Boot task

mfikes18:11:34

Yeah, there is a ClojureScript wiki that describes how to make a lib that bundles JS but it lacks deps.js description.

eggsyntax18:11:56

@juhoteperi: ultimately I'm trying to package a cljs wrapper that I wrote for the MathBox JS lib. But I'm guessing that I could increase the overall value of it by first packaging the JS lib directly & sticking it on CLJSJS, and then referencing that in the lib containing my wrapper. Does that sound sensible?

richiardiandrea18:11:08

I second using cljsjs is awesome 😄

juhoteperi18:11:55

@eggsyntax: Sounds good. Though it's also possible to package the JS lib separately and deploy it to Clojars yourself, users don't see a difference.

juhoteperi18:11:28

But hopefully Cljsjs helps with packaging.

eggsyntax18:11:30

Ah, OK, I didn't realize Clojars had straight-JS packages

juhoteperi18:11:36

There is nothing special about Cljsjs packages, they are just normal Jars in Clojars.

richiardiandrea18:11:52

is there a lein plugin to deploy to (s)ftp? I am lazy 😄

richiardiandrea18:11:37

I am open to new suggestions 😄

richiardiandrea18:11:59

but we are deploying a website in the 90s 😄

martinklepsch18:11:27

@richiardiandrea: I guess that site needs to run some of your deployed files though?

richiardiandrea18:11:50

well it is generated with lein cljsbuild then I was trying to find a lazy way to deploy ...s3 looks like a good options, there is a plugin I see

richiardiandrea19:11:01

never configured cloudfront...but I guess I can find plenty of tutorials

richiardiandrea19:11:35

just for fun 😄

martinklepsch19:11:57

@richiardiandrea: I’m working on a little thing to make s3/cloudfront setup as easy as possible. ping me if you want to give it a spin

dreic19:11:27

hi @martinklepsch, the ruby guy here.

mudphone21:11:15

Are folks still using enfocus for dom manipulation and events?

jaen21:11:12

I don't think that's React-compatible, so probably not a lot of people

mudphone21:11:38

@jaen: thanks, yeah, I was thinking for things outside of react

eyelidlessness21:11:59

is core.typed well supported in cljs? is there a quickstart for how to use it in a cljs project?

pshk4r21:11:52

Is it possible to use a whole lib written for React, from Reagent?

jaen21:11:46

@pshk4r: if you first compile the modules away with webpack or something like that, then sure.

pshk4r22:11:26

@jaen: it is already compiled to one js file. I included it, and used reagent/adapt-react-class with that library's single component name, but it fails on finding window.React. I've just realized it's probably because of javascript require order, must check it now

jaen22:11:14

Yeah, require'ing cljsj.react before your lib should be enough.

danielcompton22:11:35

@richiardiandrea: you can use lein-shell to run arbitrary shell commands to deploy to S3 or SFTP

richiardiandrea22:11:40

thanks @danielcompton, you can even launch a .sh I saw. I will do that initially

mudphone22:11:35

@jaen: ah so, you just React-all-the-things™then?

jaen22:11:50

That seems to be the current trend, yes

mudphone22:11:30

I’ve been doing it wrong

jaen23:11:15

Well, it's not exactly wrong if it works, but yeah. That's where most support goes. If you decide to go into React then enfocus' author has a similar enlive-like library that works with React, kioo (though it's sometimes a bit verbose if you need to have a stateful component or something).

mudphone23:11:57

Oh nice, I was just getting used to Enfocus, so that’s good to know. Thank you

jaen23:11:22

No problem. I've started out with kioo (even fixed a couple of bugs) because I had a separate team of designers I had to integrate with, and that where something like enlive shines

mudphone23:11:53

because you can pull an HTML file as a resource?

jaen23:11:05

And the designers don't have a care in the world about your app

jaen23:11:42

But like I said it is a bit on the verbose side compared to if you use the hiccup-like sablono, especially when the component needs internal state or something like that.

jaen23:11:28

You have to wrap the kioo template in another function (or you could probably figure out a way to use kioo internals to avoid that, but I didn't have time to check it)

jaen23:11:00

So I would probably use kioo only if I had to integrate with designers that don't know nothing about code or templates. Otherwise I'd probably go with sablono.

mudphone23:11:50

I see, good to know, thank you

mudphone23:11:12

I assume you could start with sablano and then break into kioo when you have a template to add

jaen23:11:42

Yeah you can mix both in the project as needed

mudphone23:11:05

okay, time for a cup of coffee and then back to the docs !!!

jaen23:11:56

From the React wrappers reagent is probably nicest to start with, has also nice flux-ish library in re-frame. There's even a non-trivial sample application using both - https://github.com/madvas/fractalify/

mudphone23:11:38

Oh nice, I’ll take a look at that

johanatan23:11:01

Does anybody know the React Native or Om way to restore UI controls' values (e.g., textinput text) upon changing back to a previous screen? I tried setting 'value' but then the cursor gets moved to before the beginning of the text after each character the user actually enters in the box [as there's no way to determine if the current render cycle is due to a) changing back to the screen from another 'modal'/popup if you will or b) the user actually entering text]). I tried a workaround where I kept some side state in another atom (that isn't being observed by Om Next) to store whether a screen change was occurring or not and that worked but only for the first render cycle-- if the user did something else on the page after changing back to the screen (like say checking a checkbox), then the side state had been cleared and my logic didn't set the 'value' of the textinput to that stored in app-state. I'm now considering an alternative workaround that should work (i.e., setting the 'value' of the textinput to the text stored in my big atom on every render ​except​ those triggered by an onChange event in the actual textbox in question); however, the idea of having 'side-state' in a 'side-atom' seems to go against the Om way.

mudphone23:11:47

@jaen: I should probably learn how to walk first.. simple_smile

jaen23:11:16

@mudphone: for sure, I thought since you seem to have some experience in Clojurescript already, then having a reference application might be useful when learning how to use React.

jaen23:11:15

Also, re-frame has nice wiki pages regarding how reagent works that might come in handy if you decide to learn React with reagent - https://github.com/Day8/re-frame/wiki#reagent-tutorials

mudphone23:11:34

I’ve only done some basic Reagent tutorials so far, but have done some minor stuff with Om (not Next)

mudphone23:11:45

This is really helpful. I’m going to see if I can get my local Clojure group folks to do a group session on this.

jaen23:11:14

Local Clojure group, wow, much jealousy.

jaen23:11:50

Yeah, they guy who wrote re-frame has some quite nice insight into reagent. At the very least Creating Reagent Components is a must-read, explains differences between how you can define components in regent really well (you define components slightly differently depending on whether they are stateless, stateful or have to react to React's lifecycle events).

johanatan23:11:56

Update: my second workaround didn't work-- funky behavior on hitting backspace in the control: txt disappears completely although my code isn't touching 'value' on keypresses.

mudphone23:11:40

@jaen: Local Clojure Group == about 3-5 people simple_smile

mudphone23:11:47

Thanks will take a look at this for sure.

jaen23:11:30

That's still better than zero I have in radius of hundreds of kilometers, therefore I'm kinda envious ; d

mudphone23:11:13

I am surprised that people have smaller Clojure communities than me!

jaen23:11:29

Well, if professors at my university don't even know what functional programming is, what are the chances of having a group for a relatively new FP programming language around P ;

jaen23:11:51

So it's quite awesome you have your local group you can learn more about reagent or something with.

mudphone23:11:31

I should take this opportunity to be “thankful” … it’s the right day for it.

mudphone23:11:22

I did have a discussion with the head of our local CS department, who told me he couldn’t help me find speakers for talks on Category Theory because the subject was too “esoteric."

mudphone23:11:46

Oh, and the head of a different local CS department had never heard of Clojure… sigh...

mudphone23:11:49

I think our local economy is largely Java, .NET, and PHP-based.

jaen23:11:12

I like to troll my professors with fringe languages. I once made a report for algorithms in Haskell. The professors, when I asked him later if there were any interesting languages among the papers was all like "well, there was Python" : |

jaen23:11:35

Yeah, my university is in love with the Windows ecosystem. Sad, really.

mudphone23:11:51

They give away so much free stuff.

jaen23:11:31

Yeah, when you're a university/student you get a lot of free stuff from them. But it's one big walled garden. Hopefully that changes with .NET going open source.

mudphone23:11:39

Perhaps there might be demand for a Clojure/Script/Bridge for education.

mudphone23:11:24

Python seems to be the winner these days for science/ed.

jaen23:11:38

I'm kinda sad to see MIT's CS 6.001 go from Scheme to Python, it's like the ideal language for intro to algorithms (like C is great for intro to hardware). I'm quite interested in what Elena Machkasova is doing with making Clojure more education friendly, like Racket. Clojure errors are one of the paint points for that.