One of the things we don’t transport over to the JS output is comments. Depending on the complexity, we might be able to bring some of those over depending on the ROI. We’d like to know whether there’s good use-cases for them.
We’ll only be able to do it selectively, e.g. letting you write a comment on top of a function and having it carried over to the outputted JS function. The compiler does some optimizations and shuffling, so we won’t have a generalized mechanism for you to output arbitrary comments in any place.
It’s easy to do for functions. Harder for let bindings.
It’s already possible, albeit slightly contrived, to output %%raw doc comments, but only to the top of the file: demo.
If you want to output some type annotations as comments for e.g. TypeScript, consider whether genType solves your issue already.
Isn’t the main use case for IDE intellisense when hovering over values imported from ReScript? We would love this – at the moment we’re using @ocaml.doc everywhere which works but is frankly just weird to see in ReScript files.