Good Morning!
mรฅnยก
morning
๐
I do like developing at the repl - I can try out things so quickly, code it up as a test, then try it out and bingo - just works ๐
it's the thing i miss most about clj tbh
Morn'
there's no reason you can't repl in js-land is there @alex.lynham?
you can rig up a typescript repl in emacs tbf, but it's just naff
i mean, i already find the cljs repl less useful than the clj one, but everything is async and you can't await stuff easily, so it's just more hassle than writing a unit test tbh
i've used something like this in cljs repl: (defn wait-print [p] (.handle p (fn [success error] (if error (print error) (print success)))))
... and something similar to collect the value/error in an atom - that should work in js repl too ?
yeah i used a similar hack when i was doing cljs/sls stuff
i found it transformational for cljs dev once i got a node-repl going, and could use it pretty much like a clj repl - although CIDER test runner doesn't work, which was sad
idk, it's about going with the grain - it's a pain in TS so i don't do it
it doesn't really add value
and the test watcher for our 400+ tests (db, unit, integration, handler) run in sub 35s, and only run the related changed ones, so that's a better feedback mechanism
morning
anyone here used MongoDb? I've got a n00b question...
not for a while
@rickmoynihan are you folks still using it for bits and pieces?
I'm trying to spin up a trivial replicaset for an integration test; everything running locally; every time I try to make a change I get a 'Command failed with error 10107 (NotMaster)'
its never worked as a replicaset, so I'm sure I've just misconfigured something
over my dead body ๐
somehow the initial Master election never happens, maybe?
its only on some legacy stuff providing a small database of users
rs.status()
{
"errmsg" : "no replset config has been received",
"code" : 94,
"codeName" : "NotYetInitialized"
...
}
I guess that's my problemah i did wonder if zib (memory, is that right?) had meant it went bye bye
I detest Mongo
We are in the process of slowly moving away from Mongo to Postgresql
such a mistake for us to even introduce Mongo into our architecture
on current project we're using postgres as a nosql store
rs.initiate()
run from mongo console seems to help
yeah, I use pg to store json too, and key/value pairs (hstore). works great
it's so stable and AWS aurora supports the PG API so
I managed to avoid Mongo until 2020
we've got aws aurora in prod and treat that like a no maintenance nosql store without the faff of dynamo
lolz
Hats off to their marketing department though, they're playing a blinder
so if we do need to do complex admin tasks for some reason we can run ad hoc queries which is nice
WebScale innit
it does make me appreciate the thing that datomic has got right
Does anyone have recommends for a templating library, i.e., a template + vars == rendered content. This is not for webpages. I'm thinking of using Thymeleaf (which I've used before)
(it's for email templates)
I would have to do thymeleaft interop, which is no biggie...
in recent memory i've used StringTemplate... which was meh... and multiple mustache variants, both home-rolled and imported - i'd probably look at https://github.com/fotoetienne/cljstache , although i haven't used it myself
interesting
will review
ta
looks very good. simple, no other dependencies.
have a ๐บ or ๐ต on me!
works great btw, very easy to integrate. w00t!
even in typescript vs js
i reckon conservatively 10% of our code base is in some way basically just dealing with JS being shite at handling null/undefined
most of the JS bugs I had to deal with were related to that
infuriatingly typescript helps to a point but tends to kick you when you're down
wasn't really an issue i've ever had in cljs
think the compilation story x lisp parens makes it easier to catch errors at dev time even tho it's dynamic not static
nil
is certainly still a problem in clojure/script but it canโt really have a bullet proof design for it, given it works on platforms where the billion dollar mistake (now surely many, many times that) already exists.
It does however manage to insulate you from many problems handling it, by appropriately nil
punning in the seq/core apiโs etc. I canโt really speak for whether typescript does it more or less than clojure, Iโm sure it helps a fair bit though.
i think the design of the core api is the key really
because at dev time TS helps a lot
but at runtime you get some DEVASTATING (and i use all caps here because i think they are justified) edge case bugs
gosh darn
just stuff you take for granted in clj(s) too like what happens when you destructure something nested and a key isn't there
in some cases JS will throw, in some cases it's undefined
, it's still a wild west even with the TS layer sometimes