@vlaaad not sure if you answered this anywhere but how come you are building everything in cljfx on top of :extend-via-metadata
?
@thheller You mean why?
yeah just curious since its the first codebase I see to use that pattern
looks a bit unfamiliar and I wonder why you chose that pattern over just reify
?
do you see any particular benefits?
@thheller there is no benefit for :extend-via-metadata
to be in released version of cljfx, but it was invaluable during development, because you can redefine your protocol and all maps with metas implementing it will continue to work. Basically it solves a problem outlined here: https://github.com/aredington/clojure-repl-sufficient-p/blob/master/src/clojure_repl_sufficient_p/defprotocol.clj
Reifies are opaque: you can't see their internals. Going with defrecords feels unnecessary when you are still searching for fitting shape of data
yeah i know the redefined protocol pain
Now that everything is more or less understood, I think I'll replace maps and metas with reifies: that's why protocol implementations should be treated as black boxes in cljfx
yeah I'm trying to figure out if I can create some fulcro like helpers for cljfx so I'm digging through the internals trying to understand everything
I tried some time ago to replace some widely used lifecycles (such as dynamic) with reifications instead of maps, but haven't seen any performance improvements. Maybe replacing everything will be noticable
yeah shouldn't be a big difference I think
FWIW to fix the redefined protocols problem I usually move my protocol into a foo.protocols
namespace which only does the defprotocol
and since that is only that you never end up reloading that file
the metadata approach however is interesting to see. not quite sure how I feel about it myself but it works 🙂