Melange Q2 2023 Retrospective
As we reflect on Q2 2023, it's an ideal moment to look back on the major strides we've made towards the release and launch of Melange v1.0.
Despite some challenges along the way, we overcame many of them and have positioned ourselves for further success. Let's take a look at what we have accomplished:
Key achievements
Dune Integration
Melange has been successfully integrated in Dune. Dune 3.8, released on May 23rd 2023, can now build Melange projects from start to finish. This enhanced integration brings many improvements to the workflow for compiling OCaml / ReasonML projects to JavaScript:
supports rules for Melange libraries and integrates the dune-release publishing workflow for Melange packages.
streamlines editor setup to be on par with native OCaml projects: Dune can reliably configure and communicate with editor tooling such as OCaml-LSP and Merlin through its RPC protocol.
Melange previously relied on custom configurations and editor settings based on
.merlin
files anddot-merlin-reader
. Not anymore.provides a workflow compatible with modern JS tooling:
allows tracking "runtime assets" (e.g. CSS, JS, SVG files that your Melange application needs at runtime)
the resulting JavaScript files are laid out in a way that is amenable for JS bundler consumption
Learning Materials
We set out to release Melange with an accompanying documentation website. In v1.0, we released an alpha version of melange.re.
Melange Playground
We have been working on a browser-based experience for Melange, which will help showcase how the compiler works for prospective users, for quick browser experimentation and sharing code snippets between coworkers and community members. The Melange playground will be available soon under melange.re/try.
Ecosystem
At the beginning of the quarter, we wanted to port important libraries in the ecosystem and publish them to OPAM.
We created a melange-community organization on GitHub where we'll keep libraries that the Melange team maintains.
We'd love to onboard more maintainers who use these libraries and share a common interest in getting them right. If this is you, please get in touch
The following projects are currently being maintained by the Melange team
reason-react: bindings to React.js
melange-fetch: bindings to the Fetch API
melange-webapi: Melange bindings to the DOM and other Web APIs
melange-jest: bindings to the popular Jest testing framework
melange-testing-library: bindings for testing-library
melange-json: a composable JSON encoding / decoding library
Additionally, most frontend libraries maintained by Ahrefs at github.com/ahrefs have either been ported to Melange or are in the process of being converted.
Ahrefs Case Study
When we started working on integrating Melange in Dune, we were very intentional about developing it in lockstep with a real-world project. That way, we were able to assess the real needs and use-cases of a team using Melange in production, rather than trying to guess what features we would need to include.
We can confidently say that the approach has worked very well so far. We have successfully migrated the Ahrefs monorepo to Melange and Dune. This migration demonstrated the practicality and efficiency of Melange in real-world, large-scale applications.
As part of this work, the team at Ahrefs published a case study detailing the migration strategy, learnings and a future outlook on Melange at Ahrefs.
ReasonML
We also focused some effort over the past quarter on the Reason project:
Reason used to depend on an old version of
ocaml-migrate-parsetree
, which was discontinued in favor of ppxlib.Over the past quarter we ported Reason to ppxlib, and then added support for the upcoming OCaml 5.1.
This work has recently been published in the 3.9.0 release.
Work not done
Despite major accomplishments, we didn't complete every item that we had planned in the Q2 roadmap:
Migrating the Melange internal representation to use OCaml 5 is still unfinished
We also didn't make any progress on source map generation this quarter. There's a working prototype that needs to be finished and tested.
Looking Forward
As we look ahead, there are exciting improvements on the horizon. We will soon publish our detailed roadmap for Q3. The following items remain our biggest priority:
OCaml 5 support
This upcoming change will also fix the automatic documentation generation on the OCaml website, which currently relies on the OCaml 5 binary formats.
Source maps
Better syntax errors, reason-react PPX locations and error messages
Generally available version of melange.re
We’re looking to provide a modern design and branding for the website, finish the playground UI and link to the Melange API documentation.
I'm thankful for the commitment and diligence the team demonstrated over the past few months. We are excited about the momentum behind Melange and look forward to pushing the boundaries of what we can achieve in the next quarter.