Fork me on GitHub
#clojurescript
<
2015-08-19
>
paradoxquine00:08:16

anyone know of a good article contrasting es6 modules with closure lib modules/namespaces?

paradoxquine00:08:25

i’d like to better understand the design differences

jmmk00:08:31

Any ideas why I would get the following error when trying to use cljs.reader/read-string in planck?

cljs.user=> (cljs.reader/read-string "{:keyword :value}")
    undefined is not a function (evaluating 'sb.toString$()')

mfikes03:08:58

@jmmk: This is probably the same root cause as http://dev.clojure.org/jira/browse/CLJS-1330. With Planck 1.5, one way to work around it is to not (require ‘cljs.reader) and just ignore the analysis warnings. It is working in Planck master (owing to the use of the cljs.js capability to load pre-compiled namespaces.

mfikes03:08:16

@jmmk: Planck master is trivial to build, if you have things like Xcode already on your box.

git clone 
cd planck
script/build

mfikes04:08:12

@jmmk: A proposed patch to the sb.toString$() issue is in http://dev.clojure.org/jira/browse/CLJS-1430

sjol05:08:38

has any have a clean example on how to setup reagent with material-ui? I've cloned this repo: https://github.com/tuhlmann/reagent-material and gotten it to work. Then tried to start my own project but getting stuck with an error:

Warning: getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.
react.inc.js:19588 Warning: AppCanvas(...): No `render` method found on the returned component instance: you may have forgotten to define `render` in your component or you may have accidentally tried to render an element whose type is a function that isn't a React component.
But I have modified my secretary mount point to render with reagent/render-component but still get the error

pupeno07:08:39

I have clojurescript project, starting from the reagent template (https://github.com/pupeno/proclodo-spa-server-rendering). I commented out all clojurescript code but in the compiled code I still get this line: if(typeof goog == "undefined") document.write('<script src="js/out/goog/base.js"></script>’); I’m trying to get rid of it to attempt running my cljs code in nashorn, which doesn’t implement document. Any ideas where that line is coming from?

pxlpnk07:08:16

I am a bit confused with npm clojurescript and how to use a module, has someone an idea how to translate the following into cljs: https://gist.github.com/pxlpnk/80a9f3e6c236f7b40999 ?

rburns08:08:42

(def Alpine (cljs.nodejs/require 'alpine'))
(let [alpine (Alpine. "%h %s %B")
        data   (.parseLine alpine " 403 4321")])

pxlpnk08:08:55

rburns: thank you, I wasn't sure how to deal with the .new

pxlpnk08:08:14

thank you. I think I need to collect more of those distributed pieces of information

joelkuiper09:08:10

What’s currently the best way of doing “isomorphic” ClojureScript … I’ve been looking into Nashhorn and I was kinda impressed (don’t really want to introduce the NodeJS dependency) … are there currently some libraries you would recommend?

darwin09:08:39

@joelgluth: @pupeno mentioned https://github.com/DomKM/omelette recently, don’t know how good it is, looks solid

pupeno09:08:00

joelkuiper: omelette does it and you can clone it and run it on your machine, very straightforward but the way it does it is not compatible with figwheel. I have an idea on how to fix that, which I’m going to try soon.

pupeno09:08:38

and I intend to have a proof of concept here soon: https://github.com/pupeno/proclodo-spa-server-rendering

joelkuiper09:08:41

Ah cool, Figwheel is currently a major selling point for using ClojureScript for me simple_smile so would be lovely to have that support

pupeno09:08:06

and I’ll probably write a blog post about it as well.

joelkuiper09:08:24

Thanks, I’ll take a look and keep an eye out on the updates/blog post as well simple_smile

pupeno09:08:26

Anyway, food, brb

joelkuiper09:08:36

Have a good one simple_smile

sjol10:08:27

can't seem to render this reagent component:

(defn about-page []
  [:div [:h2 "About peaktime-ui-reagent"]
   [:div [:a {:href "#/"} "go to the home page"]
         [:div.action-icons
           [ui/IconButton {:iconClassName "mdfi_navigation_more_vert"}]
           [ui/IconButton {:iconClassName "mdfi_action_favorite_outline"}]
           [ui/IconButton {:iconClassName "mdfi_action_search"}] ] 
   ]] )
it tells me that :
Warning: IconButton(...): No `render` method found on the returned component instance: you may have forgotten to define `render` in your component or you may have accidentally tried to render an element whose type is a function that isn't a React component.

Uncaught TypeError: inst.render is not a function
` any clues as to what's going on? or how I should debug this?

darwin11:08:27

@sjol: show us ui/IconButton too

crisptrutski11:08:58

usage looks correct to me..

acron13:08:04

does anyone here understand ref cursors in Om? I'm having one of those experiences where what I thought I knew is diverging from what i'm actually experiencing...

jackjames13:08:05

@acron: maybe a good question for the #C06DT2YSY channel

acron13:08:30

didn't realise there was one! thanks!

darwin14:08:54

does something like this exist for cljs? https://github.com/clojure/core.memoize

arohner14:08:58

@pupeno: I have a blog post about that coming today

arohner14:08:02

server side rendering

pupeno14:08:13

arohner: oh! cool. Looking forward to it.

mfikes14:08:39

@jellea: In Planck you can now pass -j foo.jar -j bar.jar to have it consume JAR deps.

pupeno14:08:08

arohner: can I ask you, what approach did you take?

nullptr15:08:08

good stuff — i’m using planck all the time for tiny hacking sessions, this will be very useful

bostonaholic15:08:51

I was so excited to install planck when it came out, but then...

~  brew install planck
planck: OS X Mavericks or newer is required.

arohner15:08:38

pupeno: I got it half working, and decided it wasn’t worth the trouble

pupeno15:08:59

arohner: what was your approach?

arohner15:08:13

Loading the compiled JS in nashorn

mfikes15:08:50

@bostonaholic: Planck could probably be made to work on earlier versions of OS X. (It is currently using the Objective-C bindings to JavaScriptCore, which isn’t necessary.)

mfikes16:08:13

@bostonaholic: I’ll try turning off JSC_OBJC_API_ENABLED and see if it is a goat or yak.

sjol16:08:58

@darwin: @crisptrutski is right I just copied the example from tuhlmann/reagent-material repo but I started with a fresh lein new reagent <project name> as the readme states that not all libs included in the project were necessary because this is pulled from a bigger code base. I can create a normal reagent component and render it, the lein template works, but as soon as I try Material-ui components I get those render errors

dvingo17:08:17

You can just download planck and run it http://planck.fikesfarm.com/download.html

dvingo17:08:33

i'm on 10.9.5

mfikes18:08:46

It turns out it is not too hard to extend Planck back to OS X 10.7 Lion.

mfikes18:08:16

Problem is, I don’t have any pre-Mavericks hosts to test upon. If anyone wants to see if it actually works, I put a 10.6 beta 1 at http://planck.fikesfarm.com/download.html (Some things are currently disabled in that version, but the basic REPL functionality is there.)

mfikes18:08:38

@danvingo: Even though you can download Planck (without using Homebrew), Planck 1.5 requires Mavericks owing to the fact that it uses the Objective-C bindings to JavaScriptCore.

dvingo18:08:08

I see, I never memorised apples marketing os names, so wasn't sure which version is what

lvh20:08:27

Anyone using CIDER with figwheel’s sidecar repl and cider’s test running? It can’t seem to find test namespaces, even though they’re definitely compiling...

pre20:08:33

ANN: Garden is now on Clj 1.7 and Cljs 1.7.28, after migrating 3000 lines from cljx to cljc. The new Cljs repl and tests provide the fastest builds ever seen for running 245 tests using the built-in cljs.test. All this speed—thanks to @dnolen. Try a local snapshot of Garden, and let us know what you think! https://github.com/noprompt/garden

meow22:08:06

@pri: sounds like quite an effort on your part - well done simple_smile

tel23:08:23

Is there a reference anywhere of the correspondences between clojure types and clojurescript types

tel23:08:43

e.g. if I’m writing instances for a protocol that ought to apply to most Js and Clojure types

tel23:08:17

if I want to instantiate for String I can do java.lang.String and… js/String?

tel23:08:39

I think that’s right, but a reference that just listed them out would be helpful simple_smile