This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-17
Channels
- # announcements (13)
- # beginners (56)
- # brompton (1)
- # cider (2)
- # cljsrn (10)
- # clojure (369)
- # clojure-australia (4)
- # clojure-boston (1)
- # clojure-europe (28)
- # clojure-nl (1)
- # clojure-spec (1)
- # clojure-uk (18)
- # clojurescript (26)
- # data-science (2)
- # datahike (4)
- # datalog (2)
- # datasplash (6)
- # datomic (9)
- # events (1)
- # kaocha (4)
- # macro (1)
- # malli (22)
- # meander (40)
- # membrane (30)
- # music (1)
- # nbb (3)
- # news-and-articles (3)
- # off-topic (12)
- # practicalli (1)
- # re-frame (19)
- # remote-jobs (1)
- # sci (22)
- # shadow-cljs (15)
- # spacemacs (4)
- # tools-deps (40)
- # xtdb (26)
Is this something that makes sense to rewrite as a transducer?
(defn find-overlapping [sch]
(->> sch
(mapcat (fn [[k v]] (map #(vector k %) (offset-wires v))))
(reduce (fn [coords [name val]]
(update coords val conj name)) {})
vals
(filter #(> (count %) 1))))
I figured you can replace ->>
with comp
but there is no reduce that returns a transducer, so then it becomes kind of a nasty process where you turn the mapcat into a transducer, the reduce into a transduce, and then the vals+filter step into another one and collect that with into/sequence or something like that?FWIW you could rewrite it using group-by
instead of reduce
. Should make it a bit more clear.
That's true.
Howdy, is anyone using Jest with Clojurescript? I'm particularly interested in experience with writing component tests using React Testing Library
We are thinking of working on integration of Jest with cljs and possibly open sourcing it but wanted to check if there's prior work
can anyone help me understand the difference between using CLJS to generate a static site versus a static-site generator like Jekyll, Hugo, etc.? Specifically the output. Are there ramifications to a JS output versus just HTML? I’m new to the SSG game (and trying to build a blog for me and my friends!)
I’d like to write Clojure or ClojureScript, using Hiccup and a CSS framework like Bulma or Tailwind, to generate static assets I can host on a CDN
If you ship JS code (one that's supposedly not used when you generate just HTML), the amount of data your readers will have to download will be larger. Unless you have large generated HTML documents that require only a little bit of code to generate. Apart from that, some rather rare Internet users simply disable JS in their web browsers. If all you require can be expressed with nothing but HTML+CSS, I would definitely go that road.
I have never dealt with SSG, but CLJ[S] is a general-purpose language, so sure. :) Yeah, I've heard of Cryogen before, seems like the right tool for the job. Haven't heard about Static.
I got it wrong, it’s Stasis https://github.com/magnars/stasis
The question is framed in an odd way. You can generate a static site with any language you choose. If you are using CLJS to just generate HTML which is then served by a server, you would have just created your own SSG (Hugo et al) but in CLJS.
Are you looking to create an SSG tool or do you want to use CLJS with a SSG tool?
Neither actually, I want to create a site that I can host on a CDN or Github Pages or similar and I want to do it in either Clojure or ClojureScript. I was trying to ask about the difference between generating a bunch of HTML with an SSG versus building a conventional cljs frontend. Is it primarily SEO and artifact size? Since one has a bunch of javascript and the other doesn’t Let me know if that doesn’t make any sense because I’m new to this kind of thing
No worries. The answer to this question would be the same as with vanilla JS. So yes, if your site is a SPA then bundle, seo etc can be factors.
What kind of site are you building?
After a bit of research I think I understand the differences now. Though the hybrid approaches like Gatsby.js are pretty confusing!
100%. They don’t make it easy to see what they’re doing 😛 . If it helps at all, I just redid my blog. I used Eleventy and haven’t found a need to use JS/CLJS to enhance the blog yet. Often times there isn’t much need to flood simple sites with JS (and by extension, CLJS). CLJS is what I would add to a simple site (like a blog or marketing site) if I was just trying to learn it, or started getting to a point where I need to manage a bit of state and i’m already adding more JS libraries than it’s worth. If it’s a SPA, or Behaviour intensive site, I would opt for CLJS most times. Only other consideration is do I need to hand the site off to another developer/client without ability to find CLJS developers.
awesome, it does help, and I too was / am gravitating towards 11ty. I think I may go the route of generating HTML via hiccup though, just because I love Hiccup and why learn another templating language when I already know this one?
TMK you can add hiccup and edn to eleventy because they have a flexible templating/data processing hook in