Writing Clojurescript with Angular

145 views
Skip to first unread message

Yehonathan Sharvit

unread,
Oct 19, 2014, 5:28:52 AM10/19/14
to clojur...@googlegroups.com
Hello,

I am pushing very strong clojurescript in my company.
Currently we use cljs + angular.

I am curious to know how many people use this stack and do you have any recommendation?


Thanks.

Rory Douglas

unread,
Oct 19, 2014, 12:25:10 PM10/19/14
to clojur...@googlegroups.com
I'm not using this, but I'd be interested to know if you're using Gyr or just direct JS interop?

Kevin Lynagh

unread,
Oct 19, 2014, 1:10:11 PM10/19/14
to clojur...@googlegroups.com

My company has worked on several projects using cljs + Angular.
I wrote a blog post last year outlining some of it:

http://keminglabs.com/blog/angular-cljs-weather-app/

The decision was a pragmatic one at the time, but in the most few months we've been doing new work using React/Om, which feels much nicer to use from ClojureScript than Angular does.

I recall in particular the cljs<->js datatype coercion got tricky in places and it was easy to trip over.

Gary Trakhman

unread,
Oct 19, 2014, 4:50:10 PM10/19/14
to clojur...@googlegroups.com
Now cljs supports 'specify' so it'll be a bit easier to work with angular than when Kevin wrote his original blog post.


I tried to build something with CLJS/Angular before Om was a thing, and I found it hard to keep track of what kind of data I was passing around, and to reconcile immutable ops with mutable JS data structures. 

No longer worth it, imo.

Haven't tried gyr.


--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Yehonathan Sharvit

unread,
Oct 20, 2014, 10:47:51 AM10/20/14
to clojur...@googlegroups.com
Could you please elaborate about how 'specify' is helpful in the angular + cljs context?

Yehonathan Sharvit

unread,
Oct 20, 2014, 10:49:22 AM10/20/14
to clojur...@googlegroups.com
On Sunday, 19 October 2014 19:25:10 UTC+3, Rory Douglas wrote:
> I'm not using this, but I'd be interested to know if you're using Gyr or just direct JS interop?

I am using Gyr and it is great for:
1. macros for controller/service... definition
2. accessing js nested structure
3. calling js functions

And... All of these work fine in advanced compilation mode.

Gary Trakhman

unread,
Oct 20, 2014, 10:49:25 AM10/20/14
to clojur...@googlegroups.com
It's helpful in the sense that you can wrap standard arrays and JS objects to work with CLJS protocols without globally affecting your whole app.  That may or may not be 'easier', but it's potentially simpler. 

Yehonathan Sharvit

unread,
Oct 20, 2014, 10:50:17 AM10/20/14
to clojur...@googlegroups.com, clojur...@googlegroups.com
Could you give an example, please?


Sent from Mailbox


You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/bHTskfjsyjA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.

Gary Trakhman

unread,
Oct 20, 2014, 11:00:11 AM10/20/14
to clojur...@googlegroups.com
This is the only example I have that uses specify at the moment, but it's treating a JS object as a map: https://gist.github.com/gtrak/f159d1e0c3339cad5259#file-request-cljs-L48

That particular use-case could be accomplished with reify, but the important difference is that it's the same object, you can pass it around without wrapping it in something else and still use all the standard JS methods on it.

Yehonathan Sharvit

unread,
Oct 22, 2014, 3:06:53 AM10/22/14
to clojur...@googlegroups.com
What is the advantage of specify over extend-type like this: https://gist.github.com/viebel/8461313
Reply all
Reply to author
Forward
0 new messages