Fork me on GitHub
#clojurescript
<
2016-02-01
>
ezmiller02:02:24

hmmm. actually this use of js promises in clojurescript is turning out to be a bit more complicated (e.g. how do you chain then() calls?). how do others here interop with js libraries that make use of promises?

noisesmith03:02:45

ezmiller: you can do chaining with ->

noisesmith03:02:23

(-> usr-promise (.then ...) (.then ...) (.then ...)) each will chain off the one before it

crocket08:02:34

@mateusz-fiolka: I wrote cljs-npm leiningen template.

crocket08:02:55

If you have any problem, report issues to github.

crocket08:02:05

I realized that I could publish clojurescript npm modules to clojars instead of npm just as web browser modules are uploaded to npm.

crocket08:02:18

cljs npm modules on clojars do not incur the overhead of multiple clojurescript runtimes.

crocket08:02:48

cljs-npm template is not optimized for clojars, yet.

grav13:02:23

Anyone knows why the Google Clojure library wants to create an instance of a Html5History object? Why doesn’t it use the “singleton” from js/window?

slipset14:02:06

@dnolen: planck has this issue, https://github.com/mfikes/planck/issues/218 where it seems like the cljs-readers differs from the Clojure reader wrt sets with duplicate keys. Should issues be filed?

dnolen14:02:35

@slipset: we do not consider Planck issues

dnolen14:02:43

the right channel for this discussion is #C07UQ678E

dnolen14:02:06

only if you have determined the issue has nothing to do with Planck will anything be considered

slipset14:02:20

It has nothing to do with Planck itself

dnolen14:02:34

@slipset: move the discussion to #C07UQ678E then

slipset14:02:37

as far as I can tell.

slipset14:02:42

will do! Thanks

jetmind16:02:47

Hey there! Is there a http client library which can run on nodejs?

rm16:02:33

https://github.com/r0man/cljs-http jetmind , google gave me this

jetmind16:02:40

rm, thanks. Seems like it works only in browser, though 😞

ezmiller16:02:26

@noisesmith: thanks for the tip about the -> operator for promise chaining! that’s quite elegant actually.

dialelo16:02:32

and supports error handling

dialelo16:02:43

with promises

jetmind16:02:18

@dialelo: thanks! I'll check it out

dialelo16:02:38

you're welcome, feel free to ask any questions to me or @niwinz; we usually hang out in the #C093UFM4M channel

blissdev18:02:29

have regexps changed in recent history of clojurescript? seems a piece of code is breaking that used to be working alright

jaen18:02:09

Clojurescript shouldn't have bearing on how regexps work, it's up to your Javascript engine.

jaen18:02:36

Modulo the API to call them/get results, but I don't think it did.

blissdev18:02:54

ok, this is specifically with string/replace, probably an issue on my end, thanks

dnolen18:02:02

@blissdev: some patches did land around string/replace to make results align with Clojure so I wouldn’t be surprised if you need to tweak things

blissdev18:02:36

ah ok, thanks for the info, will check the docs

thomas21:02:07

Hi… I am sure I must be doing something wrong as I only end up with these three lines in my generated JS file:

thomas21:02:37

and no other files what so ever….

thomas21:02:01

my cljs section in profile.cljs looks the same as working projects 😞

progzilla21:02:33

pls advice me which is best for a beginner, Om or Hiccup?

lucien.knechtli21:02:36

they're completely different things - thats the same as asking whether html or javascript is better

seriousbug21:02:49

Om and React would be a better comparison

jaen21:02:03

@progzilla: Om is a React wrapper; Hiccup is a templating language.

seriousbug21:02:17

Oh I meant Reagent

progzilla21:02:35

oh i am seriously confusing both

jaen21:02:46

@progzilla: A better question would be to compare om, reagent and rum/quiscent/other smaller projects.

progzilla21:02:48

I understand now...

jaen21:02:57

I would suggest reagent if you are starting out.

jaen21:02:05

It's simpler to understand.

lucien.knechtli21:02:29

agreed - reagent is easier to undestand

jaen21:02:16

And then... hmm... I wonder, is there a good introduction to reagent?

progzilla22:02:02

This is the closest i could get on Reagent https://reagent-project.github.io/

jaen22:02:19

But I'm not sure if there's anything more streamlined than that.

lucien.knechtli22:02:34

think I started by looking at one of those todo apps and breaking it apart to see how it worked

jaen22:02:23

@progzilla: yeah, that too. With this and the links I've given you should have a fairly good idea how to work with Clojurescript + reagent.

jaen22:02:34

You could then try learning re-frame after that.

jaen22:02:59

Though I would have hoped there's a more tutorial-like introduction to reagent, but I can't remember anything like that ; /

paulb22:02:12

The beta version of Web Development in Clojure 2ed. is supposed to be released tomorrow, and it covers reagent and re-frame

danielcompton22:02:52

Is there a way to programmatically tell if there were warnings or errors during a cljsbuild build?

progzilla23:02:11

@jaen: @lucien.knechtli Thanks guys. You're awesome

richiardiandrea23:02:03

@danielcompton if i understand correctly maybe you can set a custom warning handler

richiardiandrea23:02:26

I remember somebody was asking the same question some time agp

futuro23:02:11

Has anyone else had trouble with figwheel taking ~10-20 seconds to notice a changed file?