From 3869922ecdeb230544f348f9de35343e54d059ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Ch=C3=A1varri?= Date: Wed, 9 Nov 2022 15:47:15 +0100 Subject: [PATCH] doc(melange): remove docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Javier Chávarri --- doc/dune-files.rst | 7 +++-- doc/index.rst | 1 - doc/melange.rst | 66 ---------------------------------------------- 3 files changed, 3 insertions(+), 71 deletions(-) delete mode 100644 doc/melange.rst diff --git a/doc/dune-files.rst b/doc/dune-files.rst index 3f06eb88b33..a26fab9866f 100644 --- a/doc/dune-files.rst +++ b/doc/dune-files.rst @@ -586,10 +586,9 @@ to use the :ref:`include_subdirs` stanza. - ``(modes )`` is for modes which should be built by default. The most common use for this feature is to disable native compilation - when writing libraries for the OCaml toplevel. It can also be used to define - libraries that should be compiled with Melange (see :ref:`melange_main`). The - following modes are available: ``byte``, ``native``, ``best``, and ``melange``. - ``best`` is ``native`` or ``byte`` when native compilation isn't available. + when writing libraries for the OCaml toplevel. The following modes are + available: ``byte``, ``native`` and ``best``. ``best`` is ``native`` or + ``byte`` when native compilation isn't available. - ``(no_dynlink)`` disables dynamic linking of the library. This is for advanced use only. By default, you shouldn't set this option. diff --git a/doc/index.rst b/doc/index.rst index 7bf924ddc58..752c4fcadc3 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -35,7 +35,6 @@ Welcome to Dune's Documentation! sites instrumentation jsoo - melange lexical-conventions opam advanced-topics diff --git a/doc/melange.rst b/doc/melange.rst deleted file mode 100644 index 13b26ffbd7b..00000000000 --- a/doc/melange.rst +++ /dev/null @@ -1,66 +0,0 @@ -.. _melange_main: - -*********************************** -JavaScript Compilation With Melange -*********************************** - -`Melange `_ is a compiler from OCaml to -JavaScript. Unlike js_of_ocaml, Melange works by translating OCaml compiler -internal lambda representation to JS files. This allows to produce a single -JavaScript file from each OCaml module. Melange can be installed with -`opam, Esy, or Nix `_ package -managers. - -Compiling to JS -=============== - -Dune has experimental support for building Melange libraries. To use it, you -must declare the ``melange`` extension in your ``dune-project`` file: - -.. code:: scheme - - (lang dune 3.6) - (using melange 0.1) - -Then, given this example: - -.. code:: bash - - echo 'Js.log "hello from melange"' > foo.ml - -With the following ``dune`` file: - -.. code:: scheme - - (library (name foo) (modes melange)) - -One can then request the ``.js`` target: - -.. code:: bash - - $ dune build .foo.objs/melange/foo.js - $ node _build/default/.foo.objs/melange/foo.js - hello from melange - -At the moment, executable targets are not supported, but using explicit -targets inside libraries as shown above should enable similar results. - -Faster Builds with ``subdir`` and ``dirs`` Stanzas -================================================== - -Melange libraries are commonly installed from the ``npm`` package repository, -together with other JavaScript packages. To avoid having Dune inspect -unnecessary folders in ``node_modules``, it is recommended to explicitly -include those folders that are relevant for Melange builds. - -This can be accomplished by combining :ref:`subdir` and :ref:`dune-subdirs` -stanzas in a ``dune`` file and by co-locating this file together with the -``node_modules`` folder. The :ref:`dune-vendored_dirs` stanza can be used as -well to avoid warnings in Melange libraries during the application build. - -.. code:: scheme - - (subdir - node_modules - (vendored_dirs reason-react) - (dirs reason-react))