This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-10
Channels
- # ai (2)
- # beginners (3)
- # boot (113)
- # bristol-clojurians (2)
- # cider (77)
- # clara (43)
- # cljs-dev (48)
- # cljsrn (9)
- # clojure (319)
- # clojure-austin (2)
- # clojure-czech (4)
- # clojure-denmark (4)
- # clojure-france (4)
- # clojure-italy (4)
- # clojure-russia (2)
- # clojure-serbia (10)
- # clojure-spec (79)
- # clojure-uk (64)
- # clojurescript (109)
- # clr (3)
- # conf-proposals (21)
- # core-async (19)
- # cursive (26)
- # datascript (11)
- # datomic (19)
- # devcards (1)
- # emacs (25)
- # figwheel (9)
- # hoplon (31)
- # jobs (7)
- # jobs-discuss (14)
- # leiningen (10)
- # lumo (11)
- # off-topic (37)
- # om (40)
- # onyx (4)
- # perun (8)
- # planck (3)
- # rdf (4)
- # re-frame (40)
- # ring (11)
- # ring-swagger (2)
- # rum (21)
- # spacemacs (2)
- # specter (50)
- # untangled (93)
- # yada (13)
@borkdude goog.Promise docs cite itself as being not entirely necessary anymore except in the functionality that it has that vanilla promises do not. That said, closure promises I think have more consistent behaviour in older browsers
what is wrong with the followingline: (defmulti svg->hiccup :tag) is defmulti not supported in cljs ?
Should be fine
I need the following behavior: get items a .. b and insert them in a data structure at indices a .. b, even if the size of this data structure is smaller than a. Maybe I can use a vector and pad with nils, or is there something better?
how about a map with indicies as keys? could keep a :indicies
vector too if you like
@borkdude I would implement a custom cljs type implementing IIndexed (and other suitable protocols) backed by a JS array, copy on write
and maybe IEditableCollection and ITransientCollection, for more performant modifications, depends on your use-case
I have some problems with clojure-spec on the latest CLJS release. I get Uncaught Error: No protocol method ICounted.-count defined for type cljs.core/Keyword: :cljs.spec/invalid
when calling cljs.spec/valid?
. Anyone that recognizes this or a similar error? It seems like the keyword :cljs.spec/invalid
has sneaked in among the data to be validated...
@henriklundahl you need to produce something minimal
Ok, I'll try.
is there a CLJS equivalent for https://kjur.github.io/jsrsasign/?
I didn't see it in CLJSJS; I assume either because there is a better CLJS option or it hasn't been packaged yet (maybe I can do this?)
@tankthinks that project looks like overkill to me unless you need all of that
thanks @dnolen ... it may be overkill ... i've simply used it in the past because I trust Brock Allen and Dominic Baier who created https://github.com/IdentityServer
gotcha ... yeah ... I really just need java.util.Base64 and java.security.MessageDigest like stuff
i always forget that rule 😄
and you're right ... what I need is usually there, and already nice
it's hard to unlearn that javascript doesn't have a standard lib
thanks @dnolan! ported my clj encryption code to cljs with minimal changes
if goog.crypt
is listening, thank you as well!
thinking about doing this to support D3 & jQuery singleton pattern - https://github.com/clojure/clojurescript/wiki/Singleton-Pattern-Externs-Inference-Support
The part I’m not certain about is the use of this-as
to refer to lifecycle functions
@dnolen The fruit seems so be hanging so low. Doubt I will be coming up with something really helpful. However, I just started trying to figure out how things play together in detail - compiler, closure-library, node modules and so on.
@jiangts I looked into CLJS-1919 far as I can tell - not a bug, you can’t do that in Clojure 1.9.0-alpha14
@deas the above isn’t a request for help - rather just feedback to suss out perceived issues or for people to propose better/alternative approach
planning on cutting a release around 2pm or so, it’s a bugfixes thing but want to make sure we didn’t miss something
for the singleton
Hey everyone! Has anyone integrated https://github.com/clauderic/react-sortable-hoc into their cljs project? I have been struggling with it in my Om app. Any tips would be great. Thanks!
ClojureScript 1.9.473 released https://groups.google.com/forum/#!msg/clojurescript/rK2pnUwvTkI/th7Wh0L6CgAJ
@dnolen huh, interesting. CLJS-1919 worked in the 1.9.229 release and I remember finding something online similar to what I did, so I assumed it was a valid way of using spec. I just re-googled how to use conformers and the method I just tried seems to work :thumbsup:
gotcha. I must’ve found something online that relied on implementation specifics of 1.9.229 or something
I'm also 👍 on the ^:singleton
metadata idea, and am waging a furious internal battle to resist bike-shedding the name of the keyword
@timgilbert now’s good time to suggest alternatives
it’s not something I feel strongly about as it’s not something I ever personally intend to use 🙂
Well, I wonder whether it would make sense to use a namespaced keyword, :js/singleton
or something
I won’t get to any soon then the next release so there’s no rush to find a better name
Awesome! I looked over the other proposal but I don't have strong feelings about (other than some sympathy towards you for needing to interface with existing JS build systems). In the past when I've needed to call out to npm I used https://github.com/RyanMcG/lein-npm but I don't need to do so often.
@timgilbert we’re just going to shell out to Node.js here - it needs to work apart from Leiningen or any other additional tooling
Right, that makes sense
Pardon my ignorance, but is the bit about dependency conflicts there because in a cljs environment, each transitive dependency would wind up in its own top-level Clojure namespace? Like, if the dependency tree is {:a {:x "1.23" :y "1.0"} :x {:y "2.0"}}
, when we (require [y])
we need to know whether to pull in 1.0 or 2.0?
(not sure if that dependency tree makes sense, but just conflicting transitive versions in the tree is what I was going for)
You can now install Planck on Ubuntu 14.04 and 16.04 using apt-get
:
sudo add-apt-repository ppa:mfikes/planck
sudo apt-get update
sudo apt-get install planck
Give it a spin; let me know if you see any issues.@timgilbert it doesn’t really have anything to do with that
and everything to do with the fact that we use maven but we’ll have deps from some other system as well - and these two systems can’t interact
Ah, I see. So is the concern conflict between deps pulled in by, say a leiningen cljsjs package and an npm one?
I think I see, thanks. So these are the sort of things you'd use like a lein [lib.foo "1.2" :exclusions [transitive.lib]]
dependency to resolve in JVM Clojure?
Got it. Thanks for the explanation
@dnolen I am hoping that I can use the same specs for both the front and backend. I am guessing that I would place them in a cljc file, but I was wondering how the s/def would work with s referring to clojure.spec and cljs.spec. Any ideas? I asked in the spec channel and Alex Miller mentioned that the new auto alias function may let me just have my specs in a namespace in cljc and then refer to it from both clojure and clojuresciprt, but he recommended asking you. Thanks!
Hi guys! I'm using cljs-ajax but when I do GET requisition, is very well, and is saving data in my app-db (I'm using re-frame) but I can not get a map key of the response:
I need to get the items
but when I do (.log js/console (:items response)) return 'null'
@victorvoid don’t you need :keywordize-keys
when calling js->clj
? otherwise you have to use string keys
in general it is not considered a good practice to use js->clj
to transform “unknown” data
1) if it is too big, it will lead to performance issues
2) if it contains some wild stuff, it will throw
better leave it in js land and cherry-pick only stuff you really need and know its shape
Nice, thanks! But how I get :items ?
(aget response “items”)
maybe? or (aget response “items ”)
? it is not obvious to me from your code snippet
using (aget ...) return 'undefined'