planck-repl / planck

Stand-alone ClojureScript REPL

Home Page:https://planck-repl.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ship with com.cognitect/transit-js supporting meta serialization

mfikes opened this issue · comments

ClojureScript 1.10.520
cljs.user=> (require '[cognitect.transit :as t])
nil
cljs.user=> (defn roundtrip [x]
       #_=>   (let [w (t/writer :json
       #_=>            {:transform t/write-meta})
       #_=>         r (t/reader :json)]
       #_=>             (t/read r (t/write w x))))
#'cljs.user/roundtrip
cljs.user=> (meta (roundtrip ^:foo []))
nil

This might be a stupid question but is the implication of this that transit-js does support this but that transit-cljs doesn't (and so Planck should switch)?

@pyrmont transit-cljs supports serializing meta (cognitect/transit-cljs@35663b3) and transit-js also has the underlying support (cognitect/transit-js@91f55cf).

The only issue is that you need at least transit-js v0.8.859, while if you use transit-cljs v0.8.256, you only appear to get an older copy:

$ clj -Srepro -Sdeps '{:deps {com.cognitect/transit-cljs {:mvn/version "0.8.256"}}}' -Stree
org.clojure/clojure 1.10.1
  org.clojure/spec.alpha 0.2.176
  org.clojure/core.specs.alpha 0.2.44
com.cognitect/transit-cljs 0.8.256
  com.cognitect/transit-js 0.8.846

This is due to this commit only being on master, after the release: cognitect/transit-cljs@b5a67e7

@mfikes Ahhhh, got it. Thanks :)