Fork me on GitHub
#clojurescript
<
2016-05-20
>
mathpunk01:05:03

@bhauman: I’m finding that the hello_seymore in your Quick Start fails, but the flappy-bird-demo seems to work still.

mathpunk01:05:39

for what that’s worth — I saw the configuration blog post and it looks like all kinds of changes are happening

lewix01:05:46

@dnolen: the type of error I was talking about https://www.refheap.com/119314

bhauman02:05:07

@lewix: yeah that an improper reporting and handling of exceptions on my part. By any chance did you name your project the same as an included library (re-frame, reagent, figwheel)?

bhauman02:05:54

@mathpunk: I'm going to look into it.

lewix02:05:14

@bhauman: not as far as I know. It's a brand new project with very little changes; I'll just start from scratch - it will be faster than debugging and I might see what I did wrong in the process

bhauman02:05:25

@lewix: there may be a bug in the latest release, several folks reporting similar errors, maybe use the previous release. 0.5.3

lewix02:05:03

@bhauman: : I was using 0.5.3 , we are not expected to run lein figwheel before making any chances, are we?

bhagany02:05:21

ah, it's been a while

bhagany02:05:29

^^@bhauman

bhagany02:05:01

hahahahaha, no worries, I understand why it happens

lewix02:05:36

@bhauman: I started an app from scratch; this time around I fired lein figwheel from the get-go before making any changes then I spotted the error. It was a simple bracket mismatch while loading libs. I guess we should always run lein figwheel before making any chances preferably- @davidnolen this is a typical example of the kind of error I was referring to

dnolen03:05:07

@lewix right, it’s important to call out cases like so the experience improves for everyone

mfikes03:05:19

@dnolen: By the way, if you want to establish a Socket REPL from Cursive, you can fairly easily with a tiny amount of socket code. I packaged it up: https://github.com/mfikes/tubular

dnolen03:05:17

@mfikes: thanks! I’ll give that a shot tomorrow

shakthimaan04:05:22

Hello! Can anyone help me in using net.Socket() in ClojureScript? My query is at https://groups.google.com/forum/#!topic/clojurescript/Nj_16TS2uJ0 (new to ClojureScript).

shakthimaan10:05:20

#1 What can cause a "TypeError: goog.global.setTimeout is not a function" when building with boot? #2 Can anyone share their Emacs configuration for using cider-jack-in-clojurescript with a REPL?

bhauman11:05:24

@lewix: you spotted a regression in Figwheel where an initial compiler exception doesn't get reported and then everything just crashes, Thanks for the report.

bhauman11:05:19

oh you are using boot

shakthimaan11:05:30

@bhauman: Thanks. I listened to your talk on Figwheel and it was excellent! Are there real-world examples of using ClojureScript for Node.js applications, or the general recommendation is to use Clojure for the backend and ClojureScript for the front-end?

bhauman11:05:42

@shakthimaan: glad you like the talk 🙂 Yes the general recommendation is to use Clojure for the backend.

bhauman12:05:26

its a really good recommendation

shakthimaan12:05:41

@bhauman: I am stuck with this issue - https://github.com/stepugnetti/core.async-issue, trying different .clj setups to get ClojureScript to compile to main.js to run on Node.js. Thanks for your quick reply!

bhauman12:05:42

@shakthimaan: Can't really help you with that this morning, other fish to fry. But I would start out with very simple code if you are just starting to use a new toolchain. Hello world, etc.

bhauman12:05:56

@shakthimaan: don't use advanced compile for node for now

lewix12:05:26

bhauman: no problem.

bhauman12:05:46

@lewix: can you give me a snippet of the bad syntax that caused the error?

lewix12:05:08

bhauman:

(:require [reagent.core :as reagent :refer [atom]
          [re-frame.core :refer [subscribe dispatch]]]))
`

bhauman12:05:50

@lewix: gotcha, reader error

bhauman12:05:03

@lewix: in the meantime if you get an error like this run lein cljsbuild once [[your-build-id]] the errors will get reported

bhauman12:05:01

and I'm fixing this right now

lewix12:05:02

bhauman: awesome. Thanks

jimmy15:05:03

hi guys in sablono how can I display unicode character like this one &times;. thanks

jimmy15:05:46

hmm, it seems the best way to copy the "icon value" directly or use stuffs like react suggests https://facebook.github.io/react/docs/jsx-gotchas.html

anmonteiro15:05:30

@nxqd: goog.string/unescapeEntities should work

jimmy16:05:54

@anmonteiro: thanks, nice one 🙂

dnolen17:05:37

@mfikes: can confirm that tubular does work - I have Figwheel running on a remote server and I can connect to it no problem in Cursive. Thanks!

mfikes17:05:43

@dnolen: Sweet! I’m surprised at how little code it took to cobble together that functionality. 🙂

dnolen17:05:34

@mfikes: so I realized you can get a really good remote web dev workflow when you need it just by more less copying what was done for Ambly

dnolen17:05:10

just run Figwheel remotely, wrap the REPL in clojure.core.server, lsyncd your source directory to the remote machine

mfikes17:05:46

Ahh… wow. Wait… my mind is bending to understand this one. 🙂

dnolen17:05:10

so now staging dev for me is more less identical to local dev

richiardiandrea17:05:18

oh that's cool stuff @fenton this might interest you

dnolen17:05:23

except you can have multiple users connecting to Figwheel

dnolen17:05:36

or whatever

mfikes17:05:14

Oh… wow! So, you have Figwheel’s REPL exposed via Socket REPL, and you are connected to it using Cursive.

dnolen17:05:59

for sensible staging development this rocks

richiardiandrea17:05:03

nice, that's what my friend @fenton was trying to achieve, (I am trying to summon him :))

dnolen17:05:15

@richiardiandrea: yes we chatted a bit about it

mfikes17:05:21

Is staging, say, a Linux box, while you are on OS X?

dnolen17:05:38

wherever staging is for you

dnolen17:05:56

any remote machine that is running the web application

mfikes17:05:21

Ahh… yep. That makes sense. Very useful. Socket REPL enables that. 🙂

dnolen17:05:43

the multisession thing is really cool for pairing I think

dnolen17:05:55

some Cognitects had something similar

dnolen17:05:00

design and coding at the same time

dnolen17:05:31

using Figwheel, instead of lsyncd they were using middleman, but for my purposes lsyncd is good enough

mfikes17:05:15

Yes. 🙂 I only recently fixed “isolating” *1, etc. in Planck’s Socket REPL support, once I understood things a little better. (In ClojureScript I had to build “context switching” of those vars, where in Clojure it can get it for free with the thread-local aspect of dynamic vars.) 🙂

richiardiandrea17:05:21

very cool tool this lsyncd

richiardiandrea17:05:53

in http://clojurescript.io we wanted to use websockets for syncing between users

mfikes17:05:18

So, Socket REPL can replace tmux for certain aspects of remote pairing.

richiardiandrea17:05:25

like a realtime multi-player game, will see if it will land on it or not

richiardiandrea17:05:42

I think the sync is done by lsyncd

richiardiandrea17:05:11

socket repl is only for transportation of the commands (if I understood correctly)

mathpunk17:05:21

@bhauman I verified that the Quick Start works fine with 0.5.3 figwheel and most recent clj/cljs versions

bhauman17:05:04

Cool thanks for that.

tel19:05:29

Is there a way to have figwheel start off with multiple autobuilds on by default?

tel19:05:57

outside of setting up the whole autobuilder manually, I suppose

darwin19:05:11

@tel: I tend to spawn multiple commands in independent terminal sessions

tel19:05:31

that might be a good UX

darwin19:05:08

it is terrible UX 🙂 I have to use lein-cooper to join those sessions back into one terminal tab, but that is pretty advanced setup

tel19:05:19

it might be okay because it just emphasizes that there’s something to forget when you don’t start up the (in this case) devcards builder

tel19:05:43

interesting

darwin19:05:11

I have all outputs indented in one tab, with timestamps, and color-coded names

bhauman19:05:34

@tel: you want to have multiple builds start with out having to supply the builds on the command line?

bhauman19:05:26

@tel: there is little documented :builds-to-start configuration key

tel19:05:42

that’s perfect

tel19:05:51

I’d like figwheel to always load both the normal app and the devcards app

tel19:05:00

so yeah, perfect 🙂

tel19:05:13

that’s in the server-side figwheel config?

bhauman19:05:40

yep 🙂 just give it a vector of build-ids

bhauman19:05:09

that being said, I don't know if I have ever used the feature, so it may not work 🙂

tel19:05:31

:figwheel
             {:builds-to-start ["dev" "devcards"]}

tel19:05:35

ha, alright

tel19:05:28

hm, well then no I’m not sure that it does work haha

tel19:05:30

let me keep testing

tel19:05:51

oh, actually I think this is being caused by another thing

tel19:05:55

not clear yet

bhauman20:05:21

if it doesn't work now it will in an upcoming release because I just refactored the heck out of that code path

tel20:05:34

cool 🙂

tel20:05:53

speaking of that other error, I’m not entirely sure of the source, but I was getting double import errors around react-dom-server with devcards. I just pulled it out as an exclusion and imported it myself to resolve the whole thing, but it was a little weird 😕

tel20:05:05

simple enough fix anyway, though 🙂

tel20:05:16

actually, I guess I’m not so sure if I’ve fixed it

tel20:05:34

May 20, 2016 4:13:47 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: file:/Users/tel/.m2/repository/cljsjs/react-dom-server/15.0.2-0/react-dom-server-15.0.2-0.jar!/cljsjs/react-dom-server/common/react-dom-server.ext.js:13: ERROR - constant ReactDOMServer assigned a value more than once.
Original definition at file:/Users/tel/.m2/repository/cljsjs/react-dom/0.14.3-0/react-dom-0.14.3-0.jar!/cljsjs/react-dom/common/react-dom.ext.js:85
var ReactDOMServer = {};
^

bhauman20:05:40

@tel: Take notice, there are different versions of react in there.

tel20:05:13

yeah, it’s still happening even when I fix that, though 😕

tel20:05:45

I’ve got dev and production builds each one both an application and a devcards application

tel20:05:52

adv compilation on the prod pair, figwheel on the dev

tel20:05:22

the dev ones appear to work well, lein figwheel works, but uberjarring fails

bhauman20:05:34

@lewix: @mathpunk I have pushed a new release which should improve the experience considerably

darwin20:05:59

my core.async-generated code is failing under :advanced mode, works in dev mode and quite surprisingly works using :advanced mode with :pseudo-names, already spent few hours on interleaving my code with log statements, but without much success, this is no fun, any ideas?

jr20:05:48

which version of core.async?

darwin20:05:17

“0.2.374”

darwin20:05:59

my guess is, that it could be try-catch related

darwin20:05:17

now I’m in the process of breaking my go blocks into smaller pieces

darwin21:05:51

I have identified the problem. I believe. I was calling function in a different javascript context which was returning a core.async channel back. Background info: both javascript contexts are using cljs and core.async, but they are compiled as independent cljsbuild projects. That is why this worked under dev mode and even with pseudo names - crossing context boundary preserves naming. But under full :advanced build it suddenly breaks, in my case somewhere deep in minified core.async code.

mfikes21:05:50

@darwin Ahh, so they were being minified independently?

mfikes21:05:37

(I have no experience with using multiple contexts… interesting.)

darwin21:05:44

yes, my situation is pretty complex (in Dirac), I have multiple separate cljsbuild projects for various reasons

darwin21:05:11

I just have to be careful when crossing the boundary and serialize stuff or escape into pure js land

mfikes21:05:03

Perhaps a well-placed ^:export can save it.

mfikes21:05:30

(Assuming ClojureScript is calling ClojureScript.)

darwin21:05:31

@mfikes: no, this would not help, the problem was in minification layout of internal core.async structs

mfikes21:05:39

Ahh… OK.

mfikes21:05:57

Wow, that musth have been difficult to diagnose. Yikes.

darwin21:05:58

two independent builds will end up with different minification for the same code

darwin21:05:29

maybe some idea for improvement: :pseudo-names should have some random name prefix for each independent build

darwin21:05:47

this would help me to diagnose it quicker, because it was really puzzling

mfikes21:05:07

Yes… you reach for :pseuso-names and it fails you in this situation.

darwin21:05:14

that would hint that the object on the receiving side of boundary is “strange"

pat21:05:09

@shakthimaan i think the go macro needs the log statement to be inside the let where you are using <!

hoppy22:05:39

we have a situation where lein start-dev is not picking up a particular javascript ball (missing in the final content). Funny thing is, it works on machines that don't have a current java version (older works, newer don't). Anybody familiar with this specter

hoppy22:05:59

1.8.0_91 broke, minor _77 works