Fork me on GitHub
#clojurescript
<
2016-11-01
>
edbond14:11:02

Are there any tutorial how to convert and use react/js lib? Like starting from github - https://github.com/mosch/react-avatar-editor - How to compile it using webpack? - Add to deps.cljs - require and use in clojurescript namespace

edbond14:11:53

Can’t figure out how to stitch it together. Don’t know much of webpack/npm/babel things.

akiel14:11:31

Has someone an example were spec instrumentation works? For me it works if I call a function from the cljs repl but not inside my app.

dnolen14:11:02

it’s possible it doesn’t work - I only tested at the REPL because that’s the primary use case

dnolen14:11:24

make something absolutely minimal that demonstrates the issue and report that in JIRA

akiel14:11:10

ok thanks

keeds14:11:13

@dnolen: About that issue I raised yesterday about ISeqable and NodeList. I cannot reproduce anything within a Node REPL environment. I have only seen it manifest itself on Dom Collections such as NodeList, HTMLCollection. Shall I create an Issue for these specifically.

dnolen14:11:19

@keeds needs more information first. @anmonteiro reported differently

dnolen14:11:27

we don’t care about ISeqable at all

dnolen14:11:44

there seems to be a discrepancy between “native” protocols

dnolen14:11:51

focusing on ISeqable is not relevant to the issue

dnolen14:11:35

and the issue was reproducible on js/String

keeds14:11:46

Ok, thx. I will explore more when I have time, but I'm not sure how well I can isolate given my knowledge.

dnolen14:11:52

we should make no assumption that this has anything to do with DOM stuff

dnolen16:11:49

@anmonteiro I just tried master and I cannot reproduce

dnolen16:11:07

(extend-type js/String ISeqable (-seq [this] (prim-seq this 0)))

dnolen16:11:17

(first “asd”) => “a”

anmonteiro17:11:14

@dnolen yeah works for me too

anmonteiro17:11:25

my snippet yesterday was probably flawed

dnolen17:11:43

@keeds you probably weren’t following my conversation with @anmonteiro but the thing to try is (satisfies? ISeqable x) on instances of these types

dnolen17:11:02

@keeds if that works then there’s something wrong with your code and the fact that it was working before might have just been you getting lucky

keeds17:11:03

Ok. I'll have another look at it later or tomorrow. Thanks.

joshkh17:11:21

This may be off topic, but is there a way to force cljs-devtools to print maps such that their key/value pairs are on new lines?

borkdude17:11:23

when using bootstrap dropdowns, like in this example, together with React, do you have to call something on did-mount to make the dropdown work? http://getbootstrap.com/components/#input-groups-buttons-dropdowns

joshkh17:11:04

@borkdude are you including the javascript that comes with bootstrap?

joshkh17:11:50

if so then you should be able to do something like this in reagent:

[:div.dropdown
 [:button.dropdown-toggle {:data-toggle "dropdown"}]
 [:ul.dropdown-menu
  [:li [:a "Item 1"]]
  [:li [:a "Item 2"]]]]

borkdude17:11:52

I’m using cljsjs.bootstrap. When I require that, is that enough?

joshkh17:11:26

oh, i'm not sure to be honest - i've only used bootstrap directly.

tomas.casas19:11:09

I am sorry for the silly question, but I don’t understand why I cannot pull :id from popup object. popup is a (let [popup (<! (chrome.windows.create #js {[params]}))])

dnolen19:11:27

@thomas.williams that’s a JS object, that’s just how it prints

dnolen19:11:36

it’s not a ClojureScript map

tomas.casas19:11:39

I already tried (aget popup “id”) and (.-id popup). Also tried with (:id popup)

dnolen19:11:55

it’s also inside of a vector

dnolen19:11:32

(-> xs first (goog.object/get “id))

tomas.casas19:11:50

oh, that would explain things... I should get [popup window-id] as a result of the create method

dnolen19:11:12

what’s printed says different

tomas.casas19:11:24

@dnolen I think you saved my day... I was away from cljs for a month and got rusty

dnolen19:11:02

@tomas.casas these days you can more or less trust the tooling - your answer was in that image 🙂

tomas.casas19:11:13

that is what I mean, I was comfortable several weeks ago with explaining/realizing unexpected returned values from console

tomas.casas19:11:41

thanks a lot!

habanerao22:11:58

A newbie question on Om/Om.next and other React-based approaches: we are looking at using Om for an upcoming project, but a number of team members are wary of moving away from native react. If we use Om, would the Om generated JS be human-friendly and enable us to have the ability to switch to native react, if needed?

dnolen22:11:07

@habanerao not really, reusing the generated JS is non-goal

dnolen22:11:20

for ClojureScript in general - nothing specific to Om

hlolli22:11:56

how would this be notated in cljs navigator.mimeTypes['application/x-nacl'] !== undefined. ? nvm found it: (aget (.-mimeTypes js/navigator) "application/x-nacl")

anmonteiro23:11:12

@hlolli aget is only for arrays

anmonteiro23:11:21

you should use goog.object/get

hlolli23:11:46

ok thanks, with aget I can at least see if the mimetype is supplied in the browser or not, but I go for the safer choice (goog.object).