Melange 1.0 is here
Published JUNE 2, 2023
Hey folks, this is a special one.
The Melange team and I are thrilled to announce the release of Melange 1.0 today, marking a major milestone in the life of the project. This release represents the culmination of many months of hard work and incredible collaboration.
$ opam install melange.1.0.0
Integrating with Dune was our biggest priority. Dune 3.8, released very recently, adds Melange support by understanding the following types of stanzas:
(modes melange) ;; <- new Melange mode
;; emit JS to `js-output` folder in this
In Melange 1.0, the Dune integration is the officially supported workflow to build Melange projects. It provides robust rule generation, static assets support (your HTML / CSS / SVG / images), seamless editor integration (e.g. with OCaml LSP or Merlin).
With Melange 1.0, we’re also launching a new documentation effort, melange.re. This website should currently be considered a work in progress, and we’re looking for feedback on how to best explain the Melange workflow and its available features. Feel free to get in touch in the OSS repository.
Additionally, the Dune documentation includes reference materials specific to using Melange with Dune.
Wider OCaml version support
Melange was previously only available on OCaml 4.14. In this release, we’ve widened that range to versions of OCaml starting from version 4.13. This includes the OCaml 5 release line and allows Melange projects to share the same OCaml compiler switch as e.g. server-side projects.
Editor integration is the only caveat: it only works on OCaml 4.14, since Melange emits
.cmt artifacts (used by e.g. LSP) targeting the OCaml 4.14 binary format.
Dune supports ReasonML out of the box via dialects, keeping ReasonML support in Melange unchanged from a user perspective. Internally, however, Melange 1.0 has dropped any knowledge of ReasonML, relying on the existing, battle-tested Dune support for dialects instead.
rescript-syntax package is part of the Melange release too. It enables support for ReScript syntax in Melange, which Dune also supports. Keep in mind, however, that newer ReScript features are unlikely to be supported by this best-effort compatibility package.
A big benefit of deep integration with the OCaml platform is having the freedom to assume that a native toolchain is present. That made it possible to unbundle the Melange distribution into a few separate components.
The React JS PPX (for Reason + JSX) has also been extracted and is now distributed separately as
Enabling modern JS workflows
Full list of changes:
The full list of changes can be consulted here.
Support & Sponsorship
The effort that went into this release would not have been possible without the support of many.
We’d like to thank everyone who made it possible:
Qwick, who has been running Melange since November 2022, providing invaluable feedback, financial backing and an open-minded team willing to try new directions.
My (Antonio) sponsors on GitHub, both past and present
We’d also like to thank the following notable contributors to this release:
Rudi Grinberg, for his indispensable guidance and direction on the design and implementation of the Dune integration.
Javier Chávarri, for migrating a huge production codebase at Ahrefs to Melange, working on the Dune integration, the Melange documentation effort and providing vital feedback to the project.
David Sancho, for trying out our most bleeding edge ideas and providing early feedback on how to move forward with ways that encompass the whole ecosystem.
Our Q2 2023 roadmap includes most of the goals that we set out to achieve over the past few months, and some of what we’re thinking about working in the months ahead. Melange 1.0 only marks the beginning of our journey towards the best OCaml experience on the JS platform.
Finally, we would like to extend our deepest thanks to everyone who has supported the project, whether through code contributions, testing, or providing feedback. This is your achievement as much as it is ours, and we look forward to continuing this journey together.
Antonio & The Melange Team
P.S.: If you are interested in trying out Melange, feel free to reply to this email. I’d love to hear from you!