This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # bangalore-clj (8)
- # beginners (78)
- # boot (68)
- # cljs-dev (32)
- # cljsrn (43)
- # clojars (2)
- # clojure (147)
- # clojure-italy (4)
- # clojure-nl (2)
- # clojure-quebec (1)
- # clojure-russia (19)
- # clojure-spec (17)
- # clojure-uk (25)
- # clojurescript (98)
- # clr (2)
- # core-async (14)
- # cursive (5)
- # datascript (1)
- # datomic (23)
- # emacs (4)
- # hoplon (8)
- # jobs (4)
- # kekkonen (1)
- # lein-figwheel (9)
- # off-topic (2)
- # om (2)
- # om-next (9)
- # onyx (4)
- # planck (2)
- # re-frame (14)
- # ring-swagger (3)
- # untangled (18)
I always thought a straightforward reimplementation of core.async to async/await would not be possible (await returns one value, but channel is continuous stream of values). But if there ever was any kind of rewrite plan, I would like to assist. I’d like the new design to consider adding some dev-time debugging capabilities: https://github.com/binaryage/dirac/issues/36
@ashnur what really helps with keeping your parens balanced in spacemacs is using lisp-mode: http://spacemacs.org/doc/DOCUMENTATION.html#lisp-key-bindings
how about the code i shared? yesterday i was ignored again all day, i am starting to think it depends on the weather. on rainy days i am ignored, on clear days i am not 😄
Hmm. I'm looking at the output of
@jrychter That's on purpose, actually google closure used to assign them to variables and reference them but then went the other way, it turns out there is little savings after gzip
@rauh: oh! Good to know. And now I feel ashamed for not having checked the FAQ first.
Yeah I assign global variable
React.createElement only to realized that I saved 400(!) bytes after gzip 😞
I do a sanity check from time to time, as my app grows. I am at 1.94MB uncompressed, 487kB compressed right now.
@jrychter I automatically gzip the data after an advanced compile. See
:watch-fn compiler option that gets invoked after cljs compiler is done
I will take this occasion to thank everyone for the mindblowing awesomeness of ClojureScript. I can write apps with isomorphic rendering that load and work blazingly fast, and easily maintain complex functionality because Clojure and ClojureScript do not require a lot of code. And the best part — every once in a while I stumble upon an article with "X ways to make sure your React app is fast", and then discover that none of the advice applies to me: all the hard work has already been done for me. So, thank you!
I'd like to restrict the input of a text field in a reagent form to a subset of the alphabet. (one letter abbreviations for amino acids, for the curious). i'm sure this is simple, but i'm at a loss. Does anyone here have any suggestions?
@dbsgtk in a controlled component you can just refuse updates that include disallowed characters, can't you?
@pesterhazy I'm sure that's the case. 🙂 My embarrassment should be evident; this is my first reagent app.
@dbsgtk may be a good idea to start with simple reagent so you know what's the fault of specific libraries
I had to made a change to the goog.dom.fullscreen.js file, and as suggested by @thheller I put it into my cljs sourcepath. But cljsbuild don't compile it or copy it to the correct folder. How could I use this file, so it gets correctly resolved by goog.require?
@danielgrosse it needs to be on the java classpath. if you have a seperate
src/cljs or so for
cljsbuild that won't work
I put it into the directory src/clj/goog/dom/fullscreen.js and the repl returns the correct file. But cljsbuild don't copy it into the goog/dom directory
I might actually be wrong about cljsbuild then, I know this works in shadow-build cause I have done that several times
so, i realized i probably shouldn't be using vectors because i have to check if there is a value in it and it seems they are not very good at this
is there a beginners channel specifically for clojurescript? i have not seen in the list but maybe it's not public or something
Would like to have some feedback. I need to filter and return an array in ClojureScript. Is this good enough?
(to-array (filter #(…) the-array)
@borkdude By using
(filter #(...) the-array) instead of the JS interop
.filter your code will be more portable to CLJC. Not sure if that matters to you or not.
1.5 years ago i had to use ext.js that also has .filter, but no reduce http://docs.sencha.com/extjs/4.0.7/#!/api/Ext.Array
couldn't convince my colleagues to use it though. they preferred the usual multiple nested levels of fors and ifs
This made me wonder a little bit: https://gist.github.com/borkdude/5d552116ed1e7192429d9562277ff8f8
I think it is just for some historical reasons. They should do the same thing I believe.
@darwin The generated JS looks remarkably similar: https://www.dropbox.com/s/47l6s8bjnr6rnek/Screenshot%202016-12-16%2018.18.28.png?dl=0
ok, good point, I take my words back, I thought reduce will add chunking, like doseq does
btw. to play with well with dead code elimination I had to implement another version: https://github.com/binaryage/cljs-oops/blob/d530a3cdf8cbab39bd2699c36caded4414224c50/src/lib/oops/helpers.cljs#L26 but unfortunately I don’t remember the details… the problem was related to protocols
or maybe this is not the case I vaguely remember, once I had to drop protocol dynamic checks to get proper DCE
@borkdude I skimmed the cljs.core sources just briefly and it seems reduce does not do chunking, so it should generate similar code, maybe with some extra varargs handling
but from your screenshot it looks like into-array is actually more efficient code, cljs.core.first and cljs.core.next do protocol checks
I'm working on porting a clj lib to cljs and it uses multimethods with special characters on some methods
(defmacro unary [type f & [e-parse]] (let [e-parse (or e-parse identity)] `(defmethod expression ~type [[_# exp1# & extra#]] (if (seq extra#) (throw (parse-exception "%s only accepts 1 argument. Provided: %s" (name ~type) (vec (cons exp1# extra#)))) (if exp1# (fn [x#] (~f (~e-parse ((expression exp1#) x#)))) (throw (parse-exception "%s requires 1 argument. Provided: %s" (name ~type) exp1#)))))))
@samueldev doesn’t seem necessarily to have anything to do with the compiler at this point
one alternative I had suggested (did nick try it @angusiguess?) is simply to write plain-english versions of those multimethod identifiers with no special characters
Beginner question: I'm trying to get into clojurescript development, am I confused in thinking that neither boot-cljs nor lein-cljsbuild support clojurescript > 1.7.2? And therefore neither supports clojure.spec? If so are clojurescript developers running custom scripts to compile their code? Not doing spec? Or am I missing something? Thanks for your help.
@cdimara ClojureScript is just a library, so I think you may have come to the wrong conclusion here
Okay. I saw Clojurescript is listed as an out of date dependency on the boot-cljs homepage but that must not mean what I think it means: https://jarkeeper.com/adzerk/boot-cljs