Fork me on GitHub
#clojurescript
<
2016-04-15
>
borkdude08:04:11

what other statements like debugger; are there in Chrome? is there for example a statement that will just pause execution?

Roman Liutikov08:04:42

@borkdude: afaik, debugger is the only one

robincarlo8408:04:39

hi guys, just starting with clojurescript and really need to clarify something.

robincarlo8408:04:47

I'm planning on making a multipage site instead of just a single page app, does that mean I will need to have multiple .cljs? e.g. index.cljs, about.cljs, profile.cljs?

robincarlo8408:04:59

Currently, I'm using Compojure for my routing

borkdude08:04:27

@robincarlo84: you don't have to, but you can

robincarlo8408:04:16

@borkdude ah I see, thanks for clarifying. Will check that

borkdude08:04:13

Seems like I'm back to the Om philosophy, doing Redux atm 😉

bojan.matic09:04:05

is om closest to react + redux?

borkdude09:04:28

@bojan.matic: it has a single application state like Redux, I think the idea comes from Om

bojan.matic09:04:50

what does reagent do differently? or it doesn’t do state at all?

borkdude09:04:16

@bojan.matic: reagent doesn't care about where you store your state as long as you use a r/atom

bojan.matic09:04:58

if i were to start a clojurescript project now as a learning experience, which react binding lib would you recommend?

borkdude09:04:51

@bojan.matic: personally I would start with Reagent and then maybe look at Om or Rum

martinklepsch09:04:59

@bojan.matic: I think I'd recommend Reagent

bojan.matic09:04:36

is the react version baked into the library, how does that work? is it possible to make it use the newly released react 15?

martinklepsch09:04:07

@bojan.matic: Reagent depends on a jar cljsjs/react which you can override yourself

martinklepsch09:04:34

all available versions can be found here: https://clojars.org/cljsjs/react

bojan.matic09:04:05

so, how would i override the version so that reagent uses the newer one?

borkdude09:04:51

@bojan.matic: personally I would just go with the defaults

martinklepsch09:04:09

you can specify it in :dependencies in project.clj. anything you specify yourself will take precedence over what other dependencies specify

martinklepsch09:04:36

But yes, @borkdude is totally right, go with the defaults first to avoid running into errors that haven't been ironed out yet

bojan.matic09:04:43

so the installed dependencies are flat for the whole project, ala python pip, there are no nested dependencies as in npm?

borkdude09:04:03

what is npm?

bojan.matic09:04:18

not a package manager 😄

martinklepsch09:04:45

@bojan.matic: the list of deps converts to a tree which you can see with lein deps :tree — not sure if that's what you're asking

martinklepsch09:04:05

essentially dependencies are global, you can't load two versions of the same dependency at the same time

bojan.matic09:04:24

i’m asking would i end up with react 15 in top level and react 0.14 under the reagent level

martinklepsch09:04:03

@bojan.matic: if you specify react 15 as a dependency it will take precedence over react 14 from reagent and the reagent code will use react 15 as well

borkdude09:04:26

I don't know if Reagent is tested well against newer versions of React, but what could possibly go wrong

bojan.matic09:04:49

there are minor breaking changes, but mostly removal of deprecated stuff

bojan.matic09:04:11

but they are also removing creation of extra spans, and react-dataid attributes in the DOM

bojan.matic09:04:26

it sounds to me like not much should go wrong

martinklepsch09:04:36

Be sure to use the reagent 0.6.0-alphas when trying with react 15. BUT again, for learning it's probably best to stick with stable versions simple_smile

robincarlo8409:04:24

Is it possible to only have one routing? In my case I want to have only the server side routing (Compojure) for my multipage site?

borkdude09:04:10

@robincarlo84: you probably want to build a classic web app and only enhance the html sent from the server with some js?

karolmajta10:04:48

hey, does anyone know if it is possible to render a reagent component into resultant hiccup form?

karolmajta10:04:17

I know render-to-string, but that does render strainght into html

karolmajta10:04:37

going through the sources right now, and i can't find anything like this

borkdude10:04:52

@karolmajta: I think the hiccup form is already in your code, before Reagent touches it

karolmajta10:04:48

what if i have something like this:

(defn my-comp-a [] [:a "some link"])
(defn my-comp-b [] [:h1 [my-comp-a]])
my-comp-b is just data, but it has function in head position of [my-comp-a] vector

borkdude10:04:34

@karolmajta: if you change [my-comp-a] to (my-comp-a) you'll get what you want, but I don't think it's otherwise possible, because the result of my-comp-a generally depends on state

karolmajta10:04:17

I'll try to render it into html, and then parse it back using hockory, we'll see what comes out of it

karolmajta10:04:07

I want to have that possible local state of components - so full top-down rendering is rather a no-go for me

jouerose12:04:52

hello all. could please let me know what is the usual go-to command or library for clojurescript http requests ?

rnandan27312:04:51

I am trying to use react-bootstrap components using [react-bootstrap "0.28.1-1"]. The issue i am facing is with the usage of the Tabs. The initial render is as expected. However when any of the tab selection is done i get an error stating Uncaught TypeError: Cannot read property 'findDOMNode' of undefined. This happens only with the Tabs component. Any ideas?

jouerose13:04:46

@pbostrom: thanks. will check it out.

sbondaryev13:04:06

When I compile the file in the advanced mode (ns worker.core (:require [cljs.js])) (cljs.js/compile-str (cljs.js/empty-state) "(println \"test\")" #(:value %)) I have an error: Uncaught Error: No method in multimethod 'cljs.compiler/emit*' for dispatch value:

sbondaryev13:04:50

Does the compile-str work for advanced compilation?

sbondaryev13:04:05

Did I mis some configuration params?

fasiha14:04:01

Are people who use ClojureScript for Node.js just using JS servers like express, or is there a highly-regarded ClojureScript-specific project like Clojure's Ring?

jouerose14:04:24

@fasiha: thanks. @micha made some interesting comments about the google closure library in the #C08BDAPRA

jouerose14:04:59

channel. did you know about it ?

jouerose14:04:39

@fasiha: he just made them so you will see them if you enter the channel

dnolen16:04:01

@fasiha: I think there might be some Ring compatible things floating around.

hellofunk16:04:11

Why would (aset js/window ...) cause the globally defined Js var to not be recognized in non optimized compile, but fine in advanced compile?

dnolen16:04:02

@hellofunk: doesn’t sound very likely

dnolen16:04:57

my suspicion would be load order issues

dnolen16:04:39

so working under advanced compilation probably due to single file

hellofunk16:04:08

That very well might explain it, I shall investigate, thanks

ezmiller17:04:23

Hi All, I’m working on a Reagent project and would like to fill a span with an ASCII code. The Ascii code, however, is being interpreted as a string and printed as-is to the page. Does anyone know how I would get the asccii code to be interpreted?

ezmiller17:04:52

Here’s a code snippet:

[:span {:class "emailIsConfirmed no"}
     [:span {:class "check"} &#x2714;]
     [:span {:class "x-mark"} "&#x2718;"]]

manutter5117:04:11

Maybe just use the unicode instead? “\u2714"

ezmiller18:04:21

Thanks! That seems like what I needed.