clojure-uk

A place for people in the UK, near the UK, visiting the UK, planning to visit the UK or just vaguely interested to randomly chat about things (often vi and emacs, occasionally clojure). More general the #ldnclj
jiriknesl 2020-09-22T04:21:36.031600Z

Good morning

dharrigan 2020-09-22T06:10:03.031800Z

Good Morning!

mccraigmccraig 2020-09-22T06:21:47.032600Z

¡månmån!

dominicm 2020-09-22T06:52:12.032800Z

Morning

djm 2020-09-22T06:55:58.033Z

👋

thomas 2020-09-22T07:29:36.033300Z

morning

alexlynham 2020-09-22T09:59:25.033400Z

morning

2020-09-22T11:35:20.033600Z

Morn' 😃...

alexlynham 2020-09-22T15:21:56.033700Z

was just reading the source code of a lib we depend on p heavily

alexlynham 2020-09-22T15:22:15.033800Z

and maybe i'm feeling @dominicm 's rage at js today

mccraigmccraig 2020-09-22T15:22:36.034100Z

what's the guilty lib @alex.lynham?

alexlynham 2020-09-22T15:22:36.034200Z

some real 'wow okay, you didn't need to reimplement that' moments

alexlynham 2020-09-22T15:22:46.034300Z

the js jsonschema impl

alexlynham 2020-09-22T15:23:01.034400Z

some highlights

alexlynham 2020-09-22T15:23:40.034500Z

https://github.com/tdegrunt/jsonschema/blob/8bbf2c4e10c2290535f41ac9347f361649976745/lib/helpers.js#L228 ^ where instead of using the ok lodash or excellent ramda libs, they reimplement a bunch of merging utils

alexlynham 2020-09-22T15:24:35.034700Z

https://github.com/tdegrunt/jsonschema/blob/8bbf2c4e10c2290535f41ac9347f361649976745/lib/helpers.js#L116 ^ where there's a random set of regexes when there are libs that cover the RFC regexes (admittedly this one isn't so bad, but I do have to trust them, as they're pretty hard to visually parse)

alexlynham 2020-09-22T15:25:17.034900Z

and this lovely bit of code, which was the source of a bug AFAICT https://github.com/tdegrunt/jsonschema/blob/8bbf2c4e10c2290535f41ac9347f361649976745/lib/validator.js#L202 there's so much mutation going on it's hard to tell what's happening, plus loads of OO misdirection

alexlynham 2020-09-22T15:25:28.035100Z

i worked it out in the end but HOO BOY

alexlynham 2020-09-22T15:26:38.035200Z

been meaning to look at switching to the ajv lib and this has just accelerated that

dominicm 2020-09-22T16:36:41.036Z

Have used ajv, experience was mostly good. Performance wasn't great, but I suspect that is down to the size of our schema.