This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-06
Channels
- # aatree (1)
- # alda (9)
- # beginners (63)
- # boot (124)
- # braid-chat (8)
- # cider (44)
- # cljs-dev (44)
- # clojure (79)
- # clojure-dev (1)
- # clojure-russia (47)
- # clojurescript (105)
- # community-development (16)
- # cursive (3)
- # datavis (1)
- # datomic (54)
- # editors (10)
- # editors-rus (10)
- # emacs (18)
- # garden (1)
- # hoplon (5)
- # jobs (1)
- # ldnclj (6)
- # lein-figwheel (2)
- # luminus (1)
- # off-topic (29)
- # om (49)
- # overtone (5)
- # parinfer (12)
- # proton (2)
- # re-frame (5)
- # reagent (6)
- # ring-swagger (1)
- # slack-help (3)
- # spacemacs (1)
- # yada (42)
I have a {x: [1 2 3 4], y: [a b c d]} and I want it to become [{x: 1, y:a}, {x:2, y:b}… ]
If you have
(defn f [^boolean b]
(loop [x b]
(if x
(recur 0)
:done)))
then (f true)
should never return, right?@cjmurphy: For UI, I prefer to use js interop directly from the react based wrapper rather than a component library built on top of a react wrapper. For me that's the abstraction level that fits. Component libraries above react wrappers bring another cognitive load that I can do without.
@cjmurphy: Here's how I reuse notifications for example: https://github.com/danielsz/om-flash-bootstrap
Someone knows https://github.com/ptaoussanis/nippy like library for clojurescript?
is it by design that you can perform string operations on keywords or is it more a matter of not being worth the effort/perf hit to disallow it?
I seem to recall reading/hearing something about keywords representation but can't find it
I think it's true that at some point they were plain strings, but right now they are cljs.core.Keyword
s.
But they do have a toString
method which when you do keyword + 1
due to some Javascript coercion trickery, coerces both to string and concatenates them.
@niwinz you might want to look at https://github.com/cognitect/transit-cljs is on top of json but it is fast and eventually it will support MessagePack as well
thanks @bruno.bonacci , I know about transit-cljs, but the readme warns about it should not be used for persistence
you want to persist data from ClojureScript on the browser?
you could use transit for the browser->server communication and then use https://github.com/clojure/data.fressian for on the server to persist the data
fressian in the format used by Datomic on the persistence layer
Are either transient to some approximation, or you would probably synchronise them to the backend anyway.
The concrete use case is serialize some maybe bit data tree using some serialization library and compress it using xz in frontend
some of that data will go to the server already using transit other goes to local storage
@niwinz: did you compared the performances of fressian vs nippy?
@bruno.bonacci: https://raw.githubusercontent.com/ptaoussanis/nippy/master/benchmarks.png
in my benchmarks there was only very little difference (fressian 1-2% slower) like the THAW
@jaen Frontend manages a data structure (that can be big) and the approach for persist that is just take a snapshot and persist it...
You could store it on the client but just roundtrip to the backend to get the data serialized/deserialized.
Hah, you don't have to and I don't have time right now unfortunately. What I was trying to say is, if it's something you story only in the browser and not on the server, it seems like something you can just use transit with because it seems transient.
I can use transit but I will lock me always to the v8 (the current version) of the transit spec
Yeah, that's what I mean here - upgrading to newer version of the spec would be a major pain; you'd have to read each blob and write it out again.
what you really want is a high-performance edn serializer/reader which doesn’t exists yet
that would be perfect
And would be hard/impossible to write honestly; JSON/transit are only so fast because they run native code.
i know
I think that the solution will go to be: enable compresson on the transport protocol (http) and just serialize/compress on the backend.
Yeah, that was why I asked if you already have some compression routines, since that's what I was going to suggest
@viebel: I’d be interested if your cljs.core$macros
issue is resolved with the patch in http://dev.clojure.org/jira/browse/CLJS-1541
@oskarth: Also tangentially related: http://dev.clojure.org/jira/browse/CLJS-677
@oskarth: that’s just undefined behavior, you should get a warning about trying to use inc
on anything that isn’t a number (unless it’s a higher order call)
@mfikes you shouldn’t lie about type hints like that - still that’s an interesting edge case since type hints flow across let bindings
@dnolen: ah indeed, tried it without tooling and got an error. planck seems to have swallowed the warning
I’m cutting over my lein-cljsbuild stuff to using cljs.build.api
, mostly because my build has some complexity better served by direct scripting than trying to trick cljsbuild into fitting my needs. But I’d still like to manage dependencies by magic, so I’m using lein deps
to get the jars. What I don’t know is how to tell the compiler where to find them. Do I need to add each lib to the classpath or is there a better way?
@isaac_cambron: lein classpath
is worth checking out
ah, so i would call that, grab the output, add it to my java
command to run the compiler, and then I’m good to go?
makes perfect sense. i’ll try that. thanks!
Garden, the awesome css lib, is up with v1.3.1—bugfixes, parity with libs —> https://github.com/noprompt/garden