Hi everyone ![]()
I might be bringing an old topic. I’m working on a test framework for ReScript called zekr, and I’ve been recently trying to add support for code coverage on it.
I was able to do it over the compiled javascript code only, but that’s not ideal. To have a coverage report over the rescript code, I need to map the coverage from JS using source maps. Since rescript doesn’t natively support it, I used a naive custom implementation I generated with AI, that I can at least map top level declarations and some conditional branches. Not very accurate, but it was good enough for me to get a proof of concept:
Still, I wonder if there’s any plan or even motivation for investing in a source map generator. Even though the compiled js code from rescript is clean and very much human-readable, and I really don’t miss source maps while developing or debugging my rescript code, I still think the ecosystem would benefit a lot from source maps, especially when integrating applications with observability tools.
