DEV Community


Discussion on: Thoughts on migrating to TypeScript and improving the overall quality of the frontend DEV codebase

kayis profile image

ReasonML plzkthxbye πŸ™ƒ

ben profile image
Ben Halpern Author

Does ReasonML compile to directly to JavaScript without library overhead in prod?

I'd be open to multiple approaches in different areas if it doesn't add up to more and more bytes needing to be shipped.

kamilchm profile image
yawaramin profile image
Yawar Amin

ReasonML compiles to pretty minimal strict ES5 that can at times look hand-written. There is very little library overhead and if you know how, you can cut it out almost entirely. See for more details. I'm actually working on a very simple ReasonML library right now that will have no library overhead and can be used trivially by JavaScript callers. The transpiler was designed that way, to enable incremental migration.

This is also a good time to try it out–there's been a new ReasonReact release that supports writing zero-overhead React components, with hooks support:

On top of all that, ReasonML output minifies really well with Rollup (dead code elimination).