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:
(library (modes melange) ;; <- new Melange mode ) ;; emit JS to `js-output` folder in this ;; directory (melange.emit (target js-output))
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.
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
- To exercise modern workflows, Melange has been tested in a Next.js application using React Server Components, and the available constructs were deemed sufficient to enable similar use cases.
The full list of changes can be consulted here.
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