Quick StartTryGuideAPICommunityBlogGitHub
Search
  • Blog
  • Articles & Videos
  • Examples
  • Events
  • Frequently Asked Questions
  • Roadmap & Contribution
  • Companies

BlogSuggest an edit

Messenger.com Now 50% Converted to Reason

September 8, 2017

Boom!

Messenger.com is the web version of Facebook Messenger; we also share code with facebook.com's inbox view and chat tabs. For over a year, the Reason team has been working directly on Messenger in order to integrate Reason + BuckleScript into the codebases. As of a while ago, we've reached 50% Reason code coverage!

Some Statistics

  • Full rebuild of the Reason part of the codebase is ~2s (a few hundreds of files), incremental build (the norm) is <100ms on average. The BuckleScript author estimates that the build system should scale to a few hundred thousands files in the current condition.
  • Messenger used to receive bugs reports on a daily basis; since the introduction of Reason, there have been a total of 10 bugs (that's during the whole year, not per week)!
  • Most of the messenger core team's new features are now developed in Reason.
  • Dozens of massive refactors while iterating on ReasonReact. Refactoring speed went from days to hours to dozens of minutes. I don't think we've caused more than a few bugs during the process (counted toward the total number of bugs).
  • Everyone writing Reason got promoted for quality engineering. Just kidding. But definitely high, long-term impact.

Which Team's Next?

We believe in iterating on/alongside product teams in order to create the best infra. The product teams' and open source folks' feedback has changed our strategy a few times, for the better. As of today, Reason and BuckleScript are also deployed on a WhatsApp internal tool, Instagram Web (small scale), plus some critical Ads internal tools. We'll be working closely with these teams over the next year.

We've successfully onboarded regular JavaScript folks to Reason; in the most extreme case, an intern with no JS knowledge was able to ship ReasonReact code in production (and made 0 bug while doing so). Give your own team a try! =)

A big thanks to all these teams' members, to Hongbo (BuckleScript author) and to the OCaml community (really, 50% Reason means 50% OCaml. We're nothing without you); and of course, to all of you folks in the community for being with us all this time. The best is yet to come.

See you soon!

Way, Way, Waaaay Nicer Error Messages!

August 25, 2017

A picture's worth a thousand words.

Before:

before
After:
before

Sometimes when I'm busy working, some random colleague/Discord member would ping me and tell me "Yo Cheng Lou why are Reason's errors so bad? Why can't you be more like Elm Cheng Lou? Why? Look at how great Elm's errors are Cheng Lou, look."

In reality I'm pretty darn ashamed of our error messages; here we are, a type system with two decades of solid research and implementation, but sometimes presented to the end users as if it's something that'd get in their way.

No more! We've heard you loud and clear, and delivered you much improved error messages! A few things we did:

  • Display the error-ing line(s), right inside the terminal.
  • Better colors, for quicker visual search.
  • Improved messages in many cases.
  • Errors in Reason syntax for Reason files.
  • A bit of breathing room between lines.

The last point is a tradeoff; errors end up taking more space. Seeing that you'd usually focus on a single error rather than trying to get an overview of all errors, we've deemed this tradeoff worthwhile, especially in the context of a big amount of build output. Considering the new warning format:

warning-after
Here's the same warning, old version, buried among other outputs:
warning-before

At Messenger, we've seen people ship warnings to production not because they didn't want to fix them, but because they've missed them! It's not rocket science. Leave some negative space here and there. Color things appropriately. Voilà!

The new errors can be turned on by adding "bsc-flags": ["-bs-super-errors"] to your bsconfig.json, like so. They're also available for bsb-native. True to our stack's spirit, they're fast, simple to configure, and solid.

One more thing: we're vertically integrated common pitfalls of ReasonReact into these messages too, when applicable.

reason-react

This is just the first of many iterations to come! Got a message you'd like to see explained better? File an issue here!

Enjoy =)

Much Better Playground

August 18, 2017

Based on popular feedback, we've now improved our online Try section. Highlights:

  • Bidirectional conversion. Write Reason, get OCaml translation, vice-versa.
  • Live evaluation, with console feedback in the lower-right section.
  • Most of the standard library is now loaded. Since we're evaluating on the web, This includes BuckleScript's extra stdlib APIs.
  • Sharable code snippet! Just copy the URL.
  • Some performance improvements.

Have fun!

New website!

July 14, 2017

Notice anything different? =)

The new documentation website is built by our community member Jared (make sure to check his Reason blog posts too!). The new site keeps most of the same content from the old one, while providing a better structure to navigate through them. You'll notice "Suggest an edit" links all over the place. Take a look around!

(Built with Gatsby)

New ReasonReact version released

June 12, 2017

Very exciting release! Short version: ReasonReact now has its own documentation site here. Accompanying this is the new BuckleScript release. Both are non-breaking.

Enjoy!

Spring Cleaning (First Blog Post!)

May 18, 2017

Now that the community is taking off, keeping folks up-to-date through Discord and other existing channels became less ideal. We're starting a blog post section for this reason. In the spirit of the community, these posts will stay short and concise.

We've moved unused first-party projects from GitHub/reasonml to GitHub/reasonml-old. Old URLs are redirected, so no breakage here.

We've cleaned up the Reason codebase. Editor integrations moved out to their dedicated repos. Updated instructions are still here. Other Reason repo cleanups are still ongoing.

Some discord rooms got merged together. Fewer rooms, more focused discussions.

As you can see: this documentation site got a few rearrangements too. In general, if you'd like to contribute to docs, please ping us on Discord!