This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-26
Channels
- # admin-announcements (1)
- # beginners (1)
- # boot (252)
- # braveandtrue (1)
- # cider (17)
- # clojure (58)
- # clojure-chicago (3)
- # clojure-russia (125)
- # clojure-uk (2)
- # clojurescript (38)
- # hoplon (3)
- # lein-figwheel (11)
- # leiningen (1)
- # mount (2)
- # off-topic (3)
- # om (9)
- # onyx (39)
- # parinfer (24)
- # proton (7)
- # protorepl (7)
- # quil (4)
- # re-frame (16)
- # reagent (5)
- # ring-swagger (18)
- # yada (1)
CLJS outputs js/class
as class$
and js/super
as super$
😞 Why munge direct interop calls?
@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"
I've tried adding :cache {:src-paths-lookup? true and :paths [paths-to-dot-edn]} But neither seem to work. Any suggestions?
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
@domkm if you want access to raw js use (js* "super")
or (js* "class")
, that is emitted as is
@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.
hrm, i’d open up the React devtools and see what the props look like when rendered
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.
Right now it's
(ns linden.core
(:require [cljs.test :as ct :refer [function?]]))
I've also tried
(ns linden.core
(:require [cljs.test]))
And
(ns linden.core
(:require [cljs.test :refer [function?]]))
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.
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.
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
@reefersleep: by looking at the source, it seems that function?
isn't available for CLJS usage
https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/test.clj#L18
@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?
it's in the .clj
file
I notice that now x)
Why is there a .clj
file for the cljs.test
namespace? I don't get it.
Clojurescript macros are written in Clojure
Well, damn.
Does anyone have any idea how I could go about checking whether a value is a function in ClojureScript?
@reefersleep: (fn? x)
@anmonteiro: Thanks a lot!
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.
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.
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.
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 ?
what advantage does that grant you over using something like garden?
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?
It works fine in the REPL.
Hey everyone. New to pretty much everything here but am stumped trying to include cljs-ajax into a fresh reagent project.
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
Nothing in online examples to indicate where I'm going wrong... any suggestion appreciated!