ANN: Om 0.8.6, Hello CLJSJS

506 views
Skip to first unread message

David Nolen

unread,
Jan 27, 2015, 12:57:19 AM1/27/15
to clojure, clojur...@googlegroups.com
The only significant change is that Om now relies on the cljsjs.react artifact instead of the one I maintained myself. cljsjs.react has the benefit that usage of React with addons instead of plain React may be configured via Maven in your pom.xml or your project.clj. It's exciting to see that we are already reaping the benefits of :foreign-libs and Maven over existing JavaScript solutions for managing dependencies.

This release also includes a fix for a very subtle set-state! bug discovered by Brenton Ashworth.

Feedback welcome!

Olav Nymoen

unread,
Jan 27, 2015, 3:46:58 PM1/27/15
to clojur...@googlegroups.com, clo...@googlegroups.com
Just testing clojurescript out so many possible pitfalls on my side here.

Does the new javascript externals stuff break lighttables live external browser functionality?

Following the basic intro tutorial I cannot get live updates to work. The mies-om om-tut is based on 0.8.4 , and it cannot reference com.facebook.react, while 0.8.6 cannot find cljsjs.react.

It compiles nicely with lein, but I can't seem to get the lighttable live REPL stuff to work.

Olav

David Nolen

unread,
Jan 27, 2015, 4:25:00 PM1/27/15
to clojur...@googlegroups.com, clojure
I think expecting every last thing to work especially from third parties who may be wisely lagging behind is unlikely at least for the near future.

I haven't kept up with Light Table and what issues it may have. Now is probably a good time to remove the Light Table centric nature of the Om tutorials and switch to a Figwheel based thing that doesn't require anything more than your text editor of choice.

The wiki has always been community editable and I would love to see people push it forward especially with stuff like this. I will have less time for such things as I focus more on Om core and ClojureScript enhancements.

David

--
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.

Daniel Kersten

unread,
Jan 27, 2015, 11:47:14 PM1/27/15
to clojur...@googlegroups.com, clojure
A figwheel-based tutorial would be fantastic.

I don't have an awful lot of time to convert it right now, but if nobody does before I do get time, I'll happily take a stab at it. Will likely be a month or two though.

Oliver George

unread,
Jan 27, 2015, 11:51:27 PM1/27/15
to clojur...@googlegroups.com, clojure
FWIW I found LightTable and chestnut can play nicely.  
Oliver George
Director, Condense
0428 740 978

David Nolen

unread,
Jan 28, 2015, 2:17:49 AM1/28/15
to clojure, clojur...@googlegroups.com
Just released Om 0.8.7. The only change was bumping the cljsjs.react dependency to get proper externs support.

David

Gabriel Horner

unread,
Jan 28, 2015, 3:13:49 PM1/28/15
to clojur...@googlegroups.com
Hi Olav,
   Following the Basic tutorial for the latest om-tut (0.8.4) I see live updates work via swap! on OSX. Could you be more specific about your platform and the exact steps you've done on the tutorial? While there are some console warnings on initial eval, live updates work for an external browser connection. Fwiw, for future Light Table issues you're more likely to get help on their mailing list [1]

Cheers,
Gabriel


On Tue, Jan 27, 2015 at 10:46 AM, Olav Nymoen <ol...@comoyo.com> wrote:

Sebastian Bensusan

unread,
Jan 31, 2015, 12:18:06 AM1/31/15
to clo...@googlegroups.com, clojur...@googlegroups.com
Hi David and Dan,

I edited Om's Basic Tutorial (https://github.com/swannodette/om/wiki/Basic-Tutorial) to be used with Chestnut. Most of the work (not much!) was changing "evaluate in LightTable" to "save in your text editor". I don't know what the procedure is for updating a Wiki and having this conversation, should I open an issue on Om? I have it as a standalone repo in case someones wants to propose a change or make a pull request:

https://github.com/bensu/basic-om-tut

Two issues:

1. Chestnut 0.6.0 (current stable version) uses Om 0.7.3 and I needed to deref a cursor inside a go loop in order for things to work. See https://github.com/swannodette/om/issues/315 and https://github.com/swannodette/om/commit/92a3e0cf698769fb59bb3744faddaea40b37412d. Om version is bumped to 0.8.3 beta in v0.7.0-SNAPSHOT-20141226

2. Chestnut's 0.6.0 doesn't reload the index.html (not on save, not on refresh). The whole process needs to be restarted. See: https://github.com/plexus/chestnut/issues/84 This was addressed in v0.7.0-SNAPSHOT-20141207.

I would wait until Chestnut 0.7.0 stable is published in Clojars before adding this tutorial to the Om Wiki. Otherwise, if you feel the extra dependency on Chestnut is also too much, I'll fork mies-om and add Figwheel there for the tutorial.

After revising this work, I'll move on to the next tutorial.

Best

Sebastian Bensusan

David Nolen

unread,
Jan 31, 2015, 12:26:34 AM1/31/15
to clojure, clojur...@googlegroups.com
I would prefer just Figwheel. Relying only on Figwheel also means you could probably go out with an updated tutorial much sooner.

Thanks,
David

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com

Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sebastian Bensusan

unread,
Jan 31, 2015, 10:38:23 AM1/31/15
to clojur...@googlegroups.com, clo...@googlegroups.com
Sure, I'll explore Figwheel's new REPL and add that instead.

What about adding/configuring Figwheel? Should it be step by step inside the tutorial, from mies-om to mies-om + Figwheel? Or it should just start with a ready to go template "mies-om-wheel"?

Thanks

Sebastian Bensusan

David Nolen

unread,
Jan 31, 2015, 4:19:22 PM1/31/15
to clojur...@googlegroups.com, clo...@googlegroups.com
Template preferred.

Sebastian Bensusan

unread,
Feb 1, 2015, 8:16:05 PM2/1/15
to clo...@googlegroups.com, clojur...@googlegroups.com
I changed the tutorial to use a new version of the figwheel template https://github.com/bhauman/figwheel-template. When the new template is published to Clojars we can update the Om wiki. I'll move on to the Intermediate tutorial. If by the time I'm done with all of the tutorials the template is not published I'll do it myself.

The new version:


Feedback is welcome. Hope this helps.

To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscribe@googlegroups.com.

Khalid Jebbari

unread,
Feb 1, 2015, 11:00:53 PM2/1/15
to clojur...@googlegroups.com, clo...@googlegroups.com
Wonderful job, Sebastian. I really like the initiative.
One thing I find ambiguous is the use of the word "app" in the implementations of the Om protocols. The tutorial itself calls it the application state, and the var is named "app-state". I think it should it be named "app-state" or "state".

What do you think ?

Sebastian Bensusan

unread,
Feb 2, 2015, 9:49:54 AM2/2/15
to clo...@googlegroups.com, clojur...@googlegroups.com
Thanks Khalid,

The way I see it, Om has three concepts regarding state:

1. The global state defined with atom. Named `app-state`
2. The cursor passed to each component with the relevant parts of the global state. Named `app`
3. Local state of each component, initialized in `IInitState` and manipulated with `(set-state! owner korks v)` and `(get-state owner)`. It is a property of the owner object so it is not directly referenced.

I agree that `app` is ambiguous for 2 but I wouldn't like to call it `app-state` nor `state` since those could also be confused with 1 and 3. Nothing better than `cursor` or `data` comes to mind. Some other parts of the Documentation (the Example in https://github.com/swannodette/om) use `data` and I think it works even if it is a meaningless term for a fn argument. If you agree and nobody raises objections I'll change `app` to `data`.

Sebastian

Khalid Jebbari

unread,
Feb 2, 2015, 12:55:22 PM2/2/15
to clojur...@googlegroups.com, clo...@googlegroups.com
Indeed, "data" is better than "app".

Khalid aka DjebbZ
@Dj3bbZ

--
Note that posts from new members are moderated - please be patient with your first post.
---
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/bruQ9os5wmM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.

Daniel Kersten

unread,
Feb 2, 2015, 1:02:28 PM2/2/15
to clojur...@googlegroups.com, clojure
 I personally like data. om-tools also calls it data.

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.

Sebastian Bensusan

unread,
Feb 2, 2015, 11:12:48 PM2/2/15
to clo...@googlegroups.com, clojur...@googlegroups.com
Let's go with `data` then. I posted the rewrite to Figwheel. Please take a look.

Reply all
Reply to author
Forward
0 new messages