This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-18
Channels
- # announcements (2)
- # architecture (10)
- # beginners (51)
- # cider (14)
- # cljsrn (1)
- # clojure (13)
- # clojure-uk (3)
- # clojurescript (63)
- # cursive (1)
- # datomic (8)
- # emacs (1)
- # figwheel (1)
- # figwheel-main (18)
- # fulcro (62)
- # hyperfiddle (1)
- # incanter (1)
- # jobs-discuss (4)
- # off-topic (3)
- # parinfer (6)
- # reagent (5)
- # ring-swagger (3)
- # shadow-cljs (25)
- # sql (2)
- # tools-deps (2)
@lilactown why don’t you want to use figwheel.main’s repl?
I guess I don’t really know what it does? I just wanted to use rebel-readline with CLJS real quick like to test some code/libraries
try it clj -Sdeps "{:deps {com.bhauman/figwheel-main {:mvn/version \"0.1.7\"}}}}" -m figwheel.main
I just assumed that it was going to pull in a bunch of stuff to build + compile code, which I didn’t want 😉
that does seem to do what I want in the short term, so thanks! I might hack a bit on rebel-readline to do it as well
@qle-guen I would also try integrating react-youtube using goog.provide
I saw that too: https://blob.tomerweller.com/reagent-import-react-components-from-npm but it's kinda complex
Imo you should try to port the library to cljsjs for our great community 😛
Hey again, I finished the cljs script I was working on here yesterday. Would anyone mind a code review and sharing some feedback? https://www.reddit.com/r/Clojure/comments/989b1b/code_review_lumo_based_deploy_script/
You’re doing some argument processing. clojure.tools.cli
works in self-hosted ClojureScript. See http://planck-repl.org/scripts.html
You can use strings where you really have to like in #js {"foo bar" 1}
or #js {"foo/bar" 1}
Thanks! In regards to the clojure.tools.cli what about in a shebang script using lumo? Quick research shows that it’s not the easiest https://github.com/anmonteiro/lumo/issues/291
There are two concerns with that:
1) Whether the lib has been dowloaded. (Lumo doesn’t download deps, and you’d need to delegate to something else)
2) Whether you are on macOS or Linux (or I suppose Windows). On Linux you need to play games like using exec
If you know clj
is installed you can do clj -Spath
to build the classpath for Lumo, and then use clj
’s mechanism to specify the dep
Hmm the idea is to package this script with our main js\python repo. I don’t think that kind of dependency is going to be the best option for us. I think some of our other tooling uses yargs or something along those lines which I can wrap easily to parse args.
I made most of the updates you recommended. It’s a bit cleaner now relying on npm’s yargs processing while still keeping compatibility with our dev env. One question that comes to mind though is that I’m creating and dealing with a lot of JS promises. Is there a better async lumo\cljs system I can use or in this case is it preferred to rely on another node library?
has anybody ever seen the error TypeError TypeError: self__.pred.call is not a function
when doing stest/check
in ClojureScript
I'd like to use a library like https://selectize.github.io/selectize.js/ in my clojurescript (re-frame) project
You can find wrappers for some existing js libraries on cljsjs (including the selectize): https://cljsjs.github.io/
Yes I'm using the wrapper already
But jquery works globally on the dom just not sure how to make it work with reframe
You can use refs: https://reactjs.org/docs/refs-and-the-dom.html
Perhaps this will help https://github.com/Day8/re-frame/blob/master/docs/Using-Stateful-JS-Components.md
seems like jquery based libraries are not really fit for the reagent/re-frame model though
This is not much help, but I have seen mention of refs
in the re-frame context, refs
being React’s way of saying DOM. Have you tried #re-frame or #reagent?
this url suggested should do the trick https://github.com/Day8/re-frame/blob/master/docs/Using-Stateful-JS-Components.md (though I haven't tried yet)
I'm not sure how to actually use it
is there a way to wrap them that makes them easier to use?
I also tried the example in the docs there (js/window.JSON.stringify (js/jQuery (.getElementById js/document "#p1"))
for example but js/document
doesn't actually contain anything useful, so it never finds anything there
that's quite a big difference
(time (dotimes [_ 10000] (str (gensym))))
"Elapsed time: 20.742961 msecs"
(time (dotimes [_ 10000] (.-str (gensym))))
"Elapsed time: 8.783585 msecs"
not a question, just "today I learned" comment 😛@hlolli I’d also be curious about :advanced
and different engines http://blog.fikesfarm.com/posts/2017-11-18-clojurescript-performance-measurement.html
ah I see, it's in lumo these numbers, I'm useing this for generateing id's for promises in IPC browser app, for something I can't compile advance.
@thheller name
same as str
in lumo. Ps, your prototype hack worked with audioworklet, it's all working in pure cljs! Now cleaning up the interface.
I wonder if single-arity str
calls are common. We could optimize the macro to emit
(cljs.core.str.cljs$core$IFn$_invoke$arity$1
(gensym))
(but then perhaps Closure does this for us—I wouldn’t be surprised)@mfikes we already optimize that, https://dev.clojure.org/jira/browse/CLJS-1879
@thheller yeah, I’m referring to eliminating the array construction and the join call, for the single-arity case
see https://dev.clojure.org/jira/browse/CLJS-890 for why that isn't done
Specifically, thinking that instead of
(js* "[cljs.core.str.cljs$core$IFn$_invoke$arity$1(~{})].join('')" (gensym))
the macro could just emit
(js* "cljs.core.str.cljs$core$IFn$_invoke$arity$1(~{})" (gensym))
for the single-arity case. But I bet Closure sees that and eliminates the array and join. Only one way to find out 🙂the reason I discovered it, was seeing the js object for a symbol
(js/console.log (gensym))
{ ns: null,
name: 'G__520075',
str: 'G__520075',
_hash: null,
_meta: null,
'cljs$lang$protocol_mask$partition0$': 2154168321,
'cljs$lang$protocol_mask$partition1$': 4096 }
So I'd assume (.-name (gensym)) would beat (name (gensym)) by tiny bit.. being an accessor.