This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-06
Channels
- # architecture (2)
- # aws (6)
- # bangalore-clj (3)
- # beginners (7)
- # boot (29)
- # cider (26)
- # cljs-dev (52)
- # cljsrn (1)
- # clojure (249)
- # clojure-dev (9)
- # clojure-italy (2)
- # clojure-norway (3)
- # clojure-russia (178)
- # clojure-uk (30)
- # clojureremote (6)
- # clojurescript (91)
- # core-async (4)
- # cursive (8)
- # datascript (3)
- # datavis (1)
- # datomic (6)
- # emacs (3)
- # figwheel (2)
- # hoplon (14)
- # incanter (6)
- # luminus (8)
- # mount (7)
- # off-topic (22)
- # om (25)
- # onyx (41)
- # pedestal (7)
- # re-frame (9)
- # ring (1)
- # spacemacs (4)
- # sql (1)
- # uncomplicate (1)
- # unrepl (37)
- # untangled (90)
- # yada (77)
@robert-stuttaford There is a more recent clj selenium library than clj-webdriver, I believe
@robert-stuttaford are there features in Selenium that you need that clj-webdriver doesn’t have?
we’re still using clj-webdriver FWIW
@anmonteiro webica abuses introspection to expose the most recent Selenium. At the moment it's a little tricky to expose the API docs (a la codox), but it allows you to use the latest
@robert-stuttaford On several projects I've worked on we've just stuck with cljs.test (or clojurescript.test as it was called back then IIRC), and ran code only tests. That does leave you open to UI bugs, but I have yet to find a solution that that isn't super fragile. And doing code level tests forces you to decouple DOM elements from your business logic, which is a good idea anyways.
the Clojurescript compiler throws me:
Unsupported binding form: 1 at line 43, column 5 in file test/cljs/budb/cljs/firebase_test.cljs
If I write the code myself, I don't get such error, and the expansion looks fine:
(macroexpand '(test-firebase S 1))
=> (budb.test.helpers/test-async S
(budb.test.helpers/test-within S 4000
(superv.async/go-try S (do 1))))
Have you seen this case? Where should I look to understand the reason for this exception?@lsenta that error is from destructuring something, so if you have something like (let [:foo 1] ...)
(macroexpand '(test-firebase S 1))
=> (budb.test.helpers/test-async S
(budb.test.helpers/test-within S 4000
(superv.async/go-try S (do 1))))
(test-firebase S :foo)
does this change the error to Unsupported binding form: :foo
?
It's so basic, could you let me know if you see something weird?
(defmacro test-firebase
[supervisor-sym & body]
`(test-async ~supervisor-sym
(test-within ~supervisor-sym 4000
(go-try ~supervisor-sym
(do ~@body)))))
@anmonteiro Is there a problem, loading system libraries from nodejs? I recompiled the closure compiler and clojurescript to use the latest version. Now it throws multiple errors like WARNING: JSC_JS_MODULE_LOAD_WARNING. Failed to load module "util" at /Users/danielgrosse/dev/clojure/npm-compile-test/node_modules/json/lib/json.js line 14 :
thanks @john @anmonteiro @tbaldridge — all good points!
@lsenta no idea, reduce that until the error goes away. probably the go-try
since that is where the 1
ends up
@thheller thanks for the help, I still don't see what's wrong I'll work around it for now.
@lsenta yeah it a weird one, be aware that line/column information may be off if the form is actually inside another macro
so maybe you are looking at the wrong thing, probably not though since the :foo
test worked
@thheller thx for your answer. I was feeling the same. How could we prove it? Perhaps by saying there is no such thing as Var in cljs?
@zerusski don't extend protocols onto native types, they are mutable collections. you will get yourself into trouble 🙂
I'm not too immersed in cljs ecosystem and seems like there's much dated information on the net
no idea where that is written down, if at all. it is my personal recommendation based on experience but I'm sure others share my opinion
but you are right, that should probably be written down somewhere. maybe on http://clojurescript.org
I understand js and browser could be a moving target, but why doesn't it work in this particular case?
it may depend on your browser ... some browsers in the past didn't let you extend native objects
the only thing that comes to mind is that this isn't "the droid I'm looking for". Different type that serialises to the same name
you might not be working with a HTMLCollection as well. native types do not strictly follow the JS inheritance chain sometimes
haha, @thheller I think you are absolutely right. To test I put some div
s on the page, grabbed em with .getElementsByClass
. And extend-type
worked beautifully. So I suspect the stuff I was getting wasn't HTMLCollection
but reported as being one. I guess not worth reporting that
that is my experience with protocols on native types as well .. sometimes they work ... sometimes they don't for reasons unknown 🙂
@zerusski iframes have their own js sandbox, so you'd need to extend-type
from inside it
(= (type (.. (.-contentDocument frame) -body -children))
(type (.. js/document -body -children)))
;false
hi, what blog post or talk would you recommend, if you could choose only one, to inspire a js & frontend developer to try out fp & ClojureScript. we're building a poc app with react native and this could be an opportunity to try out clojurescript. (not for me)
@sakalli haven't seen this one personally but this one gets recommended a lot: https://www.youtube.com/watch?v=gsffg5xxFQI&list=PLZdCLR02grLrl5ie970A24kvti21hGiOf&index=8
I'd also show them the FigWheel talk at ClojureWest https://www.youtube.com/watch?v=j-kj2qwJa_E
@zerusski actually now that I poke around, you can extend-type
iframe types like this:
(def frame (-> js/document (.getElementsByTagName "iframe") (aget 0)))
(extend-type frame.contentWindow.HTMLCollection
ISeqable
(-seq [o] (array-seq o 0)))
@danielgrosse are you compiling with :target :nodejs
?
It has to run in the browser, and the compiling breaks.
Right. Makes total sense. There's no 'util'
module in the browser
But when I compile it with browserify it works.
Okay. Now it does.
Probably because Browserify has a polyfill for some internal Node modules
Oh that's just a warning anyway. It'll work at runtime since it's internal
I have a clojurescript macro expansion question for anyone knowledgable here: in a nutshell, the issue I can't figure out is that a simple interop form like (.foo bar baz)
correctly expands to bar.foo(baz);
but expanding that same form within a macro seems to be adding a phantom .call(null) and I dont understand why
@jr (keep in mind this is a push from mid-hack), here is the basic function I am trying to macroify
essentially, hfc.newDefaultKeyStore() uses ES6 promises, and I am trying to wrap them in promesa promises
I have this macro: https://github.com/ghaskins/fabric-chaintool/blob/macro-question/examples/example02/client/cljs/src/example02/fabric_sdk/macros.clj
with the idea being I want to do something like (m/pwrap (.newDefaultKeyValStore hfc #js {:path path}))
with the idea that the form passed in is expanded in the same way as when I use it natively
I’m looking at cljs test runners, are there any good options besides https://github.com/bensu/doo ?
@jfntn I’ve been using Doo successfully in all my CLJS projects
if you’re using Boot, this is what you want (uses Doo too): https://github.com/crisptrutski/boot-cljs-test/
@anmonteiro thanks that looks good
@anmonteiro do you any cljs-specifc reasons for using boot over lein besides personal preference?
mostly personal preference
in some cases I need custom build pipelines
(e.g. Lumo)