This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-18
Channels
- # bangalore-clj (1)
- # beginners (60)
- # boot (98)
- # cider (8)
- # clojure (158)
- # clojure-dusseldorf (16)
- # clojure-france (3)
- # clojure-hamburg (2)
- # clojure-mke (2)
- # clojure-russia (11)
- # clojure-serbia (1)
- # clojure-spec (123)
- # clojure-uk (59)
- # clojurescript (44)
- # code-reviews (16)
- # community-development (51)
- # core-async (46)
- # cryogen (1)
- # cursive (9)
- # datascript (5)
- # datomic (36)
- # emacs (3)
- # events (12)
- # hoplon (57)
- # jobs (1)
- # juxt (3)
- # klipse (55)
- # lein-figwheel (3)
- # leiningen (5)
- # luminus (3)
- # off-topic (8)
- # om (75)
- # om-next (9)
- # onyx (17)
- # pedestal (7)
- # portland-or (3)
- # proton (36)
- # protorepl (6)
- # re-frame (3)
- # reagent (33)
- # remote-jobs (1)
- # ring (23)
- # ring-swagger (2)
- # rum (1)
- # specter (1)
- # untangled (36)
- # yada (11)
What would one do to determine the weight (advanced optimized) added by a first level dependency?
@deas You'd have to try it out, with/w/o the dependency (and using it to avoid DCE). Or you can ask here if you tell us the library and you might get a ballpark number
@rauh Measure w/o the deps: Was hoping for a simpler solution. Looks like I'll have to swallow the pill. Thanks.
We have an app that is starting to manage a lot of data on the client side - multiple large lists - are there any pointers or advice for managing the local store - cache etc - or a different way to think about ?
Thanks @rauh - so just fetch and add to datascript ? Any way to manage size of the app-db ?
Yeah depending on what your data looks like, it'll be easy to add it to datascript. The size of the DB is pretty small since datascript doesn't duplicate anything. But if you need to get rid of old stuff then you'll need to purge it manually
I guess there's not yet lein-cljsbuild support for self-hosted ClojureScript, or something like that?
@rauh Is working & debuging with datascript nice ? A bit used to atom state, that I can print, and inspect easily.
@claudiu With a few helper functions, yes. I recommend (es-by-a :post/id)
-> "gets all post entities" or (e-by-av :post/id current-post-id)
etc.
@rauh cool, will give datascript a try and see how it goes. Definitely have a use-case for it in my next project, not sure yet if it's a good fit for the entire app state.
if i had a loop of images i was downloading and a callback when each one had downloaded, can i use core.async to prevent the loop from proceeding to next item in list using core.async until the callback has been called ?
does this look right ? https://gist.github.com/jdkealy/d6f49c83246616d537e3c393d501dfc8
no, your fn returns the result of the go block immediately. and the go blocks run on different "thread"
well the browser capable of parallel image download. do you want to download the images one-by-one one after the other finished?
maybe a variation of this https://gist.github.com/swannodette/5882703
you put all of that processing inside the go-loop block but instead of waiting for timeout, you wait for the callback result
so i open a channel, make a go block, call a function with a callback, put a value on the channel in the callback and below the part where the function recurs i take from the channel, hypothetically causing the loop to block
`(fn [] (>! c "callback")) fails because of the limitation of go block https://github.com/clojure/core.async/wiki/Go-Block-Best-Practices#unsupported-constructs-and-other-limitations-in-go-blocks
@jdkealy back to your original snippet, the doall map immediately returns a sequence of channels which those go block returns. then image downloads are done by browser in those separate go blocks. no coordination between those go blocks, so the browser attempt to run those download in parallel.
@jdkealy i would use a go-loop that reads img to download from a input channel then download the img. something like this code sketch
each download will block the next one because go-loop block will wait for the value of channel returned by download
function
if someone is working on something like https://javascript30.com but for clojurescript, let me know
I’ve never heard of CLJS and angular together but I suppose it can be done with interop
having some issues with names getting screwed up (advanced compilation) when combining cljsjs foreign-libs and module splitting. is this a problematic thing to do theoretically?