We’re trying to share types between native ocaml and bucklescript. Our types use a set of derivers that are easy to share - show, eq, etc. We’ve also the yojson deriver using [@@deriving yojson {optional = true}]
which has worked well - the types only appear on in native ocaml as that is the only place we try to call it.
However, we’re having trouble using the bin_io deriver. Does anyone have a strategy for using this? The types in question are in source files that are compiled by both bsb and dune, and we’d like the deriver to be called in dune/native and to be ignored by bsb/bucklescript.
I’m thinking that’s a PPX that can do this, some option or package I’ve missed, or maybe y’all do this sort of thing via atdgen or similar?
Thanks!