This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-13
Channels
- # aws-lambda (7)
- # beginners (80)
- # boot (134)
- # cider (11)
- # cljs-dev (5)
- # cljsjs (3)
- # cljsrn (19)
- # clojure (144)
- # clojure-austin (2)
- # clojure-berlin (3)
- # clojure-greece (6)
- # clojure-italy (3)
- # clojure-russia (95)
- # clojure-spec (57)
- # clojure-uk (120)
- # clojure-za (2)
- # clojurescript (71)
- # component (1)
- # css (1)
- # cursive (22)
- # datascript (2)
- # datomic (101)
- # dirac (9)
- # docker (3)
- # emacs (10)
- # events (2)
- # immutant (3)
- # leiningen (2)
- # om (63)
- # om-next (1)
- # onyx (6)
- # pedestal (55)
- # portland-or (3)
- # protorepl (2)
- # re-frame (30)
- # reagent (10)
- # ring-swagger (1)
- # rum (31)
- # spacemacs (5)
- # specter (9)
- # untangled (90)
- # vim (46)
- # yada (2)
@selfname in clj IWithMeta is just IMeta. IMeta in CLJ is IObj.
hello, does anybody have experience writing cljs tests with phantom.js? when I try to call page's method evaluate
I get strange error.
(deftest test-home
(let [page (-> "webpage" js/require .create)]
(-> page
(.open ""
(fn [status]
(.evaluate page
(fn [] (is (= 1 1)))))))))
Testing foo.core-test
Ran 1 tests containing 0 assertions.
0 failures, 0 errors.
ReferenceError: Can't find variable: jq
undefined:1
:1
Hrm, why is it looking for jayq?
I can't get my custom clojure.spec generators to work in ClojureScript, could anyone tell me what I'm doing wrong? Here's a minimal example in the Figwheel repl:
user=> (require '[clojure.spec :as s] 'clojure.test.check.generators '[cljs.spec.impl.gen :as gen])
nil
user=> (gen/sample (s/gen (s/with-gen string? (gen/string-alphanumeric)))))
#object[TypeError TypeError: self__.gfn.call is not a function]
(stack trace deep into minimized code)
nil
user=> (gen/sample (s/gen string?))
("" "h" "yP" "D" "" "Yev4" "dc" "zgc38" "GUZgb" "CM")
@iconara what if you replace (gen/string-alphanumeric)
with either gen/string-alphanumeric
or (constantly gen/string-alphanumeric)
?
@gfredericks yes, it worked, but it leads to a new problem:
(gen/sample (s/gen (s/with-gen string? (gen/such-that #(not= "" %) (gen/string-alphanumeric))))))
and
(gen/sample (s/gen (s/with-gen string? (gen/such-that #(not= "" %) gen/string-alphanumeric)))))
I thought it's supposed to be a 0-arg function that returns a generator
that's what the docstring in jvmland says at least
(gen/sample (s/gen (s/with-gen string? (fn [] (gen/such-that #(not= "" %) gen/string-alphanumeric))))))
@gfredericks thanks for the help, I think your 0-arg hint was what was missing
What's the correct way to use a javascript library that requires other libraries? ala https://github.com/pouchdb/upsert/blob/master/dist/pouchdb.upsert.js
Should I import each library using foreign libs? Or is there something more straightforward?
anyone given this a try https://github.com/google/closure-stylesheets ?
Question: Is the keyword (keyword "/")
valid? I ask because in clojure (read-string ":/")
works fine, but (cljs.reader/read-string ":/")
fails with the error message "Cannot read property '0' of null"
Usecase is a serialization of function names and their documentation meta data. Since /
is the divide function, it gets serialized as :/
@hlolli That looks awesome thank you for the tip, I was looking for something like this
Nevermind, found it: Clojurescript follows the EDN spec, which states Per the symbol rules above, :confused: and :/anything are not legal keywords.
Is it possible to record a profile in Chrome programmatically? e.g. when a request finishes, then start and when a certain function finished stop?
Is it possible to build a re-frame app without React to drop into an existing react app
So that I can build a component in CLJS without including React twice?
@borkdude yeah
if (window.console && window.console.profile) {
console.profile("label for profile");
// insert code to profile here,
// all function calls will be profiled
console.profileEnd();
}
@borkdude @mitchelkuijpers yes looks very similar to sass. Since it's closure library I wonder if it compiles without needing any external library with clojurescript. Worth investigating further....
Especially the renaming stuff would be very cool
Seems like something that integrates really nice with clojurescript
they also seem to include some constants and functions that one would need to download and include specifically in scss, well, better try before promising it too much 🙂
I use om-css with garden so that you have css with your components, works pretty nice actually
I'm getting is not a function
errors with :optimizations :advanced
. The missing function seems to be ReactDOM.findDOMNode
. I have dependencies on [cljs-react-material-ui "0.2.35"]
and [org.omcljs/om "1.0.0-alpha47" :exclusions [cljsjs/react cljsjs/react-dom]]
Can anyone else confirm?
enable :pseudo-names
and :pretty-print
to true
and recompile again, that should give you better context
https://github.com/clojure/clojurescript/wiki/Compiler-Options#pseudo-names
https://github.com/clojure/clojurescript/wiki/Compiler-Options#pretty-print
I did that and the error was ReactDOM.$findDOMNode$ is not a function
.
@stuartsierra a react lib conflict for sure
I can add an :externs
file to fix it, but I'm trying to understand the root of the problem.
Currently working on a small example case.
I've got the React that's bundled with cljs-react-material-ui
I would simply (aget js/window “ReactDOM” “findDOMNode”)
or something similar, depends if this is just a single case or some systemic externs problem
OK, interesting, but it works with an :externs
declaration.
I notice that cljs-react-material-ui
bundles react.ext.js
but not react-dom.ext.js
@stuartsierra ah, k makes sense as seems consistent with the post
Sorry, that was cljsjs/material-ui
, not cljs-react-material-ui
I think that must be it. I created https://github.com/cljsjs/packages/issues/937