I created a react application using: bsb -init ontology-editor -theme react-hooks
It creates ReasonML .re files. I renamed some of them to .res, but , .res files do not support ReasonML syntax, such as document##createElement(...). After I edited the incompatibilities, everything worked fine. Questions:
I understood that Rescript was backward compatible with ReasonML (no breaking changes). Isn’t that the case?
Can I freely mix .re and .res in a react project? Will the compiler recognize them without any need to alter the build files?
I am confused about the relationship between the 3 syntaxes. I understood that the ReScript compiler would compile:
OCaml -> javascript
Reason -> OCaml -> javascript
ReScript -> OCaml -> javascript
If I needed, the compiler had the option to compile Reason or ReScript to OCaml. I could then
compile OCaml to native code (using another OCaml compiler). Is that the case?
The ReScript compiler takes those three syntaxes as input and produces JavaScript output only. It does not produce OCaml output. Targeting native OCaml is a non-goal of ReScript.