Fork me on GitHub
#clojurescript
<
2016-03-26
>
domkm01:03:38

CLJS outputs js/class as class$ and js/super as super$ 😞 Why munge direct interop calls?

bbss06:03:40

@richiardiandrea: I've been trying to load om.next in replumb but get "No such macros namespace: om.next, could not locate om/next.clj or om/next.cljc"

bbss06:03:11

I've tried adding :cache {:src-paths-lookup? true and :paths [paths-to-dot-edn]} But neither seem to work. Any suggestions?

sivakumargsk12:03:44

I am trying to use react-bootstrap components in Clojure script using Cljs-js packages. The problem is I try to convert react component into reagent. React component --------------------------------------------------------------------------------------- const tabsInstance = ( <Tabs defaultActiveKey={2} position="left" tabWidth={3}> <Tab eventKey={1} title="Tab 1">Tab 1 content</Tab> <Tab eventKey={2} title="Tab 2">Tab 2 content</Tab> <Tab eventKey={3} title="Tab 3" disabled>Tab 3 content</Tab> </Tabs> ); ReactDOM.render(tabsInstance, mountNode); Reagent ------------------------------------------------------------------------------------- (def tab (reagent/adapt-react-class (aget js/ReactBootstrap "Tab"))) (def tabs (reagent/adapt-react-class (aget js/ReactBootstrap "Tabs"))) (defn left-tabs [] [:div [tabs {:default-active-key "{2}" :position "left" :tab-width "{3}"} [tab {:event-key "{1}" :title "Tab 1"} "Tab 1 contant"] [tab {:event-key "{2}" :title "Tab 2"} "Tab 2 contant"] [tab {:event-key "{3}" :title "Tab 3"} "Tab 3 contant"]]) how to write this ""eventKey={3}"" in Clojure script

glenjamin12:03:17

sivakumargsk: {:eventKey 3} should work

thheller13:03:49

@domkm if you want access to raw js use (js* "super") or (js* "class"), that is emitted as is

thheller13:03:16

chances are you are emitting unusable code though

sivakumargsk13:03:39

@glenjamin: thanks for your response. I do what you said but I got some error in console like this > react-bootstrap.inc.js:16201 Uncaught TypeError: Cannot read roperty 'findDOMNode' of undefined. The content in the tabs is not displayed.

glenjamin13:03:17

hrm, i’d open up the React devtools and see what the props look like when rendered

reefersleep13:03:23

I've got a cljc file in which I'd like to use both clojure.test/function? and cljs.test/function?. I've got the reader conditional down, but I cannot get the namespace reference to cljs.test/function to work.

reefersleep13:03:50

Right now it's

(ns linden.core
  (:require [cljs.test :as ct :refer [function?]]))

reefersleep13:03:26

I've also tried

reefersleep13:03:52

(ns linden.core
  (:require [cljs.test]))

reefersleep13:03:25

And

(ns linden.core
  (:require [cljs.test :refer [function?]]))

reefersleep13:03:10

I've looked at the documentation for namespaces in both Clojure and ClojureScript, but haven't found an example that fits my use case or information that tells me why my attempts do not work.

reefersleep14:03:13

I'm sending the project containing the cljc to clojars, then requiring it in a figwheel project, and compilation fails upon lein figwheel dev with different (but similar-ish) messages according to each attempt.

reefersleep14:03:17

Right now, it's: ANALYSIS ERROR: Invalid :refer, var var cljs.test/function? does not exist in file resources\public\js\compiled\out\linden\core.cljc on file null, line null, column null

anmonteiro14:03:30

@reefersleep: by looking at the source, it seems that function? isn't available for CLJS usage

reefersleep14:03:30

@anmonteiro: I looked at the same source and thought, "it's a function, it's in the cljs.test namespace, therefore it must be available." What's wrong with my thought process? simple_smile

anmonteiro14:03:51

it's in the .clj file

reefersleep14:03:59

I notice that now x)

reefersleep14:03:30

Why is there a .clj file for the cljs.test namespace? I don't get it.

anmonteiro14:03:32

Clojurescript macros are written in Clojure

reefersleep14:03:24

Does anyone have any idea how I could go about checking whether a value is a function in ClojureScript? simple_smile

reefersleep15:03:32

I wonder why I didn't come upon that when I was searching and instead found clojure.test/function?... And I wonder why the functionality is duplicated.

reefersleep15:03:06

I mean, from Clojuredocs it looks like there is some semantic difference based on the underlying implementation of whatever you're querying, but I'm not sure what it is.

reefersleep15:03:10

But nevermind that. I'll try and see if fn? does the job. Then I can probably even skip the reader conditional in the cljc file.

octahedrion19:03:37

I just realized that HTML/SVG can be styled with XSLT...and XSLT is kinda functional, so could be mapped to Clojure for functional styling...anyone done anything like this ?

adamkowalski21:03:21

what advantage does that grant you over using something like garden?

reefersleep21:03:08

I'm using quil and trying to use q/sin and q/cos, but I get TypeError: quil.sketch.current_applet.call(...) is null Anyone have any idea why? simple_smile It works fine in the REPL.

pauldelany21:03:39

Hey everyone. New to pretty much everything here but am stumped trying to include cljs-ajax into a fresh reagent project.

pauldelany21:03:20

Have done: 'lein new reagent myapp', added [cljs-ajax "0.5.4"] to dependencies in project.clj, and in my core.cljs added to :require [ajax.core :as ajax], at which point I get error: No such namespace: ajax.core, could not locate ajax/core.cljs, ajax/core.cljc, or Closure namespace "ajax.core" in file src/cljs/myapp13/core.cljs

pauldelany21:03:56

Nothing in online examples to indicate where I'm going wrong... any suggestion appreciated!