I’m currently migrating my app to bs-platform 8.2.0 and I notice a major change for me the removal of [@bs.as]. I think it’s should be added to the documentation.
There is a case where it’s needed like characters with dashes -. Or special name like type.
Mostly for bindings props with some react libraries (like react-native-reanimated and props like type with slide-top or slide-bottom or react-native-vector-icons bindings.
are still supported, but especially with the new poly variant representation the bs.deriving decorator should slowly go away, since poly vars without payload translate to strings:
// Reason
type name = [ `glass | `search];
Js.log(`glass);
// output: "glass"
Js.log(`search)
// output: "search"
In ReScript we have special syntax for illegal identifier names that also work for poly var constructors, but we refrain from advertising this too much because ppl will definitely abuse this:
// ReScript
type name = [ #\"envelope-o"]
Js.log(#\"envelope-o")
// output: "envelope-o"