This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-02
Channels
- # announcements (2)
- # aws (13)
- # beginners (52)
- # boot (10)
- # calva (2)
- # cider (23)
- # clara (23)
- # cljs-dev (16)
- # cljsrn (5)
- # clojure (69)
- # clojure-brasil (1)
- # clojure-conj (3)
- # clojure-dev (41)
- # clojure-india (2)
- # clojure-italy (39)
- # clojure-nl (5)
- # clojure-russia (2)
- # clojure-spec (5)
- # clojure-uk (51)
- # clojurescript (78)
- # code-reviews (13)
- # data-science (2)
- # datascript (22)
- # datomic (47)
- # duct (13)
- # emacs (4)
- # figwheel-main (45)
- # fulcro (85)
- # funcool (4)
- # jobs (9)
- # nrepl (106)
- # off-topic (5)
- # pathom (7)
- # pedestal (2)
- # re-frame (17)
- # reagent (32)
- # reitit (7)
- # ring-swagger (2)
- # shadow-cljs (33)
- # spacemacs (4)
- # specter (2)
- # tools-deps (203)
- # vim (1)
Quick survey 😺 How long does builds take for you folks in average? I am being told node builds take 5-10 minutes and I want to make sure I am not doing anything wrong before answering. At the moment a monorepo build takes 22 minutes and it downloads ~50 deps. I am using shadow-cljs and no m2 caching between builds at the moment.
My whole stack (clj backend, cljs frontend with webpack double-bundle, tests) takes 7-8 minutes on Travis. This includes downloading deps and several Docker images. Monorepo. No caching.
Thank you very much, it seems like I just have many deps to download. It might be shadow. I will investigate.
How long does it take if you run the same thing on your machine? 22 minutes sounds like eternity
it is not a good comparison because I have .m2
always available, but it takes less 😄
I have setup where all CI-stuff runs in Docker and I have .m2
as shared volume. It’s easy to test it locally and nuke .m2
if necessary. 🙂
Here’s docker-compose.yml
https://github.com/lipas-liikuntapaikat/lipas/blob/master/docker-compose.yml and ci.sh
https://github.com/lipas-liikuntapaikat/lipas/blob/master/ci.sh if you’re interested!
thank you this looks very nice!
checking now, I think I owe you a couple of 🍻
the only thing I need to figure out now is how to share volumes on Azure but that looks fantastic
I have around ~ 10 repos and on Azure CI which makes it very tough to cache...I mean ...a docker image away I know but still,some work.
we have a monorepo but build the packages in parallel. currently only 1 CLJS package, with 3 builds that have to run within that package
installing deps, executing the builds, and building the docker container takes about 10 mins
Yeah I do 4 parallel processes - four jvms as well. It seems most of the time is spent downloading the dependencies
Good to know thank you very much it is helpful
I wish I were on CircleCi
is there anyone working on an iOS clojurescript interpreter for iOS like pyhtonista? I saw that Apple's Siri shortcuts allow some amount of coding (https://www.reddit.com/r/shortcuts/comments/9hgblf/pythonista_and_shortcuts/)
Is there such a thing as doing an optimised build without name mangling? I'm after the dead code elimination but would prefer not to pay the price of dealing with externs.
Not sure about vanilla but you can with shadow-cljs
, see the tests here: https://github.com/elasticpath/terraform-env-vars/blob/master/shadow-cljs.edn
Thanks, I'll check it out.
I'd suggest not setting :property-renaming
and :variable-renaming
at all and using the defaults instead
I'm currently reading certain js properties this way: (let [index (when (pos? (alength elements)) (.-_index (aget elements 0)))]
. Now I repeat this for some different properties. How can I pass the .-_index
part as a function, so I can do (prop-fn (aget elements 0)
?
@johb.maier the a
in aget
stands for "array", you can't do this on maps, although it happens to work. It will break in the future.
Okay so I won't do that then. But is there a way to abstract over the property name? I don't mind using strings, but how can the -_index
part in (-_index obj)
be passed as argument?
@johb.maier Instead of (aget foo "_index")
do (goog.object/get foo "_index")
If using :advanced
and the property name can be renamed, goog.reflect/objectProperty
looks promising. (Never used it myself.)
TBH, a challenge with that API is that the property name strings seem to need to be compile-time constants.
I'm not proficient with this (as can be guessed), but I don't think optimization is a problem in my case as they are fixed properties in chartjs.
Yeah, especially if it a foreign lib not being passed through Closure Compiler, :advanced
is Ok if you use goog.object/get
@olivergeorge stepping back a bit - there's no need to be concerned about externs
Thanks David. That sounds perfect.
@polkafreaku Have you seen the re-view/re-frame-simple project?
you can do things like
db/get-in [:x :y :z]
without the suscription
How do folks package ClojureScript libraries with clj
?
@richiardiandrea Same as clojure? Pack, Sean's depstar etc. ?
Uhm right haven't tried that yet. Thank you!
*wrt to reframe, I can't seem to find what's the second argument passed into reg-sub's computation function
@polkafreaku The second argument to the reg-sub
computation function is the argument that was passed to rf/subscribe
. It's commonly ignored because often the only thing in it is the name of the subscription. If you want to pass more information to your subscription, though, you can do this:
(rf/reg-sub
:demo/special
(fn [db [_ extra-stuff]]
(let [stuff (get-in db [:demo :special])]
(str stuff extra-stuff))))
(subscribe [:demo/special "Hi, mom"])
@manutter51 I see.
for example if I have two identical components, each displaying something (like a name maybe), and I want to update just one of the components
I built a simple minesweeper game using just React and a reagent-ish framework I wrote
something that requires a lot of complex graphics & animations you might want to look at using canvas instead of HTML/CSS
speaking of which… I’ve been working on a library as a thinner wrapper around React. I just whipped up a quick demo using the material-ui framework and I’m very impressed with how well it works! 😄 https://github.com/Lokeh/hx/blob/master/examples/workshop/material.cljs
if you want to get rid of this annoying [hx.react :as hx :include-macros true]
:include-macros
you can just add a #?(:cljs (:require-macros [hx.react]))
in hx.react
thanks! I have a plan to just separate the CLJ and CLJS into separate files in a bit, but that will make things easier to use for now
stretch goal is to support CLJ context and rendering to string as well, but not high on my list
OK, here’s a grosser example: using react-dnd https://github.com/Lokeh/hx/blob/master/examples/workshop/react_dnd.cljs