This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-09
Channels
- # adventofcode (95)
- # announcements (22)
- # aws (2)
- # babashka (14)
- # beginners (133)
- # bristol-clojurians (2)
- # calva (43)
- # cider (11)
- # clj-kondo (82)
- # cljsrn (20)
- # clojure (100)
- # clojure-europe (12)
- # clojure-italy (9)
- # clojure-nl (7)
- # clojure-poland (1)
- # clojure-spec (4)
- # clojure-uk (105)
- # clojurescript (42)
- # cryogen (1)
- # cursive (6)
- # data-science (1)
- # datomic (5)
- # euroclojure (2)
- # figwheel (4)
- # fulcro (4)
- # garden (1)
- # graphql (3)
- # hoplon (4)
- # jobs (1)
- # joker (3)
- # luminus (4)
- # malli (15)
- # off-topic (129)
- # pathom (10)
- # re-frame (43)
- # reagent (7)
- # reitit (3)
- # shadow-cljs (31)
- # vim (6)
- # yada (39)
That's certainly the impression I get as an outsider to the whole ClojureScript ecosystem. I don't know how real that is...
According to State of Clojure 2019 https://www.surveymonkey.com/results/SM-S9JVNXNQV/ Figwheel had over 65% of the "market" last year compared to Shadow's 21%.
(Shadow wasn't even mentioned in 2018's survey)
I personally don't think it's significantly better than figwheel. It's equal maybe. Better npm support, but an alternative compiler meaning you have an extra layer to search for bugs in.
I think the documentation around Figwheel - the website, the tutorials etc. is fantastic.
(and we are all n00bs)
@dominicm Yeah, that aspect of Shadow does make me uneasy...
It's not like clojurescript is the most stable foundation in the world to begin with. So anything that exemplifies that is a problem.
@seancorfield For projects that I’ve gotten into some stable point but still want to update, there is some sense that I do have to now work out how this new system works…
Which certainly has a old man shakes fist at an ever changing world vibe, but at the same time that cost isn’t nothing… 😞
My personal opinion is that figwheel and browserify is a beautiful pairing for clojurescript with npm.
One thing to consider, the author of shadow.cljs is not only super supportive, but makes fixes to any issues that come up in a very short time, in few hours from the things I’ve seen in the past. I’m not saying that he’s super human and on PR fixes like mad, but this is a pattern I’ve seen from him quite a lot..
This has definitely been my experience too, and the same for other people on our team.
no the maintainer is pretty awesome, don’t get me wrong, but for example last night I was tinkering with rot-js
Something I was expecting to just work by importing it in npm (I was using calva which has a mention of shadow-cljs), but trying to work out how to import stuff correctly or interop with this thing I just imported was just painful. I’ve got to get a lot closer to cljs side of things than I’m used to, which is a bit frustrating as I’m usually trying to wrap that up…
He's definitely responsive! But good luck reproducing your strange compilation error outside your project. It's very rare I can reliably reproduce that stuff in order to bug report it.
ime if you work in cljs and aren’t prepared to get p close to js, let alone the cljs ecosystem you’re soon going to have a bad time:tm:
besides which as much as I think re-frame is ace, given that I don’t really use repl driven development in cljs land I’m still a little meh on whether I would just use JS for my next project. the tooling is good, you can enforce consts only via linter, etc
I think the fact I don't do much at the repl in clojurescript means I'm doing something wrong.
I’ve been really trying on and off to better integrate my experience with it, but it’s surprisingly fiddly to do seamlessly…
@alex.lynham sure you can lint, but you can't lint your way around basic sensible immutable-datastructure fp being awfully painful in js
sure, but the tooling in js for “doing some stuff in the browser” is better, and lower friction
like, I’ve made my bed with cljs for now, but I do miss things about JS in terms of just getting stuff done
it does require a bunch more discipline to not shoot yourself in the foot tho
being able to try out a function, tweak it, then show it works, and be confident it will work in code is sooo good.
Say I have a text file that contains multiple json documents, unfortunately, not separated in any way, except like this:
I'm leaning towards the new
form, since it is easy to miss the .
at the end of the Class, Bar
in this case.
I much prefer the former. I think if you miss the .
you’ll quickly realise what you did… Class is not a function errors, I’d expect.
Hey chaps and chapesses, so a few weeks ago in here I was talking about the "stop the presses" process in agile manufacturing at places like Toyota, where people can press a button and stop things to find improvements. Somebody told me the official Japanese word for this, and I have forgotten it. Anybody got it to mind, colleague asking for the name.
? lazyness at work?
how are you decompressing your inputstream?
we need snippets
(defn compressed-object->json-seq
[object]
(let [{:keys [Body ContentLength]} object]
(when (> ContentLength 0)
(with-open [gzipped-data (new GZIPInputStream (io/input-stream Body) ContentLength)
raw-data (new InputStreamReader gzipped-data StandardCharsets/UTF_8)]
(json/parsed-seq (new StringReader (slurp raw-data)) true)))))
ah right, so the GZipInputStream gets closed as the function returns
but since its a lazy seq, you have'nt read any data at that point
(defn compressed-object->json-seq
[object]
(let [{:keys [Body ContentLength]} object]
(when (> ContentLength 0)
(with-open [gzipped-data (new GZIPInputStream (io/input-stream Body) ContentLength)]
(json/parsed-seq (io/reader (new InputStreamReader gzipped-data StandardCharsets/UTF_8)) true)))))
the worst of all worlds
(except the world where you want things to actually work)
could be a suitable candidate for IReduceInit
depends on how much json you are expecting really
(when (pos? ContentLength)
(defn compressed-object->json-seq
[object]
(let [{:keys [Body ContentLength]} object]
(when (pos? ContentLength)
(with-open [gzipped-data (new GZIPInputStream (io/input-stream Body) ContentLength)]
(json/parsed-seq (new StringReader (slurp gzipped-data :encoding "UTF-8")) true)))))
no worries
can you (io/reader
instead of (new StringReader
?
ah well
(doc jio/reader)
-------------------------
<http://clojure.java.io/reader|clojure.java.io/reader>
([x & opts])
Attempts to coerce its argument into an open java.io.Reader.
Default implementations always return a java.io.BufferedReader.
Default implementations are provided for Reader, BufferedReader,
InputStream, File, URI, URL, Socket, byte arrays, character arrays,
and String.
* If argument is a String, it tries to resolve it first as a URI, then
as a local file name. URIs with a 'file' protocol are converted to
local file names.*
Should be used inside with-open to ensure the Reader is properly
closed.
=> nil
fwiw it does occur to me @mccraigmccraig based on mucking around I’ve had to do today that having language constructs like atoms just available is maybe a more convincing argument for expressiveness in a UI-focussed world :thinking_face: tho idk
obv not arguing that immutable first is more foolproof way of catching bugs, but thinking mainly of expressivity/productivity which is often a function of lang and tools & it’s there where the tradeoff is maybe (?) more interesting
☕ thoughts
Hello all, if anyone would like to organise a ClojureBridge London event in future, all the details you need are documented, so anyone can do it. I am happy to advise anyone who wants to organise / host an event. There is an investment in time, especially if you do this well, but the mechanics are not complicated. https://clojurebridgelondon.github.io/organise-clojurebridge-london/ I will be focusing most of my efforts on https://practicalli.github.io/ weekly 1 hour Clojure tutorials via YouTube and the free online books. Thank you.
I might get a job too 🙂
Oh, I wouldn't mind helping out! Let's talk about it offline John - how about tomorrow? I'll be about on Slack
there is a #clojurebridge-london channel that is useful to discuss specifics about organising and planning events. Thats probably as looped in as it gets 🙂 If no one has started organising something by the end of January, I may start gently nudging people. For everything else there is GitHub 🙂