You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems reasonable to me to skip field names while encoding records if we can share record definitions between CLJ and CLJS, so (map->Person {:a 1 :b 2}) will become ["user.Person" 1 2]. This way we can save some space in the wire. If you are interested, I can try to come up with PR eventually, what do you think?
The text was updated successfully, but these errors were encountered:
That sounds good to me. Totally makes sense, provided it doesn't break too many things...
If there is no record definition on one side (i.e. the shared record definition assumption is false) then you'll get an exception with the current algorithm anyway, right? So your proposal won't break anything or require new restrictions on user code?
Does this mean you'd need to use something other than the standard clojure data reader functions to decode records? How do you know how the fields are ordered? Maybe cljson-encode and cljson-decode multimethods instead, that you would extend on both sides (cljs and clj)? What if its only extended on one side?
This won't affect performance when encoding/decoding regular persistent data structures like maps, vectors, etc., as this is the case we want to make sure is fast and correct?
It seems reasonable to me to skip field names while encoding records if we can share record definitions between CLJ and CLJS, so
(map->Person {:a 1 :b 2})
will become["user.Person" 1 2]
. This way we can save some space in the wire. If you are interested, I can try to come up with PR eventually, what do you think?The text was updated successfully, but these errors were encountered: