This took a while to track down. I reduced it down to this minimal input:
(def pathological
[{:any-value {["this vector makes this a cmap"] "any value"
"any string" :victim}}
{:victim :any-other-value}])
transit-cljs fails to serialize that properly. I've verified this by roundtripping it, and testing in Clojure. You can see below that it strips the second :victim.
ORIGINAL VALUE:
[{:any-value {[this vector makes this a cmap] any value, any string :victim}} {:victim :any-other-value}]
SERIALIZED:
[["^ ","~:any-value",["~#cmap",[["this vector makes this a cmap"],"any value","any string","~:victim"]]],["^ ","^3","~:any-other-value"]]
FAILURE
ROUNDTRIP VALUE:
[{:any-value {[this vector makes this a cmap] any value, any string :victim}} {nil :any-other-value}]
ORIGINAL VALUE:
[{:any-value {[this vector makes this a cmap] any value, any string :victim}} {:victim :any-other-value}]
SERIALIZED:
[["^ ","~:any-value",["~#cmap",[["this vector makes this a cmap"],"any value","any string","~:victim"]]],["^ ","^2","~:any-other-value"]]
Successful roundtrip
This took a while to track down. I reduced it down to this minimal input:
transit-cljs fails to serialize that properly. I've verified this by roundtripping it, and testing in Clojure. You can see below that it strips the second
:victim
.ClojureScript: Fails
OUTPUT:
Clojure: Succeeds
OUTPUT: